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
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,))
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.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 851480f881201fb1ef147364197a438b5c458cff28f169ce3c99e3b60a9ddd66 |
|
MD5 | d9a4a27582e3615d55dc327c8249f265 |
|
BLAKE2b-256 | 137e3be97c1723a479db6149bebfde76341a45cf8e1bd8334b65864180434a1f |
Hashes for pyclesperanto_prototype-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0349a0b7b270fefbc7c1bc67166e623374e864daac1daab854516d8d24ef3ecf |
|
MD5 | a42e799a72e65a9ca511cb50c94dc4df |
|
BLAKE2b-256 | 31ce458cbd3c3b88ca9c2b61af22f362419f31ade6bd88fff7a66832bca34ee7 |