loki.transformations.extract.outline
Functions
|
Apply a default ordering to variables based on their type, so that their use in declaration lists is unified. |
|
Convert regions annotated with |
|
Creates a new |
- outline_region(region, name, imports, intent_map=None)
Creates a new
Subroutine
object from a givenPragmaRegion
.- Parameters:
region (
PragmaRegion
) – The region that holds the body for which to create a subroutine.name (str) – Name of the new subroutine
imports (tuple of
Import
, optional) – List of imports to replicate in the new subroutineintent_map (dict, optional) – Mapping of instent strings to list of variables to override intents
- Returns:
The newly created call and respectice subroutine.
- Return type:
tuple of
CallStatement
andSubroutine
- outline_pragma_regions(routine)
Convert regions annotated with
!$loki outline
pragmas to subroutine calls.The pragma syntax for regions to convert to subroutines is
!$loki outline [name(...)] [in(...)] [out(...)] [inout(...)]
and!$loki end outline
.A new subroutine is created with the provided name (or an auto-generated default name derived from the current subroutine name) and the content of the pragma region as body.
Variables provided with the
in
,out
andinout
options are used as arguments in the routine with the corresponding intent, all other variables used in this region are assumed to be local variables.The pragma region in the original routine is replaced by a call to the new subroutine.
- Parameters:
routine (
Subroutine
) – The routine from which to extract marked pragma regions.- Returns:
the list of newly created subroutines.
- Return type:
list of
Subroutine