in documention i have i dont understand what is nx batch
1D Complex-to-Complex Transforms
#define NX 256
#define BATCH 10
cufftHandle plan;
cufftComplex *data;
cudaMalloc((void**)&data, sizeof(cufftComplex)*NX*BATCH);
/* Create a 1D FFT plan. */
cufftPlan1d(&plan, NX, CUFFT_C2C, BATCH);
/* Use the CUFFT plan to transform the signal in place. */
cufftExecC2C(plan, data, data, CUFFT_FORWARD);
/* Inverse transform the signal in place. */
cufftExecC2C(plan, data, data, CUFFT_INVERSE);
/* Note:
(1) Divide by number of elements in data set to get back original data
(2) Identical pointers to input and output arrays implies in-place
transformation
*/
/* Destroy the CUFFT plan. */
cufftDestroy(plan);
cudaFree(data);
I think in that example Nx is the number of data points in the array that is to be FFT’d, and the BATCH number is for fourier transforming several arrays at once (less sure about that one).
I think your malloc wants to be 32*sizeof(float2) not just 32.
I think you should just be able to ignore BATCH. Don’t define it and call your plan etc without adding an extra argument i.e. cufftPlan1d(&plan, NX, CUFFT_C2C); At least thats how it works for 2d case.