A lightweight Python wrapper for a subset of OpenCL and SYCL.
Project description
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_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!
- 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 APIninja
- only on Windows
Activate DPC++ compiler:
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
Install Wheel Package from Pypi
- 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.
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for dpctl-0.6.1-1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e519be79cb57f7f5c022ca79fc3733fcd7fb1bbf5fbcdc61956fa23b542bac2 |
|
MD5 | f5e47de535cd7720227a41c0e5d46729 |
|
BLAKE2b-256 | ffc260c50c8d14bd30321ca4e4f46eba2166cf9477a993497654026706051370 |
Hashes for dpctl-0.6.1-1-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee9460c24c107489ca7e4459aaa0424248f676864506e21f22561e0f93bfcc4b |
|
MD5 | ad8acf8abf5a4f8f6eec137705477d79 |
|
BLAKE2b-256 | 07b0be56c47de00ecd89215b7a1cb5a140a37966efe8c559ef3197327b09c35d |