Is it safe to use idata as the input and output parameter; any difference in results
cufftComplex *idata;
cudaMalloc((void**)&idata, sizeof(cufftComplex)*NX*NY);
/* Create a 2D FFT plan. */
cufftPlan2d(&plan, NX, NY, CUFFT_C2C);
/* Use the CUFFT plan to transform the signal out of place. */
cufftExecC2C(plan, idata, idata, CUFFT_FORWARD);