mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-08 17:59:00 +08:00
Added proper support for AVX and FMA in the makefiles.
This commit is contained in:
parent
72707a8664
commit
08f7b3221d
@ -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")
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user