loki.transform.transform_loop
Collection of utility routines that provide loop transformations.
Functions
|
Eliminate a variable from the polyhedron. |
|
Generate loop bounds according to a changed iteration order. |
|
Helper routine to extract loop variables, ranges and bodies of list of loops. |
|
Helper routine to extract all loops in a loop nest. |
|
Search for |
|
Search for loops annotated with the loki loop-fusion pragma and attempt to fuse them into a single loop. |
|
Search for loops annotated with the loki loop-interchange pragma and attempt to reorder them. |
|
Convert loop ranges given in the pragma parameters from string to a tuple of LoopRange objects. |
Classes
|
Bespoke transformer that splits loops or loop nests at |
- loop_interchange(routine, project_bounds=False)
Search for loops annotated with the loki loop-interchange pragma and attempt to reorder them.
Note that this effectively just exchanges variable and bounds for each of the loops, leaving the rest (including bodies, pragmas, etc.) intact.
- loop_fusion(routine)
Search for loops annotated with the loki loop-fusion pragma and attempt to fuse them into a single loop.
- loop_fission(routine, promote=True, warn_loop_carries=True)
Search for
!$loki loop-fission
pragmas in loops and split them.The expected pragma syntax is
!$loki loop-fission [collapse(n)] [promote(var-name, var-name, ...)]
wherecollapse(n)
gives the loop nest depth to be split (defaults to n=1) andpromote
optionally specifies a list of variable names to be promoted by the split iteration space dimensions.- Parameters:
routine (
Subroutine
) – The subroutine in which loop fission is to be applied.promote (bool, optional) – Try to automatically detect read-after-write across fission points and promote corresponding variables. Note that this does not affect promotion of variables listed directly in the pragma’s
promote
option.warn_loop_carries (bool, optional) – Try to automatically detect loop-carried dependencies and warn when the fission point sits after the initial read and before the final write.