Getting Started

Installation

numba-dpex depends on following components:

It is recommended to use conda packages from Intel Distribution for Python channel or anaconda.org/intel channel. Intel Distribution for Python is available from Intel oneAPI.

Create conda environment:

export ONEAPI_ROOT=/opt/intel/oneapi
conda create -n test-env numba-dpex dpnp -c ${ONEAPI_ROOT}/conda_channel

Build and Install Conda Package

Create and activate conda build environment:

conda create -n build-env conda-build
conda activate build-env

Set environment variable ONEAPI_ROOT and build conda package:

export ONEAPI_ROOT=/opt/intel/oneapi
conda build conda-recipe -c ${ONEAPI_ROOT}/conda_channel

Install conda package:

conda install numba-dpex

Build and Install with setuptools

setup.py requires environment variable ONEAPI_ROOT and following packages installed in conda environment:

export ONEAPI_ROOT=/opt/intel/oneapi
conda create -n test-env -c ${ONEAPI_ROOT}/conda_channel python=3.7 dpctl dpnp numba spirv-tools llvm-spirv llvmdev cython pytest
conda activate test-env

Activate DPC++ compiler:

source ${ONEAPI_ROOT}/compiler/latest/env/vars.sh

For installing:

python setup.py install

For development:

python setup.py develop

Testing

See folder numba_dpex/tests.

To run the tests:

python -m pytest --pyargs numba_dpex.tests

Examples

See folder numba_dpex/examples.

To run the examples:

python numba_dpex/examples/sum.py