PSCF v1.4.0
cudaTypes.h
1#ifndef PSCF_CUDA_TYPES_H
2#define PSCF_CUDA_TYPES_H
3
4#include <cufft.h>
5//#include <cuComplex.h>
6
7// Toggle single / double precision:
8// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9//#define SINGLE_PRECISION
10#define DOUBLE_PRECISION
11
12namespace Pscf {
13
17 #ifdef SINGLE_PRECISION
18 using cudaComplex = cufftComplex;
19 //using cudaComplex = cuComplex;
20 #else
21 #ifdef DOUBLE_PRECISION
22 using cudaComplex = cufftDoubleComplex;
23 //using cudaComplex = cuDoubleComplex;
24 #endif
25 #endif
26
30 #ifdef SINGLE_PRECISION
31 using cudaReal = cufftReal;
32 //using cudaReal = float;
33 #else
34 #ifdef DOUBLE_PRECISION
35 using cudaReal = cufftDoubleReal;
36 //using cudaReal = double;
37 #endif
38 #endif
39
40}
41#endif
PSCF package top-level namespace.
cufftDoubleComplex cudaComplex
Complex number type used in CPU code that uses FFTW.
Definition cudaTypes.h:22
cufftDoubleReal cudaReal
Real number type used in CPU code that uses FFTW.
Definition cudaTypes.h:35