Hello everybody,
I wrote the following CUDA code to test CUFFT.
I’m writing it on a PC without a CUDA enabled GPU therefore I’m debugging it in EMULATION MODE.
#include “cuda.h”
#include “cufft.h”
#include “cuFloatComplex.h”
int main () {
int M=16;
cufftHandle plan1D;
cufftComplex *idata,*odata,*d,*t;
cudaMalloc((void**)&idata, M*sizeof(cufftComplex));
cudaMalloc((void**)&odata, M*sizeof(cufftComplex));
cudaMemset(odata,0,M*sizeof(cufftComplex));
d=(cufftComplex*) malloc(M*sizeof(cufftComplex));
t=(cufftComplex*) malloc(M*sizeof(cufftComplex));
for (int pp=0;pp<M;pp++) { d[pp].x=1;d[pp].y=0; }
cudaMemcpy (idata, d, M*sizeof(cuffComplex), cudaMemcpyHostToDevice);
cufftResult result;
result = cufftPlan1d(&plan1D, M, CUFFT_C2C,1);
result= cufftExecC2C(plan1D, idata,idata, CUFFT_FORWARD);
cudaMemcpy (t, odata, M*sizeof(cuffComplex), cudaMemcpyDeviceToHost);
}
The code compiles and runs without signaling any error at runtime. But the command cufftExecC2C does not do anything and leaves unchanged the output, even if the return value (result variable) is CUFFT_SUCCES.
I’m using the correct libraries as I link to cuffemu.lib (cufft.lib compiles but result variable assumes CUFFT_INTERNAL_ERROR), so I cannot figure out what’s wrong with the code…Maybe you cannot use in emulation mode CUFFT?
Please help me.
Thank you,
Pietro