loki.transformations.single_column.base

Classes

SCCBaseTransformation(horizontal[, directive])

A basic set of utilities used in the SCC transformation.

class SCCBaseTransformation(horizontal, directive=None)

Bases: Transformation

A basic set of utilities used in the SCC transformation. These utilities can either be used as a transformation in their own right, or the contained class methods can be called directly.

Parameters:
  • horizontal (Dimension) – Dimension object describing the variable conventions used in code to define the horizontal data dimension and iteration space.

  • directive (string or None) – Directives flavour to use for parallelism annotations; either 'openacc' or None.

classmethod resolve_masked_stmts(routine, loop_variable)

Resolve MaskedStatement (WHERE statement) objects to an explicit combination of Loop and Conditional combination.

Parameters:
  • routine (Subroutine) – The subroutine in which to resolve masked statements

  • loop_variable (Scalar) – The induction variable for the created loops.

classmethod resolve_vector_dimension(routine, loop_variable, bounds)

Resolve vector notation for a given dimension only. The dimension is defined by a loop variable and the bounds of the given range.

TODO: Consolidate this with the internal loki.transform.transform_array_indexing.resolve_vector_notation.

Parameters:
  • routine (Subroutine) – The subroutine in which to resolve vector notation usage.

  • loop_variable (Scalar) – The induction variable for the created loops.

  • bounds (tuple of Scalar) – Tuple defining the iteration space of the inserted loops.

transform_subroutine(routine, **kwargs)

Apply SCCBase utilities to a Subroutine.

Parameters:
  • routine (Subroutine) – Subroutine to apply this transformation to.

  • role (string) – Role of the subroutine in the call tree; should be "kernel"

process_kernel(routine)

Applies the SCCBase utilities to a “kernel”. This consists simply of resolving associations, masked statements and vector notation.

Parameters:

routine (Subroutine) – Subroutine to apply this transformation to.

process_driver(routine)

Applies the SCCBase utilities to a “driver”. This consists simply of resolving associations.

Parameters:

routine (Subroutine) – Subroutine to apply this transformation to.