Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
c5787cc5
Commit
c5787cc5
authored
Sep 08, 2017
by
Jaikrishnan Menon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMake: Add an MKL-DNN patch to the build steps
This is temporary and will be removed once upstreamed
parent
1a4cd554
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
external_mkldnn.cmake
cmake/external_mkldnn.cmake
+2
-0
mkldnn-cmake-openmp.patch
third-party/patches/mkldnn-cmake-openmp.patch
+38
-0
No files found.
cmake/external_mkldnn.cmake
View file @
c5787cc5
...
...
@@ -27,6 +27,7 @@ if (${CMAKE_VERSION} VERSION_LESS 3.2)
ext_mkldnn
GIT_REPOSITORY
${
MKLDNN_GIT_REPO_URL
}
UPDATE_COMMAND
""
PATCH_COMMAND git am
${
CMAKE_SOURCE_DIR
}
/third-party/patches/mkldnn-cmake-openmp.patch
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=
${
EXTERNAL_INSTALL_LOCATION
}
)
else
()
...
...
@@ -34,6 +35,7 @@ else()
ext_mkldnn
GIT_REPOSITORY
${
MKLDNN_GIT_REPO_URL
}
UPDATE_COMMAND
""
PATCH_COMMAND git am
${
CMAKE_SOURCE_DIR
}
/third-party/patches/mkldnn-cmake-openmp.patch
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=
${
EXTERNAL_INSTALL_LOCATION
}
BUILD_BYPRODUCTS
"
${
EXTERNAL_INSTALL_LOCATION
}
/include/mkldnn.hpp"
)
...
...
third-party/patches/mkldnn-cmake-openmp.patch
0 → 100644
View file @
c5787cc5
From 6ca95a7c6802eef486ef1d47ad76094eb1164a7c Mon Sep 17 00:00:00 2001
From: Jaikrishnan Menon <jaikrishnan.menon@intel.com>
Date: Fri, 8 Sep 2017 15:01:59 -0700
Subject: [PATCH] CMake: Detect the right OpenMP flags on the host platform
instead of hardcoding '-fopenmp'
---
CMakeLists.txt | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1e19215..3cb71bd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -81,8 +81,18 @@ if(WIN32)
add_definitions(/Qpar)
endif()
elseif(UNIX OR APPLE)
- set(OPENMP_FLAGS "-fopenmp")
- set(CMAKE_CCXX_FLAGS "${CMAKE_CCXX_FLAGS} ${OPENMP_FLAGS} ${CCXX_WARN_FLAGS} -DMKLDNN_DLL -DMKLDNN_DLL_EXPORTS -fvisibility=internal")
+ # Discover the right OpenMP flags
+ set(OPENMP_FLAGS "")
+ find_package(OpenMP)
+ if(OpenMP_C_FOUND)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
+ endif()
+ if(OpenMP_CXX_FOUND)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+ set(OPENMP_FLAGS "${OpenMP_CXX_FLAGS}")
+ endif()
+
+ set(CMAKE_CCXX_FLAGS "${CMAKE_CCXX_FLAGS} ${CCXX_WARN_FLAGS} -DMKLDNN_DLL -DMKLDNN_DLL_EXPORTS -fvisibility=internal")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CCXX_FLAGS} -std=c99")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CCXX_FLAGS} -std=c++11 -fvisibility-inlines-hidden")
set(CCXX_WARN_FLAGS "-Wall -Werror -Wno-unknown-pragmas")
--
1.9.1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment