pystencils.backend.platforms.Platform#

class pystencils.backend.platforms.Platform(ctx)#

Abstract base class for all supported platforms.

The platform performs all target-dependent tasks during code generation:

  • Translation of the iteration space to an index source (loop nest, GPU indexing, …)

  • Platform-specific optimizations (e.g. vectorization, OpenMP)

Parameters:

ctx (KernelCreationContext)

abstract property required_headers: set[str]#

Set of header files that must be included at the point of definition of a kernel running on this platform.

abstract materialize_iteration_space(body, ispace)#

Materialize the given iteration space as an indexing structure and embed the given kernel body into that structure.

Return type:

PsBlock

Parameters:
abstract select_function(call)#

Select an implementation for the given function on the given data type.

If no viable implementation exists, raise a MaterializationError.

Return type:

PsExpression

Parameters:

call (PsCall)