table of Contents
Preface
ArrayFire is a software platform that AcelerEyes provides users and programmers with fast data parallel programs in C, C++, Fortran and Python. ArrayFire provides simple high-level matrix abstract functions instead of low-level GPU APIs, such as CUDA, OpenCL, and OpenGL. Let scientists, engineers and economists take full advantage of GPU hardware. ArrayFire provides thousands of functions that can be converted to GPU, including linear algebra library, convolution, FFT, signal processing, image, statistics, graphics library, etc.
1. What is ArrayFire
ArrayFire is a high-performance software library for parallel computing , and has an easy-to-use API. Its array based on the function set can make parallel programming easier.
2. Features of ArrayFire
1. Easy to use
ArrayFire's array object is very simple. This array-based representation can effectively represent readable calculation algorithms similar to mathematical representations , and the use of ArrayFire does not require expertise in parallel programming. In the CUDA or OpenCL kernel, only a few lines of ArrayFire code can complete tasks that may require 100 lines of complex code.
2. Wide range of applications
ArrayFire includes hundreds of functions in different fields, including: vector algorithms, image processing, computer vision, signal processing, linear algebra, statistics and more. And every function is tuned manually by ArrayFire developers with all possible low-level optimizations.
3. Support various data types and sizes
ArrayFire can manipulate common data shapes and sizes , including vectors, matrices, etc.; it supports common data types , including single-precision and double-precision floating-point values, complex numbers, Boolean values, 32-bit signed integers and unsigned integers.
4. Has scalability
ArrayFire can be used as a standalone application, or it can be integrated with existing CUDA or OpenCL code. All ArrayFire arrays can be interchanged with other CUDA or OpenCL data structures.
5. Code once, run anywhere
ArrayFire supports all device lists, including devices that support x86, ARM, CUDA, and OpenCL. After successfully installing ArrayFire, the device will have:
- CUDA version (named "libafcuda") for NVIDIA GPU;
- The OpenCL version (named "libafopencl") used for OpenCL;
- CPU version when CUDA or OpenCL is not available (named "libafcpu").
6. Support vectorization and batch operations
ArrayFire supports batch processing of N-dimensional arrays. Batch operations in ArrayFire run in parallel to ensure the best use of CUDA or OpenCL devices. You can use vectorization methods to get the best performance from ArrayFire. ArrayFire can also perform loop iterations in parallel with the gfor function .
7. Just-in-time compilation
ArrayFire can analyze at runtime to increase computational intensity and memory throughput while avoiding unnecessary temporary allocation. It has a great internal JIT compiler that can be optimized.