Hi,
I’ve recently migrated to a Tesla C1060 device, and I’m trying to move my routines to double precision. Since I’m writing my code in Fortran I need to write some wrappers. Here is an example which is giving me some problems, the lines in bold are the one I added for double precision support, without them I could compile and run my program (with these lines I get this kind of error: “Error 7 error: identifier “D2Z” is undefined cufft_wrappers.cu 30”):
extern “C” int FFTPLAN3D(int *NX, int *NY, int *NZ, int *type)
{
int cu_NX=*NX;
int cu_NY=*NY;
int cu_NZ=*NZ;
cufftHandle plan;
cufftType CUFFT_TYPE;
if(*type == C2C) {CUFFT_TYPE = CUFFT_C2C;}
else if(*type == R2C) {CUFFT_TYPE = CUFFT_R2C;}
else if(*type == C2R) {CUFFT_TYPE = CUFFT_C2R;}
else if(*type == D2Z) {CUFFT_TYPE = CUFFT_D2Z;}
else if(*type == Z2D) {CUFFT_TYPE = CUFFT_Z2D;}
else if(*type == Z2Z) {CUFFT_TYPE = CUFFT_Z2Z;}
else {printf (“Error in fftplan3d: Invalid Transform Type”);}
cufftPlan3d(&plan, cu_NX, cu_NY, cu_NZ, CUFFT_TYPE);
return plan;
}
What am I doing wrong? Thanks for the support.
Alessandro