yas-sim / python-dpcpp-extension-sample-code

Python extension sample code using Intel oneAPI DPC++. The extension does a simple image processing using DPC++ kernel.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sample code of Python extension module using DPC++ (Data Parallel C++)

Description:

This project demonstrates how to write a Python extension module with DPC++. The Python extension will take an OpenCV image stored in a Numpy array and do image processing. The actual image processing code is using DPC++ kernel and the rest is written in standard C++ code.
DPC++ is a Clang based compiler developed by Intel which includs Khronos SYCL extension and Intel specific SYCL extensions. It enables seamless heterogeneous programming and can support not only CPU but also integrated GPU, FPGA and more to come.

  • Result example image

Prerequisites:

  • DPC++ compiler (from oneAPI Base Toolkit 2021.3)

How to build and run:

build.sh
  • python_dpcpp_module.so will be generated.
python3 test.py

Note:

Tested on Ubuntu 20.04.

About

Python extension sample code using Intel oneAPI DPC++. The extension does a simple image processing using DPC++ kernel.


Languages

Language:C++ 74.3%Language:CMake 14.2%Language:Python 8.9%Language:Shell 2.6%