CUDA FFT exception

最后都变了- 提交于 2020-01-26 03:15:10

问题


I'm trying to use CUDA FFT aka cufft library

Problem occured 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 copiler 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 locatoin 0x002df99c..

Help would be appreciated

Cheers


回答1:


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)

Thanks for help ... :)



来源:https://stackoverflow.com/questions/15545442/cuda-fft-exception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!