loki.dimension

Classes

Dimension([name, index, size, lower, upper, ...])

Dimension object that defines a one-dimensional data and iteration space.

class Dimension(name=None, index=None, size=None, lower=None, upper=None, step=None, aliases=None, bounds=None, bounds_aliases=None, index_aliases=None)

Bases: object

Dimension object that defines a one-dimensional data and iteration space.

Parameters:
  • name (string) – Name of the dimension to identify in configurations

  • index (string or tuple of str) – String representation of the predominant loop index variable associated with this dimension; can be one or several.

  • size (string or tuple of str) – String representation of the predominant size variable used to declare array shapes; can be one or several.

  • lower (string or tuple of str) – String representation of the lower bound variable used to declare iteration spaces; can be one or several.

  • lower – String representation of the upper bound variable used to declare iteration spaces; can be one or several.

  • bounds (tuple of strings) –

    String representation of the variables usually used to denote the iteration bounds of this dimension.

    WARNING: This argument is deprecated, instead lower and upper should be used.

  • aliases (list or tuple of strings) –

    String representations of alternative size variables that are used to define arrays shapes of this dimension (eg. alternative names used in “driver” subroutines).

    WARNING: This argument is deprecated, instead a tuple of variables names should be provided for size.

  • bounds_aliases (list or tuple of strings) –

    String representations of alternative bounds variables that are used to define loop ranges.

    WARNING: This argument is deprecated, instead a tuple of variables names should be provided for lower and upper.

  • index_aliases (list or tuple of strings) –

    String representations of alternative loop index variables associated with this dimension.

    WARNING: This argument is deprecated, instead a tuple of variables names should be provided for index.

property variables
property sizes

Tuple of strings that match the primary size and all secondary size expressions.

Note

For derived expressions, like end - start + 1 or 1:size, please use size_expressions.

property size

String that matches the primary size expression of a data space (variable allocation).

property indices

Tuple of strings that matche the primary index and all secondary index expressions.

property index

String that matches the primary index expression of an iteration space (loop).

property lower

String or tuple of strings that matches the lower bound of the iteration space.

property upper

String or tuple of strings that matches the upper bound of the iteration space.

property step

String or tuple of strings that matches the step size of the iteration space.

property bounds

Tuple of expression string that represent the bounds of an iteration space.

Note

If mutiple lower or upper bound string have been provided, only the first pair will be used.

property range

String that matches the range expression of an iteration space (loop).

Note

If mutiple lower or upper bound string have been provided, only the first pair will be used.

property size_expressions

A list of all expression strings representing the size of a data space.

This includes generic aliases, like end - start + 1 or 1:size ranges.