Bases: object
Bases: codepy.cgen.Generable
Initialize a function definition. fdecl is expected to be a FunctionDeclaration instance, while body is a Block.
Bases: codepy.cgen.Generable
Return a tuple (typename, rhs).
typename is a list of lines (most often just a single one) describing the type of this declarator. rhs is the right- hand side that actually contains the function/array/constness notation making up the bulk of the declarator syntax.
Bases: codepy.cgen.Declarator
A simple declarator: typename and name are given as strings.
Bases: codepy.cgen.Declarator
A simple declarator: The type is given as a numpy.dtype and the name is given as a string.
Bases: codepy.cgen.Declarator
A structure declarator.
Initialize the structure declarator. tpname is the name of the structure, while declname is the name used for the declarator. pad_bytes is the number of padding bytes added at the end of the structure. fields is a list of Declarator instances.
Bases: codepy.cgen.Struct
Initialize a structure declarator. tpname is the name of the structure, while declname is the name used for the declarator. pad_bytes is the number of padding bytes added at the end of the structure. fields is a list of Declarator instances.
align_bytes is an integer that causes the structure to be padded to an integer multiple of itself. aligned_prime_to is a list of integers. If the resulting structure’s size is s, then s//align_bytes will be made prime to all numbers in aligned_prime_to. (Sounds obscure? It’s needed for avoiding bank conflicts in CUDA programming.)
Initialize a structure declarator. tpname is the name of the structure, while declname is the name used for the declarator. pad_bytes is the number of padding bytes added at the end of the structure. fields is a list of Declarator instances.
align_bytes is an integer that causes the structure to be padded to an integer multiple of itself. aligned_prime_to is a list of integers. If the resulting structure’s size is s, then s//align_bytes will be made prime to all numbers in aligned_prime_to. (Sounds obscure? It’s needed for avoiding bank conflicts in CUDA programming.)
Build a binary, packed representation of self in a str instance with members set to the values specified in kwargs.
Unlike make(), not all members have to occur in kwargs.
This module adds a few Nvidia CUDA features to CodePy’s repertoire. This makes CodePy a perfect complement to PyCuda: CodePy generates the code, PyCuda compiles it, uploads it to the GPU and executes it.
The PyCuda manual has a tutorial on using the two together.