From 0fa78711d191c0ee353b4e6a67de0c63d1d7f44c Mon Sep 17 00:00:00 2001 From: Pedro Larroy Date: Thu, 19 Oct 2017 14:42:32 +0200 Subject: [PATCH] [CMAKE] USE_SSE option to govern USE_SSE in mshadow and -msse2 compiler flags --- CMakeLists.txt | 7 +++++-- mshadow | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76ef5afa57ac..b070c0462084 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ include(cmake/Utils.cmake) mxnet_option(USE_OPENCV "Build with OpenCV support" ON) mxnet_option(USE_OPENMP "Build with Openmp support" ON) mxnet_option(USE_CUDA "Build with CUDA support" ON) +mxnet_option(USE_SSE "Build with SSE support" ON) mxnet_option(USE_CUDNN "Build with cudnn support" ON) # one could set CUDNN_ROOT for search path mxnet_option(USE_LAPACK "Build with lapack support" ON IF NOT MSVC) mxnet_option(USE_MKL_IF_AVAILABLE "Use MKL if found" ON) @@ -52,7 +53,9 @@ else(MSVC) include(CheckCXXCompilerFlag) check_cxx_compiler_flag("-std=c++11" SUPPORT_CXX11) check_cxx_compiler_flag("-std=c++0x" SUPPORT_CXX0X) - check_cxx_compiler_flag("-msse2" SUPPORT_MSSE2) + if(USE_SSE) + check_cxx_compiler_flag("-msse2" SUPPORT_MSSE2) + endif() set(CMAKE_C_FLAGS "-Wall -Wno-unknown-pragmas -fPIC -Wno-sign-compare") if(CMAKE_BUILD_TYPE STREQUAL "Debug") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g") @@ -63,7 +66,7 @@ else(MSVC) add_definitions(-DNDEBUG=1) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3") endif() - if(SUPPORT_MSSE2) + if(USE_SSE AND SUPPORT_MSSE2) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2") endif() set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS}) diff --git a/mshadow b/mshadow index cb5c9872b542..a4efa7da6af6 160000 --- a/mshadow +++ b/mshadow @@ -1 +1 @@ -Subproject commit cb5c9872b542220be5b99f3aca0e1ff56e31b028 +Subproject commit a4efa7da6af69d99c1fd81f9ec3b1160f172b199