All Projects → arrayfire → Arrayfire Python

arrayfire / Arrayfire Python

Licence: bsd-3-clause
Python bindings for ArrayFire: A general purpose GPU library.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Arrayfire Python

Occa
JIT Compilation for Multiple Architectures: C++, OpenMP, CUDA, HIP, OpenCL, Metal
Stars: ✭ 230 (-35.75%)
Mutual labels:  gpu, gpgpu, opencl, cuda, hpc
Arrayfire Rust
Rust wrapper for ArrayFire
Stars: ✭ 525 (+46.65%)
Mutual labels:  gpu, gpgpu, opencl, cuda, hpc
Futhark
💥💻💥 A data-parallel functional programming language
Stars: ✭ 1,641 (+358.38%)
Mutual labels:  gpu, gpgpu, opencl, cuda, hpc
Parenchyma
An extensible HPC framework for CUDA, OpenCL and native CPU.
Stars: ✭ 71 (-80.17%)
Mutual labels:  gpu, gpgpu, opencl, cuda, hpc
Arrayfire
ArrayFire: a general purpose GPU library.
Stars: ✭ 3,693 (+931.56%)
Mutual labels:  gpu, gpgpu, opencl, cuda, hpc
Ilgpu
ILGPU JIT Compiler for high-performance .Net GPU programs
Stars: ✭ 374 (+4.47%)
Mutual labels:  gpu, gpgpu, opencl, cuda
Bitcracker
BitCracker is the first open source password cracking tool for memory units encrypted with BitLocker
Stars: ✭ 463 (+29.33%)
Mutual labels:  gpu, gpgpu, opencl, cuda
Hipsycl
Implementation of SYCL for CPUs, AMD GPUs, NVIDIA GPUs
Stars: ✭ 377 (+5.31%)
Mutual labels:  gpu, gpgpu, opencl, cuda
Neanderthal
Fast Clojure Matrix Library
Stars: ✭ 927 (+158.94%)
Mutual labels:  gpu, gpgpu, opencl, cuda
MatX
An efficient C++17 GPU numerical computing library with Python-like syntax
Stars: ✭ 418 (+16.76%)
Mutual labels:  hpc, gpu, cuda, gpgpu
Compute
A C++ GPU Computing Library for OpenCL
Stars: ✭ 1,192 (+232.96%)
Mutual labels:  gpu, gpgpu, opencl, hpc
Optical Flow Filter
A real time optical flow algorithm implemented on GPU
Stars: ✭ 146 (-59.22%)
Mutual labels:  gpu, gpgpu, cuda
Aparapi
The New Official Aparapi: a framework for executing native Java and Scala code on the GPU.
Stars: ✭ 352 (-1.68%)
Mutual labels:  gpu, gpgpu, opencl
Bayadera
High-performance Bayesian Data Analysis on the GPU in Clojure
Stars: ✭ 342 (-4.47%)
Mutual labels:  gpu, opencl, cuda
Primitiv
A Neural Network Toolkit.
Stars: ✭ 164 (-54.19%)
Mutual labels:  gpu, opencl, cuda
Mixbench
A GPU benchmark tool for evaluating GPUs on mixed operational intensity kernels (CUDA, OpenCL, HIP, SYCL)
Stars: ✭ 130 (-63.69%)
Mutual labels:  gpu, opencl, cuda
Khiva
An open-source library of algorithms to analyse time series in GPU and CPU.
Stars: ✭ 161 (-55.03%)
Mutual labels:  gpu, opencl, cuda
Bohrium
Automatic parallelization of Python/NumPy, C, and C++ codes on Linux and MacOSX
Stars: ✭ 209 (-41.62%)
Mutual labels:  gpu, opencl, cuda
allgebra
Base container for developing C++ and Fortran HPC applications
Stars: ✭ 14 (-96.09%)
Mutual labels:  hpc, gpu, cuda
Onemkl
oneAPI Math Kernel Library (oneMKL) Interfaces
Stars: ✭ 122 (-65.92%)
Mutual labels:  gpu, cuda, hpc

ArrayFire Python Bindings

ArrayFire is a high performance library for parallel computing with an easy-to-use API. It enables users to write scientific computing code that is portable across CUDA, OpenCL and CPU devices. This project provides Python bindings for the ArrayFire library.

Documentation

Documentation for this project can be found over here.

Example

# Monte Carlo estimation of pi
def calc_pi_device(samples):
    # Simple, array based API
    # Generate uniformly distributed random numers
    x = af.randu(samples)
    y = af.randu(samples)
    # Supports Just In Time Compilation
    # The following line generates a single kernel
    within_unit_circle = (x * x + y * y) < 1
    # Intuitive function names
    return 4 * af.count(within_unit_circle) / samples

Choosing a particular backend can be done using af.set_backend(name) where name is either "cuda", "opencl", or "cpu". The default device is chosen in the same order of preference.

Getting started

ArrayFire can be installed from a variety of sources. Pre-built wheels are available for a number of systems and toolkits. These will include a distribution of the ArrayFire libraries. Currently, only the python wrapper is available on PyPI. Wrapper-only installations will require a separate installation of the ArrayFire C/C++ libraries. You can get the ArrayFire C/C++ library from the following sources:

Install the last stable version of python wrapper:

pip install arrayfire

Install a pre-built wheel for a specific CUDA toolkit version:

pip install arrayfire==3.8.0+cu112 -f https://repo.arrayfire.com/python/wheels/3.8.0/
# Replace the +cu112 local version with the desired toolkit

Install the development source distribution:

pip install git+git://github.com/arrayfire/[email protected]

Installing offline:

cd path/to/arrayfire-python
python setup.py install

Rather than installing and building ArrayFire elsewhere in the system, you can also build directly through python by first setting the AF_BUILD_LOCAL_LIBS=1 environment variable. Additional setup will be required to build ArrayFire, including satisfying dependencies and further CMake configuration. Details on how to pass additional arguments to the build systems can be found in the scikit-build documentation.

Post Installation:

If you are not using one of the pre-built wheels, you may need to ensure arrayfire-python can find the installed arrayfire libraries. Please follow these instructions to ensure that arrayfire-python can find the arrayfire libraries.

To run arrayfire tests, you can run the following command from command line.

python -m arrayfire.tests

Communication

Acknowledgements

The ArrayFire library is written by developers at ArrayFire LLC with contributions from several individuals.

The developers at ArrayFire LLC have received partial financial support from several grants and institutions. Those that wish to receive public acknowledgement are listed below:

Grants

This material is based upon work supported by the DARPA SBIR Program Office under Contract Numbers W31P4Q-14-C-0012 and W31P4Q-15-C-0008. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the DARPA SBIR Program Office.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].