TripleS
TripleS

Reputation: 1246

CUDA FFT exception

I'm trying to use CUDA FFT aka cufft library

Problem occurred when cufftPlan1d(..) throws an exception.

   #define NX 256
   #define BATCH 10

   cufftHandle plan;
   cufftComplex *data;
   cudaMalloc((void**)&data, sizeof(cufftComplex)*NX*BATCH);
   if (cudaGetLastError() != cudaSuccess){
         fprintf(stderr, "Cuda error: Failed to allocate\n");
         return;
   } 
   if (cufftPlan1d(&plan, NX, CUFFT_C2C, BATCH) != CUFFT_SUCCESS){
         fprintf(stderr, "CUFFT error: Plan creation failed");
         return;
   }

When the compiler hit the cufftPlan1d command, the output window on VS08 comes up with the following:

    first chance expection at 0x75af9617 in CudaFFTProject.exe Microsoft C++ exception: cufftResult_t at memory location 0x002df99c..

Upvotes: 0

Views: 908

Answers (1)

TripleS
TripleS

Reputation: 1246

The error comes from disorder in include files and linker input file (not sure which one of them).

My personal computer include cuda toolkit 4.2 and cuda toolkit 5 installation.

In VS08, Project properties:

Additional include:
use "$(CUDA_PATH_V4_2)\include"
instead of $(CUDA_INC_PATH)

Linker --> additional library directory -->
use "(CUDA_PATH_V4_2)\lib\win32"
instead of $(CUDA_LIB_PATH)

Upvotes: 1

Related Questions