loki.transformations.single_column.annotate
Classes
|
A set of utilities to insert offload directives. |
- class SCCAnnotateTransformation(directive, block_dim)
Bases:
Transformation
A set of utilities to insert offload directives. This includes both
Loop
andSubroutine
level annotations.- Parameters:
block_dim (
Dimension
) – OptionalDimension
object to define the blocking dimension to use for hoisted column arrays if hoisting is enabled.directive (string or None) – Directives flavour to use for parallelism annotations; either
'openacc'
orNone
.
- annotate_vector_loops(routine)
Insert
!$acc 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.
- annotate_sequential_loops(routine)
Insert
!$acc loop seq
annotations for all loops previously marked with!$loki loop seq
.- Parameters:
routine (
Subroutine
) – The subroutine in which to annotate sequential loops
- annotate_kernel_routine(routine)
Insert
!$acc routine seq/vector
directives and wrap subroutine body in!$acc data present
directives.- Parameters:
routine (
Subroutine
) – The subroutine to which annotations will be added
- transform_subroutine(routine, **kwargs)
Apply OpenACC annotations according to
!$loki
placeholder directives.This routine effectively converts neutral
!$loki loop
and!$loki routine
annotations into the corresponding!$acc
equivalent directives. It also adds!$acc data present
clauses around kernel routine bodies and addsprivate
clauses to loop annotations.If the
directive
provided is notopenacc
, no change is applied. In the future, we aim to supportOpenMP
equivalent directives here.- 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 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