@@ -1,10 +1,12 @@
|
||||
include(FetchContent)
|
||||
|
||||
add_library(trigdx reference.cpp lookup.cpp lookup_avx.cpp)
|
||||
include(FindAVX)
|
||||
add_library(trigdx reference.cpp lookup.cpp)
|
||||
|
||||
target_include_directories(trigdx PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
||||
|
||||
target_compile_options(trigdx PRIVATE -O3 -march=native)
|
||||
if(HAVE_AVX)
|
||||
target_sources(trigdx PRIVATE lookup_avx.cpp)
|
||||
endif()
|
||||
|
||||
if(TRIGDX_USE_MKL)
|
||||
find_package(MKL REQUIRED)
|
||||
@@ -22,7 +24,8 @@ if(TRIGDX_USE_GPU)
|
||||
endif()
|
||||
|
||||
if(TRIGDX_USE_XSIMD)
|
||||
find_package(xsimd QUIET)
|
||||
# Requires XSIMD > 13 for architecture independent dispatching
|
||||
find_package(xsimd 13 QUIET)
|
||||
if(NOT TARGET xsimd)
|
||||
FetchContent_Declare(
|
||||
xsimd
|
||||
|
||||
@@ -160,7 +160,6 @@ template <std::size_t NR_SAMPLES> struct LookupAVXBackend<NR_SAMPLES>::Impl {
|
||||
for (std::size_t i = 0; i < n; ++i) {
|
||||
std::size_t idx = static_cast<std::size_t>(x[i] * SCALE) & MASK;
|
||||
std::size_t idx_cos = (idx + NR_SAMPLES / 4) & MASK;
|
||||
s[i] = lookup[idx];
|
||||
c[i] = lookup[idx_cos];
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user