Skip to content

Commit

Permalink
Merge pull request microsoft#55 from Microsoft/jywu/incr_fixup
Browse files Browse the repository at this point in the history
fix for possible incremental build breaks.
  • Loading branch information
jywu-msft authored Nov 29, 2018
2 parents 846044e + 3feeb9d commit ca86d8f
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit ca86d8f

Please sign in to comment.