<< gpuExit sciGPGPU gpuFree >>

sciGPGPU >> sciGPGPU > gpuFFT

gpuFFT

Perform the fast fourier transform of matrix.

Call sequence

dA = gpuFFT(A, Sign, Dims)

Parameters

A

Can be :

Pointer on the matrix stored in device memory (GPU).

Pointer on the matrix stored in host memory (CPU).

Sign

Values are 1 or -1. Set respectively the inverse or forward transform.

Dims

Set the dimension of the FFT plan.

dA

dA is the result of computation stored in device memory (GPU).

Description

dA=gpuFFT(A, Sign, Dims)

gpuFFT perform the fast fourier transform of matrix. This function use cufft to perform operations.

Exemples

// 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);

See Also

<< gpuExit sciGPGPU gpuFree >>