Bases: object
Return a single string (possibly containing newlines) representing this code construct.
Generate (i.e. yield) the lines making up this code construct.
Bases: cgen.Generable
Bases: cgen.Block
Bases: cgen.Generable
Bases: cgen.Generable
Initialize a function definition. fdecl is expected to be a FunctionDeclaration instance, while body is a Block.
Bases: cgen.Generable
Bases: cgen.Generable
Bases: cgen.Generable
Bases: cgen.Generable
Bases: cgen.Generable
Bases: cgen.Generable
Return a tuple (type_lines, rhs).
type_lines is a non-empty 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.
Return the declarator as a single line.
Bases: cgen.Declarator
A simple declarator: typename and name are given as strings.
Bases: cgen.Declarator
A simple declarator: The type is given as a numpy.dtype and the name is given as a string.
Bases: 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: 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.)
Return the number of bytes occupied by this struct.
Build a binary, packed representation of self in a str instance with members set to the values specified in kwargs.
Bases: cgen.Declarator
Bases: cgen.NestedDeclarator
Bases: cgen.NestedDeclarator
Bases: cgen.NestedDeclarator
Bases: cgen.NestedDeclarator
Bases: cgen.NestedDeclarator
Bases: cgen.Pointer
Bases: cgen.NestedDeclarator
Bases: cgen.NestedDeclarator
Bases: cgen.DeclSpecifier
Bases: cgen.DeclSpecifier
Bases: cgen.Generable
Bases: cgen.Generable
Bases: cgen.Generable
Bases: cgen.Loop
Bases: cgen.Loop
Bases: cgen.Loop
This module adds a few Nvidia CUDA features to cgen’s repertoire. This makes cgen a perfect complement to PyCuda: cgen 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.
Bases: cgen.DeclSpecifier
Bases: cgen.DeclSpecifier
Bases: cgen.DeclSpecifier
Bases: cgen.DeclSpecifier
Bases: cgen.DeclSpecifier
Bases: cgen.DeclSpecifier
Bases: cgen.DeclSpecifier
Bases: cgen.DeclSpecifier
Bases: cgen.Value
Bases: cgen.NestedDeclarator
Bases: cgen.opencl._CLWorkGroupSizeDeclarator
Bases: cgen.opencl._CLWorkGroupSizeDeclarator
Bases: cgen.Declarator