Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...
Cython is a programming language to simplify writing C and C++ extension modules for the CPython Python runtime. Strictly speaking, Cython syntax is a superset of Python syntax additionally supporting:...
. CLyther is a Python language extension that makes writing OpenCL code as easy as Python itself. CLyther currently only supports a subset of the Python language definition but adds many new features to OpenCL. CLyther was inspired by PyCUDA and its views on metaprogramming
Metaprogramming
Metaprogramming is the writing of computer programs that write or manipulate other programs as their data, or that do part of the work at compile time that would otherwise be done at runtime...
.
CLyther exposes both the OpenCL C library as well as the OpenCL language to python.
Features
Fast prototyping of OpenCL code
Create OpenCL code using the Python language definition
Object-oriented programming is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction,...
in OpenCL code
Passing functions as arguments to kernel functions
Python emulation mode of OpenCL code
Fancy indexing of arrays
Device memory management
Dynamic compilation at runtime
Example
This is an example of a generic OpenCL reduce operator. The arguments include oper which may be a Python
function passed to reduce at runtime.