diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2014-03-24 09:52:45 -0700 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2014-03-24 09:52:45 -0700 |
commit | 08f7b3221d58e480d8ede105bd70b09a2104c5fb (patch) | |
tree | ee2c9f34be06d0d5dc1caec3a2b225b2c999b9a8 | |
parent | 72707a86641ad0bd4c4e5cc45c4b8ced64b499ef (diff) |
Added proper support for AVX and FMA in the makefiles.
-rw-r--r-- | CMakeLists.txt | 8 | ||||
-rw-r--r-- | cmake/EigenTesting.cmake | 10 |
2 files changed, 17 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 16a9b5bcb..fb13769f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,12 +196,18 @@ if(NOT MSVC) message(STATUS "Enabling SSE4.2 in tests/examples") endif() - option(EIGEN_TEST_AVX "Enable/Disable AVX in tests/examples" ON) + option(EIGEN_TEST_AVX "Enable/Disable AVX in tests/examples" OFF) if(EIGEN_TEST_AVX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx") message(STATUS "Enabling AVX in tests/examples") endif() + option(EIGEN_TEST_FMA "Enable/Disable FMA in tests/examples" OFF) + if(EIGEN_TEST_FMA) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfma") + message(STATUS "Enabling FMA in tests/examples") + endif() + option(EIGEN_TEST_ALTIVEC "Enable/Disable AltiVec in tests/examples" OFF) if(EIGEN_TEST_ALTIVEC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maltivec -mabi=altivec") diff --git a/cmake/EigenTesting.cmake b/cmake/EigenTesting.cmake index d1ea4b9d2..9b9776894 100644 --- a/cmake/EigenTesting.cmake +++ b/cmake/EigenTesting.cmake @@ -270,6 +270,12 @@ macro(ei_testing_print_summary) message(STATUS "AVX: Using architecture defaults") endif() + if(EIGEN_TEST_FMA) + message(STATUS "FMA: ON") + else() + message(STATUS "FMA: Using architecture defaults") + endif() + if(EIGEN_TEST_ALTIVEC) message(STATUS "Altivec: ON") else() @@ -414,6 +420,10 @@ macro(ei_get_cxxflags VAR) set(${VAR} NEON) elseif(EIGEN_TEST_ALTIVEC) set(${VAR} ALVEC) + elseif(EIGEN_TEST_FMA) + set(${VAR} FMA) + elseif(EIGEN_TEST_AVX) + set(${VAR} AVX) elseif(EIGEN_TEST_SSE4_2) set(${VAR} SSE42) elseif(EIGEN_TEST_SSE4_1) |