FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

arrayfire/arrayfire at d4c8da576f4026705bebd0ef8d6f1ced631d675f · GitHub

Repository navigation

Public

About

ArrayFire: a general purpose GPU library.

Topics

Resources

Contributing

Stars

4.9k stars

Watchers

140 watching

Forks

Repository files navigation

ArrayFire is a high performance software library for parallel computing with an easy-to-use API. Its array based function set makes parallel programming simple.

ArrayFire's multiple backends (CUDA, OpenCL and native CPU) make it platform independent and highly portable.

A few lines of code in ArrayFire can replace dozens of lines of parallel computing code, saving you valuable time and lowering development costs.

Build ArrayFire from source

To build ArrayFire from source, please follow the instructions on our wiki.

Download ArrayFire Installers

We currently have binary tar balls and installers available for the beta version of ArrayFire 3.0. These can be downloaded at the ArrayFire Downloads page.

Support and Contact Info

Build Status

Build Tests
Linux x86
Linux Tegra
Windows
OSX

Example

#include <arrayfire.h>
#include <cstdio>

using namespace af;

int main(int argc, char *argv[])
{
    try {

        // Select a device and display arrayfire info
        int device = argc > 1 ? atoi(argv[1]) : 0;
        af::setDevice(device);
        af::info();

        printf("Create a 5-by-3 matrix of random floats on the GPU\n");
        array A = randu(5,3, f32);
        af_print(A);

        printf("Element-wise arithmetic\n");
        array B = sin(A) + 1.5;
        af_print(B);

        printf("Negate the first three elements of second column\n");
        B(seq(0, 2), 1) = B(seq(0, 2), 1) * -1;
        af_print(B);

        printf("Fourier transform the result\n");
        array C = fft(B);
        af_print(C);

        printf("Grab last row\n");
        array c = C.row(end);
        af_print(c);

        printf("Create 2-by-3 matrix from host data\n");
        float d[] = { 1, 2, 3, 4, 5, 6 };
        array D(2, 3, d, af::afHost);
        af_print(D);

        printf("Copy last column onto first\n");
        D.col(0) = D.col(end);
        af_print(D);

        // Sort A
        printf("Sort A and print sorted array and corresponding indices\n");
        array vals, inds;
        sort(vals, inds, A);
        af_print(vals);
        af_print(inds);

    } catch (af::exception& e) {
        fprintf(stderr, "%s\n", e.what());
        throw;
    }
}

Documentation

You can find our complete documentation over here.

Quick links:

Contribute

Contributions of any kind are welcome! Please refer to this document to learn more about how you can get involved with ArrayFire.

About

ArrayFire: a general purpose GPU library.

Topics

Resources

Contributing

Stars

4.9k stars

Watchers

140 watching

Forks

Releases

Packages

Used by

Contributors

Languages


Back | FazBrowse Home | New Git URL