Add trigdx_config.hpp and trigdx.hpp header files

This commit is contained in:
Bram Veenboer
2025-08-12 13:54:13 +02:00
parent e9a74ef283
commit 2f39c5c86e
10 changed files with 38 additions and 6 deletions

View File

@@ -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()

View File

@@ -1,4 +1,4 @@
#include <trigdx/gpu.hpp>
#include <trigdx/trigdx.hpp>
#include "benchmark_utils.hpp"

View File

@@ -1,4 +1,4 @@
#include <trigdx/lookup.hpp>
#include <trigdx/trigdx.hpp>
#include "benchmark_utils.hpp"

View File

@@ -1,4 +1,4 @@
#include <trigdx/lookup_avx.hpp>
#include <trigdx/trigdx.hpp>
#include "benchmark_utils.hpp"

View File

@@ -1,4 +1,4 @@
#include <trigdx/lookup_xsimd.hpp>
#include <trigdx/trigdx.hpp>
#include "benchmark_utils.hpp"

View File

@@ -1,4 +1,4 @@
#include <trigdx/mkl.hpp>
#include <trigdx/trigdx.hpp>
#include "benchmark_utils.hpp"

View File

@@ -1,4 +1,4 @@
#include <trigdx/reference.hpp>
#include <trigdx/trigdx.hpp>
#include "benchmark_utils.hpp"

View File

@@ -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@

19
include/trigdx/trigdx.hpp Normal file
View File

@@ -0,0 +1,19 @@
#pragma once
#include <trigdx/trigdx_config.hpp>
#include <trigdx/reference.hpp>
#include <trigdx/lookup.hpp>
#include <trigdx/lookup_avx.hpp>
#if TRIGDX_USE_MKL
#include <trigdx/mkl.hpp>
#endif
#if TRIGDX_USE_GPU
#include <trigdx/gpu.hpp>
#endif
#if TRIGDX_USE_XSIMD
#include <trigdx/lookup_xsimd.hpp>
#endif

View File

@@ -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 $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>)