DO MORE. CODE LESS. Free software for GPU computing on AMD, Intel, and NVIDIA.
examples/fft.cpp
#include "arrayfire.h"

using namespace af;
using namespace std;

int main()
{
    // Print list of OpenCL devices
    af::info();

    // Initialize data on host
    float A[] = {1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4};

    // Create Array objects using host data
    array arrayA = array(A, 4, 4);
    print(arrayA);

    cout << "\nPerform 1D FFTs along columns of arrayA\n";
    array fft1D_A = fft1D(arrayA);
    print(fft1D_A);

    cout << "\nPerform inverse 1D FFT on fftA, Should match arrayA\n";
    print(real(ifft1D(fft1D_A)));

    cout << "\nPerform 2D FFT on arrayA\n";
    array fft2D_A = fft2D(arrayA);
    print(fft2D_A);

    cout << "\nPerform inverse 2D FFT on fft2d_A, Should match arrayA\n";
    print(real(ifft2D(fft2D_A)));

    cout << "hit [enter].....\n\n";
    getchar();
    return 0;

}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines