Reference Guide
2.5.0
|
Public Member Functions | |
def | __init__ (self, valid_loop_types=None, **kwargs) |
def | __eq__ (self, other) |
def | dag_name (self) |
def | valid_loop_types (self) |
def | loop_type (self) |
def | loop_type (self, value) |
def | node_str (self, colour=True) |
def | field_space (self) |
def | field_space (self, my_field_space) |
def | field_name (self) |
def | field (self) |
def | field_name (self, my_field_name) |
def | iteration_space (self) |
def | iteration_space (self, it_space) |
def | kernel (self) |
def | kernel (self, kern) |
def | __str__ (self) |
def | has_inc_arg (self) |
def | unique_modified_args (self, arg_type) |
def | unique_fields_with_halo_reads (self) |
def | args_filter (self, arg_types=None, arg_accesses=None, unique=False) |
def | gen_mark_halos_clean_dirty (self, parent) |
Public Attributes | |
loop_type | |
field | |
field_name | |
field_space | |
iteration_space | |
kernel | |
Node representing a psylayer loop within the PSyIR. It extends the PSyIR loop construct with information about the domain-specific iteration space that the loop is traversing and utility methods to interact with other psylayer nodes. :param List[str] valid_loop_types: a list of loop types that are specific \ to a particular API. :param kwargs: additional keyword arguments provided to the PSyIR node. :type kwargs: unwrapped dict.
Definition at line 46 of file psyloop.py.
def psyclone.domain.common.psylayer.psyloop.PSyLoop.__eq__ | ( | self, | |
other | |||
) |
Checks whether two nodes are equal. Two PSyLoop nodes are equal if they have equal loop_type, field, field_name, field_space iteraction_space and kernel. :param object other: the object to check equality to. :returns: whether other is equal to self. :rtype: bool
Definition at line 82 of file psyloop.py.
References psyclone.domain.common.psylayer.psyloop.PSyLoop._iterates_over, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata._iterates_over, psyclone.parse.kernel.KernelType._iterates_over, psyclone.psyGen.Kern._iterates_over, psyclone.domain.common.psylayer.psyloop.PSyLoop.field, psyclone.psyGen.HaloExchange.field(), psyclone.domain.lfric.arg_ordering.ArgOrdering.field(), psyclone.domain.lfric.kern_call_arg_list.KernCallArgList.field(), psyclone.domain.lfric.kern_call_invoke_arg_list.KernCallInvokeArgList.field(), psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.field(), psyclone.domain.lfric.kernel_interface.KernelInterface.field(), psyclone.domain.common.psylayer.psyloop.PSyLoop.field_name, psyclone.gocean1p0.GOLoop.field_name, psyclone.domain.common.psylayer.psyloop.PSyLoop.field_space, psyclone.gocean1p0.GOLoop.field_space, psyclone.domain.common.psylayer.psyloop.PSyLoop.iteration_space, psyclone.gocean1p0.GOLoop.iteration_space, psyclone.domain.common.psylayer.psyloop.PSyLoop.kernel, psyclone.domain.common.psylayer.psyloop.PSyLoop.loop_type, psyclone.domain.lfric.lfric_loop.LFRicLoop.loop_type, psyclone.gocean1p0.GOLoop.loop_type, and psyclone.psyir.nodes.loop.Loop.loop_type().
def psyclone.domain.common.psylayer.psyloop.PSyLoop.args_filter | ( | self, | |
arg_types = None , |
|||
arg_accesses = None , |
|||
unique = False |
|||
) |
:returns: all arguments of type arg_types and arg_accesses. If these \ are not set then return all arguments. If unique is set to \ True then only return uniquely named arguments. :rtype: List[:py:class:`psyclone.psyGen.Argument`]
Definition at line 309 of file psyloop.py.
References psyclone.psyir.nodes.node.Node.kernels().
def psyclone.domain.common.psylayer.psyloop.PSyLoop.dag_name | ( | self | ) |
:returns: the dag name to use for this loop. :rtype: str
Definition at line 106 of file psyloop.py.
References psyclone.psyir.nodes.node.Node._find_position(), psyclone.psyir.nodes.node.Node.ancestor(), psyclone.domain.common.psylayer.psyloop.PSyLoop.loop_type, psyclone.domain.lfric.lfric_loop.LFRicLoop.loop_type, psyclone.gocean1p0.GOLoop.loop_type, and psyclone.psyir.nodes.loop.Loop.loop_type().
def psyclone.domain.common.psylayer.psyloop.PSyLoop.field | ( | self | ) |
:returns: the field associated to this loop. :rtype: :py:class:`psyclone.psyGen.Argument`
Definition at line 196 of file psyloop.py.
References psyclone.domain.common.psylayer.psyloop.PSyLoop._field, psyclone.domain.lfric.arg_index_to_metadata_index.ArgIndexToMetadataIndex._field(), psyclone.domain.lfric.lfric_loop.LFRicLoop._field, psyclone.domain.lfric.metadata_to_arguments_rules.MetadataToArgumentsRules._field(), and psyclone.psyGen.HaloExchange._field.
def psyclone.domain.common.psylayer.psyloop.PSyLoop.field_name | ( | self | ) |
:returns: the field name associated to this loop. :rtype: str
Definition at line 188 of file psyloop.py.
References psyclone.domain.common.psylayer.psyloop.PSyLoop._field_name, and psyclone.domain.lfric.lfric_loop.LFRicLoop._field_name.
def psyclone.domain.common.psylayer.psyloop.PSyLoop.field_name | ( | self, | |
my_field_name | |||
) |
Set a new field_name for the field associated to this loop. :param str my_field_name: the new field name.
Definition at line 204 of file psyloop.py.
References psyclone.domain.common.psylayer.psyloop.PSyLoop._field_name, and psyclone.domain.lfric.lfric_loop.LFRicLoop._field_name.
def psyclone.domain.common.psylayer.psyloop.PSyLoop.field_space | ( | self | ) |
:returns: the field_space associated this loop. :rtype: str
Reimplemented in psyclone.gocean1p0.GOLoop.
Definition at line 171 of file psyloop.py.
References psyclone.domain.common.psylayer.psyloop.PSyLoop._field_space, psyclone.domain.lfric.lfric_loop.LFRicLoop._field_space, and psyclone.gocean1p0.GOLoop._field_space.
def psyclone.domain.common.psylayer.psyloop.PSyLoop.field_space | ( | self, | |
my_field_space | |||
) |
Set a new field_space for this loop. :param my_field_space: the new field_space value. :rtype my_field_space: str
Reimplemented in psyclone.gocean1p0.GOLoop.
Definition at line 179 of file psyloop.py.
References psyclone.domain.common.psylayer.psyloop.PSyLoop._field_space, psyclone.domain.lfric.lfric_loop.LFRicLoop._field_space, and psyclone.gocean1p0.GOLoop._field_space.
def psyclone.domain.common.psylayer.psyloop.PSyLoop.gen_mark_halos_clean_dirty | ( | self, | |
parent | |||
) |
Generates the necessary code to mark halo regions as clean or dirty following execution of this loop. This default implementation does nothing. TODO #1648 - this method should be removed when the corresponding one in LFRicLoop is removed. :param parent: the node in the f2pygen AST to which to add content. :type parent: :py:class:`psyclone.f2pygen.BaseGen`
Reimplemented in psyclone.domain.lfric.lfric_loop.LFRicLoop.
Definition at line 333 of file psyloop.py.
def psyclone.domain.common.psylayer.psyloop.PSyLoop.has_inc_arg | ( | self | ) |
:returns: True if any of the Kernels called within this loop have an \ argument with INC access, False otherwise. :rtype: bool
Definition at line 258 of file psyloop.py.
References psyclone.nemo.NemoInvokeSchedule.coded_kernels(), and psyclone.psyir.nodes.node.Node.coded_kernels().
def psyclone.domain.common.psylayer.psyloop.PSyLoop.iteration_space | ( | self | ) |
:returns: the iteration_space of this loop. :rtype: str
Reimplemented in psyclone.gocean1p0.GOLoop.
Definition at line 212 of file psyloop.py.
References psyclone.domain.common.psylayer.psyloop.PSyLoop._iteration_space, psyclone.domain.lfric.lfric_loop.LFRicLoop._iteration_space, and psyclone.gocean1p0.GOLoop._iteration_space.
def psyclone.domain.common.psylayer.psyloop.PSyLoop.iteration_space | ( | self, | |
it_space | |||
) |
Set a new iteration space for this loop. :param str it_space: the new iteration_space fore this loop.
Reimplemented in psyclone.gocean1p0.GOLoop.
Definition at line 220 of file psyloop.py.
References psyclone.domain.common.psylayer.psyloop.PSyLoop._iteration_space, psyclone.domain.lfric.lfric_loop.LFRicLoop._iteration_space, and psyclone.gocean1p0.GOLoop._iteration_space.
def psyclone.domain.common.psylayer.psyloop.PSyLoop.kernel | ( | self | ) |
:returns: the kernel object associated with this PSyLoop (if any). :rtype: Optional[:py:class:`psyclone.psyGen.Kern`]
Definition at line 228 of file psyloop.py.
References psyclone.domain.common.psylayer.psyloop.PSyLoop._kern, psyclone.domain.lfric.arg_ordering.ArgOrdering._kern, and psyclone.domain.lfric.lfric_loop.LFRicLoop._kern.
def psyclone.domain.common.psylayer.psyloop.PSyLoop.kernel | ( | self, | |
kern | |||
) |
Setter for kernel object associated with this PSyLoop. :param kern: a kernel object. :type kern: :py:class:`psyclone.psyGen.Kern`
Definition at line 236 of file psyloop.py.
References psyclone.psyir.symbols.symbol.Symbol.__class__, psyclone.f2pygen.BaseGen._children, psyclone.psyir.nodes.node.Node._children, psyclone.psyir.nodes.omp_directives.OMPParallelDirective._children, psyclone.domain.common.psylayer.psyloop.PSyLoop._kern, psyclone.domain.lfric.arg_ordering.ArgOrdering._kern, psyclone.domain.lfric.lfric_loop.LFRicLoop._kern, psyclone.domain.common.psylayer.psyloop.PSyLoop._loop_type, psyclone.domain.lfric.lfric_loop.LFRicLoop._loop_type, psyclone.gocean1p0.GOLoop._loop_type, psyclone.domain.common.psylayer.psyloop.PSyLoop.loop_type, psyclone.domain.lfric.lfric_loop.LFRicLoop.loop_type, psyclone.gocean1p0.GOLoop.loop_type, psyclone.psyir.nodes.loop.Loop.loop_type(), psyclone.domain.lfric.lfric_loop.LFRicLoop.variable, psyclone.gocean1p0.GOLoop.variable, and psyclone.psyir.nodes.loop.Loop.variable.
def psyclone.domain.common.psylayer.psyloop.PSyLoop.loop_type | ( | self | ) |
:returns: the (domain-specific) type of this loop. :rtype: str
Definition at line 128 of file psyloop.py.
References psyclone.domain.common.psylayer.psyloop.PSyLoop._loop_type, psyclone.domain.lfric.lfric_loop.LFRicLoop._loop_type, and psyclone.gocean1p0.GOLoop._loop_type.
def psyclone.domain.common.psylayer.psyloop.PSyLoop.loop_type | ( | self, | |
value | |||
) |
Set the type of this Loop. :param str value: the type of this loop. :raises TypeError: if the specified value is not a recognised \ loop type.
Definition at line 136 of file psyloop.py.
References psyclone.domain.common.psylayer.psyloop.PSyLoop._loop_type, psyclone.domain.lfric.lfric_loop.LFRicLoop._loop_type, psyclone.gocean1p0.GOLoop._loop_type, and psyclone.domain.common.psylayer.psyloop.PSyLoop._valid_loop_types.
def psyclone.domain.common.psylayer.psyloop.PSyLoop.node_str | ( | self, | |
colour = True |
|||
) |
Returns the name of this node with (optional) control codes to generate coloured output in a terminal that supports it. :param bool colour: whether or not to include colour control codes. :returns: description of this node, possibly coloured. :rtype: str
Reimplemented in psyclone.domain.lfric.lfric_loop.LFRicLoop.
Definition at line 151 of file psyloop.py.
def psyclone.domain.common.psylayer.psyloop.PSyLoop.unique_fields_with_halo_reads | ( | self | ) |
:returns: fields in this loop that require at least some of their \ halo to be clean to work correctly. :rtype: List[:py:class:`psyclone.psyGen.Argument`]
Definition at line 291 of file psyloop.py.
References psyclone.domain.common.psylayer.psyloop.PSyLoop._halo_read_access(), psyclone.domain.lfric.lfric_loop.LFRicLoop._halo_read_access(), psyclone.gocean1p0.GOLoop._halo_read_access(), and psyclone.psyir.nodes.node.Node.kernels().
def psyclone.domain.common.psylayer.psyloop.PSyLoop.unique_modified_args | ( | self, | |
arg_type | |||
) |
Return all unique arguments of the given type from kernels inside this loop that are modified. :param str arg_type: the type of kernel argument (e.g. field, \ operator) to search for. :returns: all unique arguments of the given type from kernels inside \ this loop that are modified. :rtype: List[:py:class:`psyclone.psyGen.DynKernelArgument`]
Definition at line 270 of file psyloop.py.
References psyclone.psyir.nodes.node.Node.kernels().
def psyclone.domain.common.psylayer.psyloop.PSyLoop.valid_loop_types | ( | self | ) |
:returns: the (domain-specific) loop types allowed by this instance. :rtype: list of str
Definition at line 120 of file psyloop.py.
References psyclone.domain.common.psylayer.psyloop.PSyLoop._valid_loop_types.