Perform the fast fourier transform of matrix.
dA = gpuFFT(A, Sign, Dims)
Can be :
Pointer on the matrix stored in device memory (GPU).
Pointer on the matrix stored in host memory (CPU).
Values are 1 or -1. Set respectively the inverse or forward transform.
Set the dimension of the FFT plan.
dA is the result of computation stored in device memory (GPU).
gpuFFT
perform the fast fourier transform of matrix.
This function use cufft to perform operations.
// inverse and forward transform. A = rand(6,4) + %i * rand(6,4); dA = gpuFFT(A,1); // inverse CPU = gpuGetData(dA) dB = gpuFFT(dA); // forward CPU = gpuGetData(dB) gpuFree(dA); gpuFree(dB); // Set FFT plan A = rand(1,8); dA = gpuFFT(A, -1, [2 4]); CPU = gpuGetData(dA) matrix(CPU, 2, 4) dB = gpuFFT(matrix(A,2,4), -1); CPU = gpuGetData(dB) gpuFree(dA); gpuFree(dB); // set plan 3D A = rand(4,6); dC = gpuFFT(A, -1, [4 2 3]); CPU = gpuGetData(dC) C = fftw(A, -1, [4 2 3], [1 4 8]) gpuFree(dC); | ![]() | ![]() |