diff --git a/CMakeLists.txt b/CMakeLists.txt index 33d5d36..dc8b46a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,9 +4,9 @@ project(trigdx LANGUAGES CXX) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) -option(USE_MKL "Enable Intel MKL backend" OFF) -option(USE_GPU "Enable GPU backend" OFF) -option(USE_XSIMD "Enable XSIMD backend" OFF) +option(TRIGDX_USE_MKL "Enable Intel MKL backend" OFF) +option(TRIGDX_USE_GPU "Enable GPU backend" OFF) +option(TRIGDX_USE_XSIMD "Enable XSIMD backend" OFF) include_directories(${PROJECT_SOURCE_DIR}/include) diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 64e8ee8..3d2416e 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -7,17 +7,17 @@ target_link_libraries(benchmark_lookup PRIVATE trigdx) add_executable(benchmark_lookup_avx benchmark_lookup_avx.cpp) target_link_libraries(benchmark_lookup_avx PRIVATE trigdx) -if(USE_MKL) +if(TRIGDX_USE_MKL) add_executable(benchmark_mkl benchmark_mkl.cpp) target_link_libraries(benchmark_mkl PRIVATE trigdx) endif() -if(USE_GPU) +if(TRIGDX_USE_GPU) add_executable(benchmark_gpu benchmark_gpu.cpp) target_link_libraries(benchmark_gpu PRIVATE trigdx gpu) endif() -if(USE_XSIMD) +if(TRIGDX_USE_XSIMD) add_executable(benchmark_lookup_xsimd benchmark_lookup_xsimd.cpp) target_link_libraries(benchmark_lookup_xsimd PRIVATE trigdx) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3f5d85c..39daa3a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,13 +4,13 @@ target_include_directories(trigdx PUBLIC ${PROJECT_SOURCE_DIR}/include) target_compile_options(trigdx PRIVATE -O3 -march=native) -if(USE_MKL) +if(TRIGDX_USE_MKL) find_package(MKL REQUIRED) target_sources(trigdx PRIVATE mkl.cpp) target_link_libraries(trigdx PRIVATE MKL::MKL) endif() -if(USE_GPU) +if(TRIGDX_USE_GPU) enable_language(CUDA) find_package(CUDAToolkit REQUIRED) add_library(gpu SHARED gpu/gpu.cu) @@ -19,7 +19,7 @@ if(USE_GPU) target_link_libraries(trigdx PRIVATE gpu) endif() -if(USE_XSIMD) +if(TRIGDX_USE_XSIMD) find_package(xsimd REQUIRED) target_sources(trigdx PRIVATE lookup_xsimd.cpp) target_link_libraries(trigdx PRIVATE xsimd) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8978e43..95f0db1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -15,7 +15,7 @@ add_executable(test_lookup_avx test_lookup_avx.cpp) target_link_libraries(test_lookup_avx PRIVATE trigdx Catch2::Catch2WithMain) # MKL backend test -if(USE_MKL) +if(TRIGDX_USE_MKL) add_executable(test_mkl test_mkl.cpp) target_link_libraries(test_mkl PRIVATE trigdx Catch2::Catch2WithMain) endif() @@ -23,17 +23,17 @@ endif() include(CTest) add_test(NAME test_lookup COMMAND test_lookup) -if(USE_MKL) +if(TRIGDX_USE_MKL) add_test(NAME test_mkl COMMAND test_mkl) endif() -if(USE_GPU) +if(TRIGDX_USE_GPU) add_executable(test_gpu test_gpu.cpp) target_link_libraries(test_gpu PRIVATE trigdx Catch2::Catch2WithMain) add_test(NAME test_gpu COMMAND test_gpu) endif() -if(USE_XSIMD) +if(TRIGDX_USE_XSIMD) add_executable(test_lookup_xsimd test_lookup_xsimd.cpp) target_link_libraries(test_lookup_xsimd PRIVATE trigdx Catch2::Catch2WithMain) add_test(NAME test_lookup_xsimd COMMAND test_lookup_xsimd)