OpenCL based GPU-accelerated image processing (an early prototype)
Project description
pyclesperanto
pyclesperanto is a prototype for clEsperanto - a multi-platform multi-language framework for GPU-accelerated image procesing. It uses OpenCL kernels from CLIJ
Right now, this is very preliminary.
Installation
- Get a python environment, e.g. via mini-conda
- Install pyopencl.
If installation of pyopencl for Windows fails, consider downloading a precompiled wheel (e.g. from here ) and installing it manually:
pip install pyopencl-2019.1.1+cl12-cp37-cp37m-win_amd64.whl
Afterwards, install pyclesperanto:
pip install pyclesperanto-prototype
Troubleshooting installation
If you receive an error like
DLL load failed: The specified procedure could not be found.
Try downloading and installing a pyopencl with a lower cl version, e.g. cl12 : pyopencl-2020.1+cl12-cp37-cp37m-win_amd64
Example code
Basically, you import clEsperanto:
import pyclesperanto_prototype as cle
You can then push an image to the GPU and create memory there:
import numpy as np
# push an array to the GPU
flip = cle.push(np.array([[2, 4, 6, 8, 10, 12, 14, 16, 18, 20]]))
# create memory for the output
flop = cle.create((10,1))
And then you can call methods in the GPU without the need for learning OpenCL:
# add a constant to all pixels
cle.add_image_and_scalar(flip, flop, 100.0)
# print result
print(flop)
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 Distribution
Built Distribution
Hashes for pyclesperanto_prototype-0.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b08300912eadb2d418db87cec3066ed4e9ea53ce19cc0bde99b299f248a96569 |
|
MD5 | 63fd3d64d322cb3a33259f0cc791fef7 |
|
BLAKE2b-256 | 30de4a5bd7c00aa050e8ed7070a878084a04352acd2459d620c02a806e8291aa |
Hashes for pyclesperanto_prototype-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fd75907f1013be5891bba9354b0d446bcd7fd8184a7a1849031549ff9918f91 |
|
MD5 | b96f3c79286738af62b008b9d6b05622 |
|
BLAKE2b-256 | 2df34eb9b23142c9ace90c0e0d71ef0837e96e3032d8606d3688038326948fbf |