Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/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.
https://github.com/yas-sim/python-dpcpp-extension-sample-code
box-filter convolution-filter dpcpp gpu-acceleration gpu-programming heterogeneous heterogeneous-parallel-programming image-processing numpy numpy-capi oneapi opencl python python-extension sample-code sycl
Last synced: about 1 month ago
JSON representation
Python extension sample code using Intel oneAPI DPC++. The extension does a simple image processing using DPC++ kernel.
- Host: GitHub
- URL: https://github.com/yas-sim/python-dpcpp-extension-sample-code
- Owner: yas-sim
- Created: 2021-08-15T04:51:59.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-08-17T08:54:36.000Z (over 3 years ago)
- Last Synced: 2024-04-23T00:09:54.827Z (8 months ago)
- Topics: box-filter, convolution-filter, dpcpp, gpu-acceleration, gpu-programming, heterogeneous, heterogeneous-parallel-programming, image-processing, numpy, numpy-capi, oneapi, opencl, python, python-extension, sample-code, sycl
- Language: C++
- Homepage:
- Size: 1.89 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sample code of Python extension module using DPC++ (Data Parallel C++)
### Description:
This project demonstrates how to write a Python extension module with [DPC++](https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/dpc-compiler.html#gs.8eyara). 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](https://www.khronos.org/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](./resources/result.png)### Prerequisites:
- DPC++ compiler (from oneAPI Base Toolkit 2021.3)### How to build and run:
```sh
build.sh
```
* `python_dpcpp_module.so` will be generated.
```sh
python3 test.py
```### Note:
Tested on Ubuntu 20.04.