Skip to main content

ctypes wrappers for HIP, CUDA, and OpenCL

Project description

gpuctypes (a low level GPU library for Python)

Do you wish that there were simple wrappers for GPU libraries in Python? Like not pyopencl, pycuda, and (HIP library someday?) here, but just raw access to the APIs?

That's what gpuctypes does! While high level libraries have their place, the world needs more low level libraries. Like gpuctypes. Welcome home.

Installation (usage)

pip install gpuctypes

Usage

import gpuctypes.hip as hip
import gpuctypes.cuda as cuda
import gpuctypes.opencl as opencl

How it works

gpuctypes uses ctypeslib to autogenerate Python files from the headers of the respective libraries.

Installation (development)

git clone https://github.com/tinygrad/gpuctypes.git
cd gpuctypes
pip install -e .

Current versions

  • ROCm 6.0.0
  • CUDA 11.5
  • OpenCL (whatever is in Ubuntu 22.04)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gpuctypes-0.3.0.tar.gz (91.9 kB view hashes)

Uploaded Source

Built Distribution

gpuctypes-0.3.0-py3-none-any.whl (90.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page