Hi,
I need help with Fourier transform. I have success then i work with one array, but I need transform several arrays parallel.
Help me please. I’m sorry, my English not good :unsure:
Thanks!
Hi,
I need help with Fourier transform. I have success then i work with one array, but I need transform several arrays parallel.
Help me please. I’m sorry, my English not good :unsure:
Thanks!
configure your fft plan with batch mode, and then run it… :rolleyes:
configure your fft plan with batch mode, and then run it… :rolleyes:
Thanks senosy, it’s work External Image
Thanks senosy, it’s work External Image
Now I have next problem: Inverse of forward cufft not equal to original function,:( my code:
[codebox]// Allocate device memory for signal
cufftComplex* d_signal;
cudaMalloc((void**)&d_signal, sizeof(cufftComplex) * SIZE);
cufftComplex* d_signalout;
cudaMalloc((void**)&d_signalout, sizeof(cufftComplex) * SIZE);
// Copy host memory to device
cudaMemcpy(d_signal, indata, sizeof(cufftComplex) * SIZE, cudaMemcpyHostToDevice);
cufftHandle plan;
/* Create a 1D FFT plan. */
cufftPlan1d(&plan, NX, CUFFT_C2C, BATCH);
/* Use the CUFFT plan to transform the signal in place. */
cufftExecC2C(plan, d_signal, d_signal, CUFFT_FORWARD);
/* Inverse transform the signal in place. */
cufftExecC2C(plan, d_signal, d_signalout, 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
*/
cutilSafeCall(cudaMemcpy(outdata, d_signalout, sizeof(cufftComplex) * SIZE,
cudaMemcpyDeviceToHost));[/codebox]
Thanks!
Now I have next problem: Inverse of forward cufft not equal to original function,:( my code:
[codebox]// Allocate device memory for signal
cufftComplex* d_signal;
cudaMalloc((void**)&d_signal, sizeof(cufftComplex) * SIZE);
cufftComplex* d_signalout;
cudaMalloc((void**)&d_signalout, sizeof(cufftComplex) * SIZE);
// Copy host memory to device
cudaMemcpy(d_signal, indata, sizeof(cufftComplex) * SIZE, cudaMemcpyHostToDevice);
cufftHandle plan;
/* Create a 1D FFT plan. */
cufftPlan1d(&plan, NX, CUFFT_C2C, BATCH);
/* Use the CUFFT plan to transform the signal in place. */
cufftExecC2C(plan, d_signal, d_signal, CUFFT_FORWARD);
/* Inverse transform the signal in place. */
cufftExecC2C(plan, d_signal, d_signalout, 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
*/
cutilSafeCall(cudaMemcpy(outdata, d_signalout, sizeof(cufftComplex) * SIZE,
cudaMemcpyDeviceToHost));[/codebox]
Thanks!