About
Data Parallel Control (dpctl) is a Python library that allows a user
to control the execution placement of a compute
kernel on an
XPU.
The compute kernel can be either a code written by the user, e.g.,
using numba-dppy, or a code that is part of a library like oneMKL. The dpctl
library is built upon the SYCL
standard and implements Python
bindings for a subset of the standard runtime
classes
that allow users to query platforms, discover and represent devices
and sub-devices, and construct contexts and queues. In addition,
dpctl features classes for SYCL Unified Shared Memory
(USM)
management and implements a tensor array
API.
The library also assists authors of Python native extensions written
in C, Cython, or pybind11 to access dpctl objects representing SYCL
devices, queues, memory, and tensors.
Dpctl is the core part of a larger family of data-parallel Python
libraries and
tools
to program XPUs. The library is available via
conda and
pip. It is included in the Intel(R)
Distribution for
Python*
(IDP).
Installing
From Intel oneAPI
dpctl is packaged as part of the quarterly Intel oneAPI releases. To
get the library from the latest oneAPI release please follow the
instructions from Intel's oneAPI installation
guide.
Note that you will need to install the Intel BaseKit toolkit to get
IDP and dpctl.
From Conda
dpctl package is available on the Intel channel on Annaconda
cloud. You an use the following to install dpctl from there:
conda install dpctl -c intelFrom PyPi
dpctl is also available from PyPi and can be installed using:
pip3 install dpctlInstalling the bleeding edge
If you want to try out the current master, you can install it from our development channel on Anaconda cloud:
conda install dpctl -c dppy\label\devBuilding
Please refer our getting started user
guide for more information on
setting up a development environment and building dpctl from source.
Running 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=icx CXX=dpcpp python setup.py build_ext --inplace.
Please refer to run.py script in respective folders to execute extensions.
Running Tests
Tests are located in folder dpctl/tests.
Run tests:
pytest --pyargs dpctl