32: Set AVX and AVX2 flags using CMake checks (#34)
* 32: Set mavx and mavx2 based on CMake checks * 32: Update flags for Intel compiler * Fix: AVX2 instead of AVX__2 Co-authored-by: Bram Veenboer <bram.veenboer@gmail.com> Co-authored-by: lukken <lukken@astron.nl>
This commit is contained in:
@@ -2,6 +2,24 @@ include(FetchContent)
|
||||
include(FindAVX)
|
||||
add_library(trigdx reference.cpp lookup.cpp)
|
||||
|
||||
if(HAVE_AVX2)
|
||||
target_compile_definitions(trigdx PUBLIC HAVE_AVX2)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel" OR CMAKE_CXX_COMPILER_ID STREQUAL
|
||||
"IntelLLVM")
|
||||
target_compile_options(trigdx PUBLIC -xCORE-AVX2)
|
||||
else()
|
||||
target_compile_options(trigdx PUBLIC -mavx2)
|
||||
endif()
|
||||
elseif(HAVE_AVX)
|
||||
target_compile_definitions(trigdx PUBLIC HAVE_AVX)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel" OR CMAKE_CXX_COMPILER_ID STREQUAL
|
||||
"IntelLLVM")
|
||||
target_compile_options(trigdx PUBLIC -xAVX)
|
||||
else()
|
||||
target_compile_options(trigdx PUBLIC -mavx)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_include_directories(trigdx PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
||||
|
||||
if(HAVE_AVX)
|
||||
|
||||
Reference in New Issue
Block a user