Skip to content

Commit

Permalink
build: add MKLDNN_ prefix to cmake options
Browse files Browse the repository at this point in the history
  • Loading branch information
Fomenko, Evarist M committed Mar 7, 2019
1 parent 75f52f6 commit 2a011ff
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ you can pass Intel MKL-DNN specific options:
|:--- |:--- | :---
|MKLDNN_LIBRARY_TYPE | **SHARED**, STATIC | Defines the resulting library type
|MKLDNN_THREADING | **OMP**, OMP:INTEL, OMP:COMP, TBB | Defines the threading type
|WITH_EXAMPLE | **ON**, OFF | Controls building the examples
|WITH_TEST | **ON**, OFF | Controls building the tests
|ARCH_OPT_FLAGS | *compiler flags* | Specifies compiler optimization flags (see warning note below)
|MKLDNN_BUILD_EXAMPLES | **ON**, OFF | Controls building the examples
|MKLDNN_BUILD_TESTS | **ON**, OFF | Controls building the tests
|MKLDNN_ARCH_OPT_FLAGS | *compiler flags* | Specifies compiler optimization flags (see warning note below)
|VTUNEROOT | *path* | Enables integration with Intel(R) VTune(TM) Amplifier

> **WARNING**
Expand All @@ -171,7 +171,7 @@ you can pass Intel MKL-DNN specific options:
> that are instruction-set compatible with the compiling machine.
>
> Therefore, if Intel MKL-DNN is to be shipped to other platforms (for example, built by
> Linux distribution maintainers), consider setting `ARCH_OPT_FLAGS` to `""`.
> Linux distribution maintainers), consider setting `MKLDNN_ARCH_OPT_FLAGS` to `""`.
For more options and details, check [cmake/options.cmake](cmake/options.cmake).

Expand Down
8 changes: 4 additions & 4 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ option(MKLDNN_ENABLE_CONCURRENT_EXEC

set(MKLDNN_LIBRARY_TYPE "SHARED" CACHE STRING
"specifies whether Intel(R) MKL-DNN library should be SHARED or STATIC")
option(WITH_EXAMPLE "builds examples" ON)
option(WITH_TEST "builds tests" ON)
option(MKLDNN_BUILD_EXAMPLES "builds examples" ON)
option(MKLDNN_BUILD_TESTS "builds tests" ON)

set(MKLDNN_THREADING "OMP" CACHE STRING
"specifies threading type; supports OMP (default), OMP:COMP, OMP:INTEL, or TBB.
Expand Down Expand Up @@ -94,7 +94,7 @@ set(MKLDNN_USE_MKL "DEF" CACHE STRING
# Optimizations
# =============

set(ARCH_OPT_FLAGS "HostOpts" CACHE STRING
set(MKLDNN_ARCH_OPT_FLAGS "HostOpts" CACHE STRING
"specifies compiler optimization flags (see below for more information).
If empty default optimization level would be applied which depends on the
compiler being used.
Expand All @@ -111,7 +111,7 @@ set(ARCH_OPT_FLAGS "HostOpts" CACHE STRING
- For all other cases there are no special optimizations flags.
If the library is to be built for generic architecture (e.g. built by a
Linux distributive maintainer) one may want to specify ARCH_OPT_FLAGS=\"\"
Linux distributive maintainer) one may want to specify MKLDNN_ARCH_OPT_FLAGS=\"\"
to not use any host specific instructions")

# ======================
Expand Down
8 changes: 4 additions & 4 deletions cmake/platform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ if(UNIX OR MINGW)
endif()
endif()

if(ARCH_OPT_FLAGS STREQUAL "HostOpts")
set(ARCH_OPT_FLAGS "${DEF_ARCH_OPT_FLAGS}")
if(MKLDNN_ARCH_OPT_FLAGS STREQUAL "HostOpts")
set(MKLDNN_ARCH_OPT_FLAGS "${DEF_ARCH_OPT_FLAGS}")
endif()

append(CMAKE_C_FLAGS "${CMAKE_CCXX_FLAGS} ${ARCH_OPT_FLAGS}")
append(CMAKE_CXX_FLAGS "${CMAKE_CCXX_FLAGS} ${ARCH_OPT_FLAGS}")
append(CMAKE_C_FLAGS "${CMAKE_CCXX_FLAGS} ${MKLDNN_ARCH_OPT_FLAGS}")
append(CMAKE_CXX_FLAGS "${CMAKE_CCXX_FLAGS} ${MKLDNN_ARCH_OPT_FLAGS}")

if(APPLE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#===============================================================================

if (NOT WITH_EXAMPLE)
if (NOT MKLDNN_BUILD_EXAMPLES)
return()
endif()

Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#===============================================================================

if (NOT WITH_TEST)
if (NOT MKLDNN_BUILD_TESTS)
return()
endif()

Expand Down

0 comments on commit 2a011ff

Please sign in to comment.