+2
日增长
4,913
stars
558
forks
140
watchers
2,029
prs
1,714
issues
36
releases
README
ArrayFire is a general-purpose tensor library that simplifies the software
development process for the parallel architectures found in CPUs, GPUs, and
other hardware acceleration devices. The library serves users in every
technical computing market.
Several of ArrayFire's benefits include:
Hundreds of accelerated tensor computing
functions, in the
following areas:
Array handling
Computer vision
Image processing
Linear algebra
Machine learning
Standard math
Signal Processing
Statistics
Vector algorithms
Easy to use, stable,
well-documented API
Rigorous benchmarks and tests ensuring top performance and numerical accuracy
Cross-platform compatibility with support for CUDA, oneAPI, OpenCL, and
native CPU on Windows, Mac, and Linux
Built-in visualization functions through
Forge
Commercially friendly open-source licensing
Enterprise support from ArrayFire
ArrayFire provides software developers with a high-level abstraction of data
that resides on the accelerator, the af::array object. Developers write code
that performs operations on ArrayFire arrays, which, in turn, are automatically
translated into near-optimal kernels that execute on the computational device.
ArrayFire runs on devices ranging from low-power mobile phones to high-power
GPU-enabled supercomputers. ArrayFire runs on CPUs from all major vendors
(Intel, AMD, ARM), GPUs from the prominent manufacturers (AMD, Intel, NVIDIA,
and Qualcomm), as well as a variety of other accelerator devices on Windows,
Mac, and Linux.
Getting ArrayFire
Instructions to [install][32] or to build ArrayFire from source can be found on
the [wiki][1].
Conway's Game of Life Using ArrayFire
Visit the [Wikipedia page][2] for a description of Conway's Game of Life.
cpp
static const float h_kernel[] = { 1, 1, 1, 1, 0, 1, 1, 1, 1 };
static const array kernel(3, 3, h_kernel, afHost);
array state = (randu(128, 128, f32) 0.5).as(f32); // Init state
Window myWindow(256, 256);
while(!myWindow.close()) {
array nHood = convolve(state, kernel); // Obtain neighbors
array C0 = (nHood == 2); // Generate conditions for life
array C1 = (nHood == 3);
state = state C0 + C1; // Update state
myWindow.image(state); // Display
}
The complete source code can be found [here][3].
Perceptron
cpp
array predict(const array &X, const array &W) {
return sigmoid(matmul(X, W));
}
array train(const array &X, const array &Y,
double alpha = 0.1, double maxerr = 0.05,
int maxiter = 1000, bool verbose = false) {
array Weights = constant(0, X.dims(1), Y.dims(1));
for (int i = 0; i (abs(err) (test_images, test_outputs,
test_targets, 20);
The complete source code can be found [here][31].
For more code examples, visit the [examples/][4] directory.
Experimental backends
Community-contributed backends that are not part of ArrayFire releases live on
their own branches. They build from source only Top issues
#1673Support for fp1633 comments · 2016-12-14#2518in v3.6.4 c2r FFT changes the value of the input21 comments · 2019-05-21#482Expose array references through the API.19 comments · 2015-03-10#313Arrayfire Static Library19 comments · 2015-01-08#858Make sure all functions have asynchronous counterparts18 comments · 2015-06-27#904Add eigen value decomposition for all backends17 comments · 2015-07-13#113Implement streaming support for all backends17 comments · 2014-11-13#3384[BUG] Various tests failing in the CPU backend16 comments · 2023-03-26
Latest release
v3.10.1 v3.10.1 2026-11-11v3.10.1 ====== Improvements - Added support for CUDA 13.0 through 13.4 - Added support for NVIDIA Rubin GPUs (compute capability 10.7) with CUDA 13.4 - Added support for the per-toolkit layout of cuDNN 9 installers. Set cuDNN_ROOT_DIR to the cuDNN install directory, such as C:/Program Files/NVIDIA/CUDNN/v9.27 - Windows and Linux installers are now published for CUDA 12.9 and CUDA 13.4, and the toolkit version is part of the installer name - The Linux installers are built on Rocky Linux 8 with oneAPI 2026.2 and run on any x86_64 distribution with glibc 2.26 or newer - CUDA_architectur