mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add DUCC FFT support
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
6f1a143418
commit
db85838ee2
@@ -88,6 +88,25 @@ else()
|
||||
ei_add_property(EIGEN_MISSING_BACKENDS "pocketfft, ")
|
||||
endif()
|
||||
|
||||
if( NOT DUCC_ROOT AND ENV{DUCC_ROOT} )
|
||||
set( DUCC_ROOT $ENV{DUCC_ROOT} )
|
||||
endif()
|
||||
find_path(DUCCFFT
|
||||
NAMES "src/ducc0/fft/fft.h"
|
||||
PATHS ${DUCC_ROOT})
|
||||
message(INFO " ${DUCC_ROOT} ${DUCCFFT}")
|
||||
if(DUCCFFT)
|
||||
ei_add_property(EIGEN_TESTED_BACKENDS "duccfft, ")
|
||||
include_directories( "${DUCCFFT}/src" )
|
||||
add_library(ducc_lib "${DUCCFFT}/src/ducc0/infra/string_utils.cc" "${DUCCFFT}/src/ducc0/infra/threading.cc")
|
||||
target_compile_definitions(ducc_lib PUBLIC "DUCC0_NO_THREADING=1")
|
||||
ei_add_test(duccfft "-DEIGEN_DUCCFFT_DEFAULT -DDUCC0_NO_THREADING=1" "ducc_lib" )
|
||||
set_target_properties(ducc_lib duccfft PROPERTIES CXX_STANDARD 17)
|
||||
else()
|
||||
ei_add_property(EIGEN_MISSING_BACKENDS "duccfft, ")
|
||||
endif()
|
||||
|
||||
|
||||
option(EIGEN_TEST_OPENGL "Enable OpenGL support in unit tests" OFF)
|
||||
if(EIGEN_TEST_OPENGL)
|
||||
find_package(OpenGL)
|
||||
|
||||
4
unsupported/test/duccfft.cpp
Normal file
4
unsupported/test/duccfft.cpp
Normal file
@@ -0,0 +1,4 @@
|
||||
#define EIGEN_DUCCFFT_DEFAULT 1
|
||||
#include <ducc0/fft/fft.h> // Needs to be included before main.h
|
||||
#include <ducc0/fft/fftnd_impl.h> // Same requirement
|
||||
#include "fft_test_shared.h"
|
||||
@@ -272,7 +272,7 @@ EIGEN_DECLARE_TEST(FFTW) {
|
||||
CALL_SUBTEST(test_scalar<float>(2 * 3 * 4 * 5 * 7));
|
||||
CALL_SUBTEST(test_scalar<double>(2 * 3 * 4 * 5 * 7));
|
||||
|
||||
#if defined EIGEN_HAS_FFTWL || defined EIGEN_POCKETFFT_DEFAULT
|
||||
#if defined EIGEN_HAS_FFTWL || defined EIGEN_POCKETFFT_DEFAULT || defined EIGEN_DUCCFFT_DEFAULT
|
||||
CALL_SUBTEST(test_complex<long double>(32));
|
||||
CALL_SUBTEST(test_complex<long double>(256));
|
||||
CALL_SUBTEST(test_complex<long double>(3 * 8));
|
||||
@@ -294,13 +294,15 @@ EIGEN_DECLARE_TEST(FFTW) {
|
||||
// fail to build since Eigen limit the stack allocation size,too big here.
|
||||
// CALL_SUBTEST( ( test_complex2d<long double, 256, 256> () ) );
|
||||
#endif
|
||||
#if defined EIGEN_FFTW_DEFAULT || defined EIGEN_POCKETFFT_DEFAULT || defined EIGEN_MKL_DEFAULT
|
||||
#if defined EIGEN_FFTW_DEFAULT || defined EIGEN_POCKETFFT_DEFAULT || defined EIGEN_DUCCFFT_DEFAULT || \
|
||||
defined EIGEN_MKL_DEFAULT
|
||||
CALL_SUBTEST((test_complex2d<float, 24, 24>()));
|
||||
CALL_SUBTEST((test_complex2d<float, 60, 60>()));
|
||||
CALL_SUBTEST((test_complex2d<float, 24, 60>()));
|
||||
CALL_SUBTEST((test_complex2d<float, 60, 24>()));
|
||||
#endif
|
||||
#if defined EIGEN_FFTW_DEFAULT || defined EIGEN_POCKETFFT_DEFAULT || defined EIGEN_MKL_DEFAULT
|
||||
#if defined EIGEN_FFTW_DEFAULT || defined EIGEN_POCKETFFT_DEFAULT || defined EIGEN_DUCCFFT_DEFAULT || \
|
||||
defined EIGEN_MKL_DEFAULT
|
||||
CALL_SUBTEST((test_complex2d<double, 24, 24>()));
|
||||
CALL_SUBTEST((test_complex2d<double, 60, 60>()));
|
||||
CALL_SUBTEST((test_complex2d<double, 24, 60>()));
|
||||
|
||||
Reference in New Issue
Block a user