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 and gputools.
If installation of gputools doesn't work because of issues with pyopencl for Windows, 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
pip install gputools
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
An example is available in this script. Basically, you import the methods from clEsperanto you need:
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.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e23e82ce03d450fe368a4e70e6c3f5e74dba52e17ed8aa1bc650abe1b8c5297a |
|
MD5 | ff96be1275e220e44ae319556f761190 |
|
BLAKE2b-256 | 2c41c3985ae758109d8ac74f74c0a082b35101290fe0fed33e795b45856dc521 |
Hashes for pyclesperanto_prototype-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f7fc87dd52bf4fb517e9dffb43d8fa053eea5eb8336014a0d1c0cdf3fa530f3 |
|
MD5 | 6efeb36aa6fca6445669297307268c91 |
|
BLAKE2b-256 | 235356e5bb96b8ec58192c17478dcc9be1b0780c6a10aba86a2e3a6b6a4846c2 |