Greetings,
i have some problems to understand how correctly use the cufft library.
i must calculate the fourier transform of an array of 512 elements (floats).
this my code:
#define DIM 512
....
float f[DIM];
FILE *img = fopen("Image0.bin","r");
fread(f,sizeof(float),DIM,img);
fclose(img);
cufftComplex f2[DIM];
int i;
for(i = 0; i < DIM; i++)
f2[i].x = f[i];
cufftComplex *df;
cudaMalloc((void**)&df,sizeof(cufftComplex)*DIM);
cudaMemcpy(df,f2,DIM,cudaMemcpyHostToDevice);
cufftHandle plan;
cufftPlan1d(&plan, DIM, CUFFT_C2C, 1);
cufftExecC2C(plan, df, df,CUFFT_FORWARD);
cudaMemcpy(f2,df,DIM,cudaMemcpyDeviceToHost);
the problem is that this code do nothing in sense that f and f2 are equal.
Reading the cufft manual in the examples i noted that it uses ‘BATCH’…what is the utility of batch?
why it is == 10 in the examples and not == 2 or == 100?
thanks a lot