Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for possible incremental build breaks. #55

Merged
merged 2 commits into from
Nov 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cmake/external/mkldnn.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ set(MKLDNN_INCLUDE_DIR ${MKLDNN_INSTALL}/include)
# patch for mkldnn_sgemm thread safety bug.
# it can be removed once a fix is available in a validated mkldnn release version.
set(MKLDNN_PATCH_COMMAND1 git apply ${CMAKE_SOURCE_DIR}/patches/mkldnn/mkldnn_sgemm.patch)
set(MKLDNN_PATCH_COMMAND2 git apply ${CMAKE_SOURCE_DIR}/patches/mkldnn/platform.cmake.patch)
# discard prior changes due to patching in mkldnn source to unblock incremental builds.
set(MKLDNN_PATCH_DISCARD_COMMAND cd ${MKLDNN_SOURCE} && git checkout -- .)

if(WIN32)
set(MKLDNN_SHARED_LIB mkldnn.dll)
Expand All @@ -20,7 +23,6 @@ if(WIN32)
set(MKLML_SHARED_LIB mklml.dll)
set(IOMP5MD_SHARED_LIB libiomp5md.dll)
endif()
set(MKLDNN_PATCH_COMMAND2 "")
else()
if (APPLE)
set(MKLDNN_SHARED_LIB libmkldnn.0.dylib)
Expand All @@ -32,7 +34,6 @@ else()
set(MKLML_SHARED_LIB libmklml_intel.so)
set(IOMP5MD_SHARED_LIB libiomp5.so)
endif()
set(MKLDNN_PATCH_COMMAND2 git apply ${CMAKE_SOURCE_DIR}/patches/mkldnn/platform.cmake.patch)
endif()

if(NOT onnxruntime_USE_MKLDNN OR EXISTS ${MKLDNN_SOURCE}/external)
Expand All @@ -43,7 +44,7 @@ ExternalProject_Add(project_mkldnn
PREFIX mkl-dnn
GIT_REPOSITORY ${MKLDNN_URL}
GIT_TAG ${MKLDNN_TAG}
PATCH_COMMAND ${DOWNLOAD_MKLML} COMMAND ${MKLDNN_PATCH_COMMAND1} COMMAND ${MKLDNN_PATCH_COMMAND2}
PATCH_COMMAND ${DOWNLOAD_MKLML} COMMAND ${MKLDNN_PATCH_DISCARD_COMMAND} COMMAND ${MKLDNN_PATCH_COMMAND1} COMMAND ${MKLDNN_PATCH_COMMAND2}
SOURCE_DIR ${MKLDNN_SOURCE}
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${MKLDNN_INSTALL}
)
Expand Down