Skip to main content

A lightweight Python wrapper for a subset of SYCL.

Project description

Code style: black Imports: isort Coverage Status

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"

:warning: 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. setup.py requires environment variable ONEAPI_ROOT and following packages installed:

  • cython
  • numpy
  • cmake - for building C API
  • ninja - only on Windows

You need DPC++ to build dpctl. If you want to build using the DPC++ in a oneAPI distribution, activate DPC++ compiler as follows:

export ONEAPI_ROOT=/opt/intel/oneapi
source ${ONEAPI_ROOT}/compiler/latest/env/vars.sh

For install:

python setup.py install

For development:

python setup.py develop

It is also possible to build dpctl using DPC++ toolchain instead of oneAPI DPC++. Instead of activating the oneAPI environment, indicate the toolchain installation prefix with --sycl-compiler-prefix option, e.g.

python setup.py develop --sycl-compiler-prefix=${DPCPP_ROOT}/llvm/build

Please use python setup.py develop --help for more details.

Install Wheel Package from Pypi

  1. Install dpctl
python -m pip install --index-url https://pypi.anaconda.org/intel/simple -extra-index-url https://pypi.org/simple dpctl

Note: dpctl wheel package is placed on Pypi, but some of its dependencies (like Intel numpy) are in Anaconda Cloud. That is why install command requires additional intel Pypi channel from Anaconda Cloud.

  1. Set path to Performance Libraries in case of using venv or system Python: On Linux:
export LD_LIBRARY_PATH=<path_to_your_env>/lib

On Windows:

set PATH=<path_to_your_env>\bin;<path_to_your_env>\Library\bin;%PATH%

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

for script in `ls examples/python/`; do echo "executing ${script}"; python examples/python/${script}; done

Examples 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dpctl-0.8.0-0-cp38-cp38-win_amd64.whl (911.4 kB view details)

Uploaded CPython 3.8Windows x86-64

dpctl-0.8.0-0-cp38-cp38-manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.8

dpctl-0.8.0-0-cp37-cp37m-win_amd64.whl (894.8 kB view details)

Uploaded CPython 3.7mWindows x86-64

dpctl-0.8.0-0-cp37-cp37m-manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.7m

File details

Details for the file dpctl-0.8.0-0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: dpctl-0.8.0-0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 911.4 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

File hashes

Hashes for dpctl-0.8.0-0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6e60db0f86823c074b25dd28a8cacd0a9119e1d538a7ebeba95dc9923479d34b
MD5 3b6c2a45c93c47e6b49a85a06e3e62eb
BLAKE2b-256 4a5aa68cb48d435dea68acd3d95d30b277ceadec8dd15c12e9eee20963b3f88e

See more details on using hashes here.

File details

Details for the file dpctl-0.8.0-0-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: dpctl-0.8.0-0-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

File hashes

Hashes for dpctl-0.8.0-0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a9ed2299facbe613de29d861a9ac3c16ee74b9e81c664bf08142024d2cdd9e38
MD5 aafc1e37608cb644d0304502a865dc01
BLAKE2b-256 1bf1404a958ee3a2b5ad2b5531d42445fd30f572155ad0653958a49e957ed5b1

See more details on using hashes here.

File details

Details for the file dpctl-0.8.0-0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: dpctl-0.8.0-0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 894.8 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

File hashes

Hashes for dpctl-0.8.0-0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 6bcee76b722ff7d8c781ca6b9ae146c33e35f5a64af47607e3f628b5dbf66f7d
MD5 d38b5c540e075b8f5b00a54a65a07991
BLAKE2b-256 a6f4042ea997060b997fb1847e736eec61b026b0343d19b596878872a11d4c7a

See more details on using hashes here.

File details

Details for the file dpctl-0.8.0-0-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: dpctl-0.8.0-0-cp37-cp37m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

File hashes

Hashes for dpctl-0.8.0-0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f3d42f2efe116c1ccb6ccbb9090e7f4fc2a31bcb3cff77cbaa29e80ca54a219c
MD5 ecebde858ade830ef3a6bb7fc3f1e055
BLAKE2b-256 50c9b03dda93eda2e168976d5a72436f65a30b5233bc63c24d0f57170d1293e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page