Skip to content
/ dpctl Public
forked from IntelPython/dpctl

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

License

Notifications You must be signed in to change notification settings

DrTodd13/dpctl

 
 

Repository files navigation

Code style: black

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
  • 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. Set environment variable ONEAPI_ROOT and build conda package
export ONEAPI_ROOT=/opt/intel/oneapi
conda build conda-recipe -c ${ONEAPI_ROOT}/conda_channel

On 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"

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

  1. Install conda package
conda install dpctl

Build and Install with setuptools

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

For install:

python setup.py install

For development:

python setup.py develop

Using 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.sh

When 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 examples:

python examples/create_sycl_queues.py

Tests

See tests in folder dpctl/tests.

Run tests:

python -m unittest dpctl.tests

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 54.4%
  • C++ 29.4%
  • C 13.4%
  • CMake 1.5%
  • Other 1.3%