Getting Started¶
Installation¶
numba-dppy
depends on following components:
numba 0.52.* (Intel Python Numba)
dpctl 0.6.* (Intel Python dpctl)
dpnp >=0.5.1 (optional, Intel Python DPNP)
llvm-spirv (SPIRV generation from LLVM IR)
llvmdev (LLVM IR generation)
cython (for building)
scipy (for testing)
pytest (for testing)
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 numba-dppy-env numba-dppy 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-dppy
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 numba-dppy-env -c ${ONEAPI_ROOT}/conda_channel python=3.7 dpctl dpnp numba spirv-tools llvm-spirv llvmdev cython pytest
conda activate numba-dppy-env
Activate DPC++ compiler:
source ${ONEAPI_ROOT}/compiler/latest/env/vars.sh
For installing:
python setup.py install
For development:
python setup.py develop
Limitations¶
Using numba-dppy
requires Intel Python Numba as that version of Numba has
patches needed to recognize a dpctl.device_context
scope and trigger
code-generation for a SYCL device. Work in underway to upstream all patches, so
that in future numba-dppy
can work with upstream Numba.