transformations.single_column_coalesced_vector
Classes
|
A set of utilities to determine which local arrays can be safely demoted in a |
|
A set of utilities that can be used to strip vector loops from a |
|
A transformation to wrap thread-parallel IR sections within a horizontal loop. |
- class SCCDevectorTransformation(horizontal)
Bases:
Transformation
A set of utilities that can be used to strip vector loops from a
Subroutine
and determine the regions of the IR to be placed within thread-parallel loop directives.- Parameters:
horizontal (
Dimension
) –Dimension
object describing the variable conventions used in code to define the horizontal data dimension and iteration space.
- classmethod kernel_remove_vector_loops(routine, horizontal)
Remove all vector loops over the specified dimension.
- Parameters:
routine (
Subroutine
) – The subroutine in the vector loops should be removed.horizontal (
Dimension
) – The dimension specifying the horizontal vector dimension
- classmethod extract_vector_sections(section, horizontal)
Extract a contiguous sections of nodes that contains vector-level computations and are not interrupted by recursive subroutine calls or nested control-flow structures.
- transform_subroutine(routine, **kwargs)
Apply SCCDevector 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 SCCDevector utilities to a “kernel”. This consists simply of stripping vector loops and determing which sections of the IR can be placed within thread-parallel loops.
- Parameters:
routine (
Subroutine
) – Subroutine to apply this transformation to.
- class SCCRevectorTransformation(horizontal)
Bases:
Transformation
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.
- classmethod wrap_vector_section(section, routine, horizontal)
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 looproutine (
Subroutine
) – The subroutine in the vector loops should be removed.horizontal (
Dimension
) – The dimension specifying the horizontal vector dimension
- transform_subroutine(routine, **kwargs)
Apply SCCRevector 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 SCCRevector utilities to a “kernel” and wraps all thread-parallel sections within a horizontal loop. The markers placed by
SCCDevectorTransformation
are removed.- Parameters:
routine (
Subroutine
) – Subroutine to apply this transformation to.
- class SCCDemoteTransformation(horizontal, demote_local_arrays=True)
Bases:
Transformation
A set of utilities to determine which local arrays can be safely demoted in a
Subroutine
as part of a transformation pass.- Parameters:
horizontal (
Dimension
) –Dimension
object describing the variable conventions used in code to define the horizontal data dimension and iteration space.
- classmethod kernel_get_locals_to_demote(routine, sections, horizontal)
- transform_subroutine(routine, **kwargs)
Apply SCCDemote 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, demote_locals=True)
Applies the SCCDemote utilities to a “kernel” and demotes all suitable local arrays.
- Parameters:
routine (
Subroutine
) – Subroutine to apply this transformation to.