Overview
ArrayFire is a fast and comprehensive, high-level GPU matrix library.
- It contains the fastest implementations for hundreds of routines in areas of matrix arithmetic, signal processing, linear algebra, statistics, and image processing, all built upon thousands of lines of highly-tuned device code optimized for any CUDA-enabled GPU.
- A simple array notation allows a few lines of ArrayFire code to accomplish what would have taken 10-100X lines in raw CUDA. The array object is also easier to use than template programming and is more flexible and faster than directive-based approaches.
- ArrayFire performs run-time analysis of your code to increase arithmetic intensity and memory throughput, while avoiding unnecessary temporary allocations (via custom JIT compiler). It can also execute loop iterations in parallel with gfor, and supports easy multi-GPU scaling.
Simple Example
Here's a stripped down example of Monte-Carlo estimation of Pi:
#include <stdio.h>
#include <arrayfire.h>
using namespace af;
int main() {
int n = 20e6;
array x = randu(n), y = randu(n);
float pi = 4.0 * sum<float>(hypot(x,y) < 1) / n;
printf("pi = %g\n", pi);
return 0;
}
Quick-start Links
Get ArrayFire!
System Requirements
Supported Platforms
- Windows (32 and 64-bit) - XP, Vista, 7
- Linux (32 and 64-bit) - Ubuntu 10+, Fedora 10+, OpenSUSE 11+, RHEL 5+, CentOS 5+, SLES 10+
- Mac OSX (64-bit) - Snow Leopard (10.6.x), Lion (10.7.x)
Requirements
Note: This version of ArrayFire is not thread-safe but support is planned.
Product Support