Skip to main content

pyopencl-extension

This package extends PyOpenCl by providing an object-oriented kernel programming framework and debugging capabilities.

What makes pyopencl-extension special?
  • Build on top of PyOpenCl which can increase performance significantly.

  • Usage of this framework forces consistent code when programming for GPU.

  • Allows debugging of OpenCl-Programs through kernel emulation in Python using a visual debugger (tested with Pycharm).

  • OpenCl emulation allows to find out-of-bounds array indexing more easily.

  • Integrated profiling features give quick overview over performance bottlenecks.

The project is in an early development stage and actively maintained. For any feature requests/feedback/etc. you can get in touch via Github or by E-Mail (philipp.mohr@tuhh.de).

Installation

Install this library with pip install pyopencl-extension.

When automatic installation of PyOpenCl fails (happens when using Windows):

  1. Download appropriate .whl binary from PyOpenCl binaries for Windows

  2. Make sure to have proper OpenCl driver for your graphics card installed.

  3. Run pip install "pyopencl-X-cpX-cpX-X.whl" in terminal, where X must be replaced with corresponding version.

Usage

One very simple example is given below.

from pyopencl_extension import Kernel, Global, Scalar, Types, zeros
import numpy as np

ary = zeros((10,), Types.short)

knl = Kernel('some_operation',
             {'ary': Global(ary),  # notice that ary is set as default argument
              'number': Scalar(Types.short)},
             """
                ary[get_global_id(0)] = get_global_id(0) + number;
             """,
             global_size=ary.shape).compile(emulate=True)
knl(number=3)
assert np.allclose(ary.get(), np.arange(10) + 3)

By setting the argument ‘emulate=True’ the kernel will be compiled in emulation mode. This mode creates a file ‘some_operation.py’, which can be inspected using a visual debugger:

https://i.imgur.com/Gfg9AtZ.png

More advanced examples can by found in the tests hosted on Github.

Metadata

Release files for pyopencl-extension 0.2.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyopencl-extension 0.2.9
File Size Uploaded Provenance Actions
pyopencl-extension-0.2.9.tar.gz 65.3 kB Without provenance Details for pyopencl-extension-0.2.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyopencl-extension 0.2.9
File Interpreter ABI Platform Actions
pyopencl_extension-0.2.9-py3-none-any.whl Python 3 none any Details for pyopencl_extension-0.2.9-py3-none-any.whl

Total release size: 124.5 kB

Release files / pyopencl-extension-0.2.9.tar.gz

Download URL pyopencl-extension-0.2.9.tar.gz
Size 65.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4c74d84bbd70bc4bb02c1e5911c2272e8ddc1f2737e9bb646f9da22fbc7094ce
BLAKE2b-256 checksum
How to use checksums
1487d8d34ffa10ffc6342f599aa68fa7f721340f4d57628b51e54e8d1d66d791
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

Release files / pyopencl_extension-0.2.9-py3-none-any.whl

Download URL pyopencl_extension-0.2.9-py3-none-any.whl
Size 59.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
090eb8ec5335dfbd307e660fd3fa39848fb1a410f6a58d7a51e89d157ce1b78f
BLAKE2b-256 checksum
How to use checksums
f18b228540030b6a72d4b2a5dd1b883815adb4249752a1da1c867832d9527095
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

Security for pyopencl-extension 0.2.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.9 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page