# loki.transformations.single_column.annotate

Classes

`SCCAnnotateTransformation`(block_dim) | A set of utilities to insert generic Loki directives.

class SCCAnnotateTransformation(block_dim)

  Bases: `Transformation`

  A set of utilities to insert generic Loki directives. This includes both `Loop` and `Subroutine` level annotations.

  Parameters:

    block_dim (`Dimension`) – Optional `Dimension` object to define the blocking dimension to use for hoisted column arrays if hoisting is enabled.

  annotate_vector_loops(routine)

    Insert `!$loki loop vector` for previously marked loops, including addition of the necessary private variable declarations.

    Parameters:

      routine (`Subroutine`) – The subroutine in the vector loops should be removed.

  warn_vec_within_seq_loops(routine)

    Check for vector inside sequential loops and print warning.

    Parameters:

      routine (`Subroutine`) – The subroutine in which to check for vector inside sequential loops

  annotate_kernel_routine(routine)

    Insert `!$loki routine seq/vector` directives and wrap subroutine body in `!$loki device-present` directives.

    Parameters:

      routine (`Subroutine`) – The subroutine to which annotations will be added

  transform_subroutine(routine, **kwargs)

    Apply pragma annotations according to `!$loki` placeholder directives.

    This routine effectively adds `!$loki device-present` clauses around kernel routine bodies and adds `private` clauses to loop annotations.

    Parameters:

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

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

  find_acc_vars(routine, targets)

    Find variables already specified in loki/acc data clauses.

    Parameters:

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

      - targets (list or string) – List of subroutines that are to be considered as part of the transformation call tree.

  classmethod device_alloc_column_locals(routine, column_locals)

    Add explicit OpenACC statements for creating device variables for hoisted column locals.

    Parameters:

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

      - column_locals (list) – List of column locals to be hoisted to driver layer

  annotate_driver_loop(loop, acc_vars)

    Annotate driver block loop with generic Loki pragmas.

    Parameters:

      - loop (`Loop`) – Driver `Loop` to wrap in generic Loki pragmas.

      - acc_vars (list) – Variables already declared in generic Loki data directives.