# loki.transformations.single_column.revector

Functions

`wrap_vector_section`(section, routine, ...[, ...]) | Wrap a section of nodes in a vector-level loop across the horizontal.

Classes

`BaseRevectorTransformation`(horizontal) | A base/parent class for transformation to wrap thread-parallel IR sections within a horizontal loop.
`RevectorSectionTransformer`(routine, ...[, ...]) | `Transformer` that replaces `Section` objects labelled with `"vector_section"` with vector-level loops across the horizontal.
`SCCRevectorTransformation` | alias of `SCCVecRevectorTransformation`

`SCCSeqRevectorTransformation`(horizontal)

A transformation to wrap thread-parallel IR sections within a horizontal loop in a way that the horizontal loop is hoisted/moved to the driver level while the horizontal/loop index is passed as an argument. This transformation relies on markers placed by `SCCDevectorTransformation`. :param horizontal: `Dimension` object describing the variable conventions used in code to define the horizontal data dimension and iteration space. :type horizontal: `Dimension`.

`SCCVecRevectorTransformation`(horizontal) | A transformation to wrap thread-parallel IR sections within a horizontal loop.

SCCRevectorTransformation

  alias of `SCCVecRevectorTransformation`

class SCCVecRevectorTransformation(horizontal)

  Bases: `BaseRevectorTransformation`

  A transformation to wrap thread-parallel IR sections within a horizontal loop. This transformation relies on markers placed by `SCCDevectorTransformation`.

  Parameters:

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

  transform_subroutine(routine, **kwargs)

    Wrap vector-parallel sections in vector `Loop` objects.

    This wraps all thread-parallel sections within “kernel” routines or within the parallel loops in “driver” routines.

    The markers placed by `SCCDevectorTransformation` are removed

    Parameters:

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

      - role (str) – Must be either `"kernel"` or `"driver"`

      - targets (tuple or str) – Tuple of target routine names for determining “driver” loops

class SCCSeqRevectorTransformation(horizontal)

  Bases: `BaseRevectorTransformation`

  A transformation to wrap thread-parallel IR sections within a horizontal loop in a way that the horizontal loop is hoisted/moved to the driver level while the horizontal/loop index is passed as an argument. This transformation relies on markers placed by `SCCDevectorTransformation`. :param horizontal: `Dimension` object describing the variable conventions used in code

  > to define the horizontal data dimension and iteration space.

  process_ignored_items = True
  remove_vector_sections(section)

    Remove all thread-parallel `Section` objects within a given code section :param routine: Subroutine to apply this transformation to. :type routine: `Subroutine` :param section: Code section in which to replace vector-parallel

    > `Section` objects.

  mark_vector_reductions(routine, section)

    Vector reductions are not applicable to sequential routines so we raise an axception here.

  transform_subroutine(routine, **kwargs)

    Wrap vector-parallel sections in vector `Loop` objects. This wraps all thread-parallel sections within “kernel” routines or within the parallel loops in “driver” routines. The markers placed by `SCCDevectorTransformation` are removed :param routine: Subroutine to apply this transformation to. :type routine: `Subroutine` :param role: Must be either `"kernel"` or `"driver"` :type role: str :param targets: Tuple of target routine names for determining “driver” loops :type targets: tuple or str

wrap_vector_section(section, routine, bounds, index, insert_pragma=True)

  Wrap a section of nodes in a vector-level loop across the horizontal.

  Parameters:

    - section (tuple of `Node`) – A section of nodes to be wrapped in a vector-level loop

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

    - horizontal (`Dimension`) – The dimension specifying the horizontal vector dimension

    - insert_pragma (bool, optional) – Adds a `!$loki vector` pragma around the created loop

class RevectorSectionTransformer(routine, horizontal, *args, insert_pragma=True, **kwargs)

  Bases: `Transformer`

  `Transformer` that replaces `Section` objects labelled with `"vector_section"` with vector-level loops across the horizontal.

  Parameters:

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

    - horizontal (`Dimension`) – The dimension specifying the horizontal vector dimension

    - insert_pragma (bool, optional) – Adds a `!$loki vector` pragma around the created loop

  visit_Section(s, **kwargs)