32: Update flags for Intel compiler
This commit is contained in:
@@ -2,14 +2,22 @@ include(FetchContent)
|
|||||||
include(FindAVX)
|
include(FindAVX)
|
||||||
add_library(trigdx reference.cpp lookup.cpp)
|
add_library(trigdx reference.cpp lookup.cpp)
|
||||||
|
|
||||||
if(HAVE_AVX)
|
|
||||||
target_compile_definitions(trigdx PUBLIC HAVE_AVX)
|
|
||||||
target_compile_options(trigdx PUBLIC -mavx)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(HAVE_AVX2)
|
if(HAVE_AVX2)
|
||||||
target_compile_definitions(trigdx PUBLIC 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)
|
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()
|
endif()
|
||||||
|
|
||||||
target_include_directories(trigdx PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
target_include_directories(trigdx PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
||||||
|
|||||||
@@ -7,11 +7,13 @@
|
|||||||
#include "trigdx/lookup_avx.hpp"
|
#include "trigdx/lookup_avx.hpp"
|
||||||
|
|
||||||
#if defined(HAVE_AVX) && !defined(__AVX__)
|
#if defined(HAVE_AVX) && !defined(__AVX__)
|
||||||
static_assert(HAVE_AVX == 0, "__AVX__ should be defined when HAVE_AVX is defined, check compile flags (-mavx)");
|
static_assert(HAVE_AVX == 0, "__AVX__ should be defined when HAVE_AVX is "
|
||||||
|
"defined");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_AVX2) && !defined(__AVX2__)
|
#if defined(HAVE_AVX2) && !defined(__AVX2__)
|
||||||
static_assert(HAVE_AVX2 == 0, "__AVX__2 should be defined when HAVE_AVX2 is defined, check compile flags (-mavx2)");
|
static_assert(HAVE_AVX2 == 0, "__AVX__2 should be defined when HAVE_AVX2 is "
|
||||||
|
"defined");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <std::size_t NR_SAMPLES> struct LookupAVXBackend<NR_SAMPLES>::Impl {
|
template <std::size_t NR_SAMPLES> struct LookupAVXBackend<NR_SAMPLES>::Impl {
|
||||||
|
|||||||
Reference in New Issue
Block a user