Using double precision

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

Found the problem, admins can close the thread. Thank you.

It seems I cannot use the option -arch sm_13 to activate the double precision. I work with Win XP 32bit and Visual Studio. When I try to compile my project I get the following error:

nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified

This is the custom build step I defined in Visual Studio for compiling the .cu file:
(CUDA_BIN_PATH)\nvcc.exe" –arch sm_13 -ccbin "(VCInstallDir)bin” -c -D_DEBUG -DWIN64 -D_CONSOLE -D_MBCS -Xcompiler /EHsc,/W3,/nologo,/Wp64,/Od,/RTC1,/Zi,/MTd -I"(CUDA_INC_PATH)" -I./ -I"C:\NVIDIA GPU Computing SDK\C\common\inc" -o (ConfigurationName)$(InputName).obj $(InputName).cu

The command line I was using for single precision was exactly the same, except for the option -arch sm_13 that was not there. Could someone please help me? Thank you.

I have no idea with your error message, but you can try this option -arch compute_13 -code sm_13

It works!

Thank you very much!!!