Grunnur, a generalized API for CUDA and OpenCL#

Grunnur is a thin layer on top of PyCUDA and PyOpenCL that makes it easier to write platform-agnostic programs. It is a reworked cluda submodule of Reikna, extracted into a separate module.

Main features#

  • For the majority of cases, allows one to write platform-independent code.

  • Simple usage of multiple GPUs (in particular, no need to worry about context switching for CUDA).

  • A way to split kernel code into modules with dependencies between them (see Module and Snippet).

  • Various mathematical functions (with complex numbers support) organized as modules.

  • Static kernels, where you can use global/local shapes with any kinds of dimensions without worrying about assembling array indices from blockIdx and gridIdx.

  • A temporary buffer manager that can pack several virtual buffers into the same physical one depending on the declared dependencies between them.

Where to get help#

Please file issues in the the issue tracker.

Discussions and questions are handled by Github’s discussion board.

Table of contents#

Indices and tables#