Classes necessary to create computations and transformations are exposed from the core module.
Represents an array or, as a degenerate case, scalar type of a computation parameter.
A tuple of integers. Scalars are represented by an empty tuple.
A numpy.dtype instance.
Tuple of bytes to step in each dimension when traversing an array.
Casts the given value to this type.
Computation parameter annotation, in the same sense as it is used for functions in the standard library.
Parameters: |
|
---|
Computation parameter, in the same sense as it is used for functions in the standard library. In its terms, all computation parameters have kind POSITIONAL_OR_KEYWORD.
Parameters: |
|
---|
Computation signature, in the same sense as it is used for functions in the standard library.
Parameters: | parameters – a list of Parameter objects. |
---|
Binds passed positional and keyword arguments to parameters in the signature and returns the resulting BoundArguments object.
A base class for computations, intended to be subclassed.
Parameters: | root_parameters – a list of Parameter objects. |
---|
A Signature object representing current computation signature (taking into account connected transformations).
A named tuple of ComputationParameter objects corresponding to parameters from the current signature.
Derived classes override this method. It is called by compile() and supposed to return a ComputationPlan object.
Parameters: |
|
---|
Updates signature and parameter attributes. Called by the methods that change the signature.
Compiles the computation with the given Thread object and returns a ComputationCallable object. If fast_math is enabled, the compilation of all kernels is performed using the compiler options for fast and imprecise mathematical functions.
Connect a transformation to the computation.
Parameters: |
|
---|---|
Returns: | this computation object (modified). |
Note
The resulting parameter order is determined by traversing the graph of connections depth-first (starting from the initial computation parameters), with the additional condition: the nodes do not change their order in the same branching level (i.e. in the list of computation or transformation parameters, both of which are ordered).
For example, consider a computation with parameters (a, b, c, d). If you connect a transformation (a', c) -> a, the resulting computation will have the signature (a', b, c, d) (as opposed to (a', c, b, d) it would have for the pure depth-first traversal).
A class containing a pure parallel transformation of arrays. Some restrictions apply:
Parameters: |
|
---|
Encapsulates the information about index variables available for the snippet.
Returns the name of the index varibale for the dimension dim.
Returns the comma-separated list of all index variable names (useful for passing the guiding indices verbatim in a load or store call).
A result of calling compile() on a computation. Represents a callable opaque GPGPU computation.
Execute the computation.
Bases: Type
Represents a typed computation parameter. Can be used as a substitute of an array for functions which are only interested in array metadata.
Bases: Type
Represents an argument suitable to pass to planned kernel or computation call.
Computation plan recorder.
Adds a nested computation call. The computation value must be a Computation object. args and kwds are values to be passed to the computation.
Adds a kernel call to the plan.
Parameters: |
|
---|
Adds a persistent GPU array to the plan, and returns the corresponding KernelArgument.
Adds a temporary GPU array to the plan, and returns the corresponding KernelArgument. Temporary arrays can share physical memory, but in such a way that their contents is guaranteed to persist between the first and the last use in a kernel during the execution of the plan.
Same as temp_array(), taking the array properties from array or array-like object arr.
Bases: Type
Represents a typed transformation parameter. Can be used as a substitute of an array for functions which are only interested in array metadata.
Providing an interface for accessing kernel arguments in a template. Depending on the parameter type, and whether it is used inside a computation or a transformation template, can have different load/store attributes available.
Parameter name
Returns the C kernel parameter name corresponding to this parameter. It is the only method available for scalar parameters.
A module providing a macro with the signature (idx0, idx1, ...), returning the corresponding element of the array.
A module providing a macro with the signature (idx0, idx1, ..., val), saving val into the specified position.
A module providing a macro with the signature (cidx0, cidx1, ...), returning the element of the array corresponding to the new slicing of indices (e.g. an array with shape (2, 3, 4, 5, 6) sliced as slices=(2, 2, 1) is indexed as an array with shape (6, 20, 6)).
A module providing a macro with the signature (cidx0, cidx1, ..., val), saving val into the specified position corresponding to the new slicing of indices.
A module providing a macro that returns the element of the array corresponding to the indices used by the caller of the transformation.
A module providing a macro with the signature (val) that stores val using the indices used by the caller of the transformation.