/dpctl

A library exposing a lightweight C-API for SYCL to use in Python applications including Numba.

Primary LanguagePythonApache License 2.0Apache-2.0

Code style: black

What?

A lightweight Python package exposing a subset of OpenCL and SYCL functionalities.

Requirements

  • Install Conda
  • Install Intel oneAPI
    • Set environment variable ONEAPI_ROOT
      • Windows: C:\Program Files (x86)\Intel\oneAPI\
      • Linux: /opt/intel/oneapi
  • Install OpenCL HD graphics drivers

Build and Install Conda Package

  1. Create and activate conda build environment
conda create -n build-env conda-build
conda activate build-env
  1. Build conda package
conda build conda-recipe

On Windows to cope with long file names:

conda build --croot=C:/tmp conda-recipe

⚠️ You could face issues with conda-build=3.20: Use conda-build=3.18!

  1. Install conda package
conda install dpctl

Using dpCtl

dpCtl relies on DPC++ runtime. With Intel oneAPI installed you should activate it.

On Windows:

call "%ONEAPI_ROOT%\compiler\latest\env\vars.bat"

On Linux:

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

Examples

See examples in folder examples.

Run examples:

python examples/create_sycl_queues.py

Tests

See tests in folder dpctl/tests.

Run tests:

python -m unittest dpctl.tests