aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver/WarpX_ComplexForFFT.H
diff options
context:
space:
mode:
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/WarpX_ComplexForFFT.H')
-rw-r--r--Source/FieldSolver/SpectralSolver/WarpX_ComplexForFFT.H21
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/FieldSolver/SpectralSolver/WarpX_ComplexForFFT.H b/Source/FieldSolver/SpectralSolver/WarpX_ComplexForFFT.H
new file mode 100644
index 000000000..43c7a1950
--- /dev/null
+++ b/Source/FieldSolver/SpectralSolver/WarpX_ComplexForFFT.H
@@ -0,0 +1,21 @@
+#ifndef WARPX_COMPLEXFORFFT_H_
+#define WARPX_COMPLEXFORFFT_H_
+
+#include <WarpX_Complex.H>
+
+// Check the complex type on GPU/CPU
+#ifdef AMREX_USE_GPU
+
+#include <cufft.h>
+static_assert( sizeof(Complex) == sizeof(cuDoubleComplex),
+ "The complex types in WarpX and cuFFT do not match.");
+
+#else
+
+#include <fftw3.h>
+static_assert( sizeof(Complex) == sizeof(fftw_complex),
+ "The complex types in WarpX and FFTW do not match.");
+
+#endif
+
+#endif //WARPX_COMPLEXFORFFT_H_