From 2f39c5c86e941b3416260e822635fbc62f824aaf Mon Sep 17 00:00:00 2001 From: Bram Veenboer Date: Tue, 12 Aug 2025 13:54:13 +0200 Subject: [PATCH] Add trigdx_config.hpp and trigdx.hpp header files --- CMakeLists.txt | 4 ++++ benchmarks/benchmark_gpu.cpp | 2 +- benchmarks/benchmark_lookup.cpp | 2 +- benchmarks/benchmark_lookup_avx.cpp | 2 +- benchmarks/benchmark_lookup_xsimd.cpp | 2 +- benchmarks/benchmark_mkl.cpp | 2 +- benchmarks/benchmark_reference.cpp | 2 +- cmake/trigdx_config.hpp.in | 5 +++++ include/trigdx/trigdx.hpp | 19 +++++++++++++++++++ src/CMakeLists.txt | 4 ++++ 10 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 cmake/trigdx_config.hpp.in create mode 100644 include/trigdx/trigdx.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index b9e7f9e..e807f5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,10 @@ option(TRIGDX_USE_XSIMD "Enable XSIMD backend" OFF) option(TRIGDX_BUILD_TESTS "Build tests" ON) option(TRIGDX_BUILD_BENCHMARKS "Build tests" ON) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/trigdx_config.hpp.in + ${CMAKE_CURRENT_BINARY_DIR}/include/trigdx/trigdx_config.hpp @ONLY) + if(TRIGDX_BUILD_TESTS OR TRIGDX_BUILD_BENCHMARKS) include(FetchContent) endif() diff --git a/benchmarks/benchmark_gpu.cpp b/benchmarks/benchmark_gpu.cpp index 8595760..2edbcb2 100644 --- a/benchmarks/benchmark_gpu.cpp +++ b/benchmarks/benchmark_gpu.cpp @@ -1,4 +1,4 @@ -#include +#include #include "benchmark_utils.hpp" diff --git a/benchmarks/benchmark_lookup.cpp b/benchmarks/benchmark_lookup.cpp index 9961655..20b2f1d 100644 --- a/benchmarks/benchmark_lookup.cpp +++ b/benchmarks/benchmark_lookup.cpp @@ -1,4 +1,4 @@ -#include +#include #include "benchmark_utils.hpp" diff --git a/benchmarks/benchmark_lookup_avx.cpp b/benchmarks/benchmark_lookup_avx.cpp index ef1dcf9..92403a8 100644 --- a/benchmarks/benchmark_lookup_avx.cpp +++ b/benchmarks/benchmark_lookup_avx.cpp @@ -1,4 +1,4 @@ -#include +#include #include "benchmark_utils.hpp" diff --git a/benchmarks/benchmark_lookup_xsimd.cpp b/benchmarks/benchmark_lookup_xsimd.cpp index bcbbef9..7abb939 100644 --- a/benchmarks/benchmark_lookup_xsimd.cpp +++ b/benchmarks/benchmark_lookup_xsimd.cpp @@ -1,4 +1,4 @@ -#include +#include #include "benchmark_utils.hpp" diff --git a/benchmarks/benchmark_mkl.cpp b/benchmarks/benchmark_mkl.cpp index 955cfac..d7585f4 100644 --- a/benchmarks/benchmark_mkl.cpp +++ b/benchmarks/benchmark_mkl.cpp @@ -1,4 +1,4 @@ -#include +#include #include "benchmark_utils.hpp" diff --git a/benchmarks/benchmark_reference.cpp b/benchmarks/benchmark_reference.cpp index d303286..9b2c6c9 100644 --- a/benchmarks/benchmark_reference.cpp +++ b/benchmarks/benchmark_reference.cpp @@ -1,4 +1,4 @@ -#include +#include #include "benchmark_utils.hpp" diff --git a/cmake/trigdx_config.hpp.in b/cmake/trigdx_config.hpp.in new file mode 100644 index 0000000..d5cc4d0 --- /dev/null +++ b/cmake/trigdx_config.hpp.in @@ -0,0 +1,5 @@ +#pragma once + +#define TRIGDX_USE_MKL @TRIGDX_USE_MKL@ +#define TRIGDX_USE_GPU @TRIGDX_USE_GPU@ +#define TRIGDX_USE_XSIMD @TRIGDX_USE_XSIMD@ \ No newline at end of file diff --git a/include/trigdx/trigdx.hpp b/include/trigdx/trigdx.hpp new file mode 100644 index 0000000..1352e7f --- /dev/null +++ b/include/trigdx/trigdx.hpp @@ -0,0 +1,19 @@ +#pragma once + +#include + +#include +#include +#include + +#if TRIGDX_USE_MKL +#include +#endif + +#if TRIGDX_USE_GPU +#include +#endif + +#if TRIGDX_USE_XSIMD +#include +#endif \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b732fce..933a944 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -33,3 +33,7 @@ if(TRIGDX_USE_XSIMD) target_sources(trigdx PRIVATE lookup_xsimd.cpp) target_link_libraries(trigdx PRIVATE xsimd) endif() + +target_include_directories( + trigdx INTERFACE $ + $)