3D in-place Real-to-Complex FFT issues with padding the 3D Array

fft_out_of_place.cu (1.8 KB)
fft_in_place.cu (4.8 KB)

I can’t get the right copying of the 3d array with padding. Point is to pad 3d array of floats to 3d array of complex to do in-place FFT. I am attaching my code for out-of-place FFT, and an attempt at in-place-fft. The main problem is with setting parameters to cudaMemcpy3D. Please help.

There are two mistakes

  1. You must specify one of srcArray or srcPtr and one of dstArray or dstPtr.
  2. Your extent is incorrect.

Please try the following

cudaMemcpy3DParms parms = {0};
parms.srcPtr = make_cudaPitchedPtr( (void *)(h_input), sizeof(cufftReal) * DIM, DIM, DIM);
parms.dstPtr = make_cudaPitchedPtr((void *)(d_data), sizeof(cufftComplex) * ((DIM/2)+1), DIM, DIM);
parms.extent = make_cudaExtent(DIM*sizeof(float), DIM, DIM);