Deeploy.TilingExtension.TilingCodegen.VariableReplacementScheme

class Deeploy.TilingExtension.TilingCodegen.VariableReplacementScheme(perTileReplacements: Dict[str, List], replacementTypes: Dict[str, Type[Pointer]])

Bases: object

Defines how variables should be replaced with tile-specific values.

This class manages the replacement of scalar variables with arrays of tile-specific values during tiled execution. It tracks both the per-tile replacement values and the corresponding data types for each variable.

Variables:
  • perTileReplacements (Dict[str, List]) – Dictionary mapping variable names to lists of replacement values, one value per tile. Each list should have length equal to the number of tiles.

  • replacementTypes (Dict[str, Type[Pointer]]) – Dictionary mapping variable names to their corresponding pointer types for the replacement arrays.

Parameters:
  • perTileReplacements (Dict[str, List]) – Per-tile replacement values for each variable.

  • replacementTypes (Dict[str, Type[Pointer]]) – Type information for each replacement variable.

Raises:

AssertionError – If the keys in perTileReplacements and replacementTypes don’t match exactly, or if they have different numbers of entries.

Notes

This scheme is used to replace compile-time constants with runtime arrays during tiled execution, enabling different values for each tile.

Methods

__init__(perTileReplacements: Dict[str, List], replacementTypes: Dict[str, Type[Pointer]])

Initialize a VariableReplacementScheme with replacements and types.

Parameters:
  • perTileReplacements (Dict[str, List]) – Per-tile replacement values for each variable.

  • replacementTypes (Dict[str, Type[Pointer]]) – Type information for each replacement variable.

Raises:

AssertionError – If the keys don’t match exactly or have different counts.

__init__(perTileReplacements, replacementTypes)

Initialize a VariableReplacementScheme with replacements and types.

Attributes

perTileReplacements

replacementTypes