This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Include all mkldnn headers in CD builds #18355
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -240,24 +240,26 @@ if(USE_MKLDNN) | |
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /EHsc /Gy /MT") | ||
endif() | ||
|
||
set(MKLDNN_BUILD_TESTS OFF CACHE INTERNAL "" FORCE) | ||
set(MKLDNN_BUILD_EXAMPLES OFF CACHE INTERNAL "" FORCE) | ||
set(MKLDNN_ARCH_OPT_FLAGS "" CACHE INTERNAL "" FORCE) | ||
set(MKLDNN_ENABLE_JIT_PROFILING OFF CACHE INTERNAL "" FORCE) | ||
set(MKLDNN_LIBRARY_TYPE STATIC CACHE INTERNAL "" FORCE) | ||
set(DNNL_ENABLE_CONCURRENT_EXEC ON CACHE INTERNAL "" FORCE) | ||
|
||
if(NOT USE_OPENMP) | ||
function(load_mkldnn) | ||
set(MKLDNN_BUILD_TESTS OFF CACHE INTERNAL "" FORCE) | ||
set(MKLDNN_BUILD_EXAMPLES OFF CACHE INTERNAL "" FORCE) | ||
set(MKLDNN_ARCH_OPT_FLAGS "" CACHE INTERNAL "" FORCE) | ||
set(MKLDNN_ENABLE_JIT_PROFILING OFF CACHE INTERNAL "" FORCE) | ||
set(MKLDNN_LIBRARY_TYPE STATIC CACHE INTERNAL "" FORCE) | ||
set(DNNL_ENABLE_CONCURRENT_EXEC ON CACHE INTERNAL "" FORCE) | ||
|
||
if(NOT USE_OPENMP) | ||
set(MKLDNN_CPU_RUNTIME SEQ CACHE INTERNAL "" FORCE) | ||
endif() | ||
|
||
add_subdirectory(3rdparty/mkldnn) | ||
endif() | ||
|
||
set(CMAKE_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/mkldnn") | ||
add_subdirectory(3rdparty/mkldnn) | ||
endfunction() | ||
load_mkldnn() | ||
include_directories(3rdparty/mkldnn/include) | ||
include_directories(${PROJECT_BINARY_DIR}/3rdparty/mkldnn/include) | ||
add_definitions(-DMXNET_USE_MKLDNN=1) | ||
list(APPEND mxnet_LINKER_LIBS dnnl) | ||
set(INSTALL_MKLDNN ON) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why it's removed? @yzhliu FYI. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This variable isn't used anywhere but in this line |
||
endif() | ||
|
||
# Allow Cuda compiles outside of src tree to find things in 'src' and 'include' | ||
|
@@ -838,22 +840,17 @@ if(MSVC AND USE_MXNET_LIB_NAMING) | |
endif() | ||
|
||
|
||
# NOTE: Public headers will be installed into ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}, see | ||
# https://cmake.org/cmake/help/v3.13/variable/CMAKE_INSTALL_PREFIX.html | ||
# https://cmake.org/cmake/help/v3.13/module/GNUInstallDirs.html | ||
include(GNUInstallDirs) | ||
install(TARGETS ${MXNET_INSTALL_TARGETS} | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
) | ||
|
||
# NOTE: Public headers will be installed into ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}, see | ||
# https://cmake.org/cmake/help/v3.0/variable/CMAKE_INSTALL_PREFIX.html | ||
# https://cmake.org/cmake/help/v3.0/module/GNUInstallDirs.html | ||
|
||
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/dlpack/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/dmlc-core/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
if(USE_MKLDNN) | ||
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/mkldnn/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
endif() | ||
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/mshadow/mshadow/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mshadow) | ||
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/mxnet/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mxnet) | ||
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/tvm/nnvm/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why need put them into a function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functions have their own scope in cmake. We don't want to change any of the settings outside of this function (such as the install target name for the include files)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it's really about setting the
CMAKE_INSTALL_INCLUDEDIR
differently for mkldnn which is introduced in this PR