Skip to content

Commit

Permalink
Let user be able to change MKLDNN "-m" flags back and forth in subseq…
Browse files Browse the repository at this point in the history
…uent builds (pytorch#23608)

Summary:
Currently once user has set `USE_NATIVE_ARCH` to OFF, they will never be able to turn it on for MKLDNN again by simply changing `USE_NATIVE_ARCH`. This commit fixes this issue.

Following up 09ba4df
Pull Request resolved: pytorch#23608

Differential Revision: D16599600

Pulled By: ezyang

fbshipit-source-id: 88bbec1b1504b5deba63e56f78632937d003a1f6
  • Loading branch information
xuhdev authored and facebook-github-bot committed Aug 1, 2019
1 parent 02f794b commit 388dc4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmake/Modules/FindMKLDNN.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ ENDIF()
SET(WITH_TEST FALSE CACHE BOOL "" FORCE)
SET(WITH_EXAMPLE FALSE CACHE BOOL "" FORCE)
SET(MKLDNN_LIBRARY_TYPE STATIC CACHE STRING "" FORCE)
IF(NOT MKLDNN_USE_NATIVE_ARCH) # Disable HostOpts in MKL-DNN.
IF(MKLDNN_USE_NATIVE_ARCH) # Disable HostOpts in MKLDNN unless MKLDNN_USE_NATIVE_ARCH is set.
SET(ARCH_OPT_FLAGS "HostOpts" CACHE STRING "" FORCE)
ELSE()
IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
SET(ARCH_OPT_FLAGS "-msse4" CACHE STRING "" FORCE)
ELSE()
Expand Down

0 comments on commit 388dc4f

Please sign in to comment.