What?
A lightweight Python package exposing a subset of SYCL functionalities.
Requirements
- Install Conda
- Install Intel oneAPI
- Set environment variable
ONEAPI_ROOT- Windows:
C:\Program Files (x86)\Intel\oneAPI\ - Linux:
/opt/intel/oneapi
- Windows:
- Set environment variable
- Install OpenCL HD graphics drivers
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_ROOTand build conda package
export ONEAPI_ROOT=/opt/intel/oneapi
conda build conda-recipe -c ${ONEAPI_ROOT}/conda_channelOn Windows to cope with long file names
use croot with short folder path:
set "ONEAPI_ROOT=C:\Program Files (x86)\Intel\oneAPI\"
conda build --croot=C:/tmp conda-recipe -c "%ONEAPI_ROOT%\conda_channel"- Install conda package
conda install dpctlBuild and Install with setuptools
dpCtl relies on DPC++ runtime. With Intel oneAPI installed you should activate it.
setup.py requires environment variable ONEAPI_ROOT and following packages
installed:
cythonnumpycmake- for building C APIninja- only on Windows
Activate DPC++ compiler:
export ONEAPI_ROOT=/opt/intel/oneapi
source ${ONEAPI_ROOT}/compiler/latest/env/vars.shFor install:
python setup.py installFor development:
python setup.py developUsing dpCtl
dpCtl relies on DPC++ runtime. With Intel oneAPI installed you could activate it.
On Windows:
call "%ONEAPI_ROOT%\compiler\latest\env\vars.bat"On Linux:
source ${ONEAPI_ROOT}/compiler/latest/env/vars.shWhen dpCtl is installed via conda package
then it uses DPC++ runtime from dpcpp_cpp_rt package
and it is not necessary to activate oneAPI DPC++ compiler environment.
dpcpp_cpp_rt package is provided by oneAPI conda_channel.
Examples
See examples in folder examples.
Run python examples:
for script in `ls examples/python/`; do echo "executing ${script}"; python examples/python/${script}; doneExamples of building Cython extensions with DPC++ compiler, that interoperate
with dpCtl can be found in folder cython.
Each example in cython folder can be built using
CC=clang CXX=dpcpp python setup.py build_ext --inplace.
Please refer to run.py script in respective folders to execute extensions.
Tests
See tests in folder dpctl/tests.
Run tests:
pytest --pyargs dpctl