psyclone.domain.common.psylayer

A package module for psyclone.domain.common.psylayer

Submodules

Classes

  • PSyLoop: Node representing a psylayer loop within the PSyIR. It extends the PSyIR

class psyclone.domain.common.psylayer.PSyLoop(valid_loop_types=None, **kwargs)

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.

Parameters:
  • valid_loop_types (List[str]) – a list of loop types that are specific to a particular API.

  • kwargs (unwrapped dict.) – additional keyword arguments provided to the PSyIR node.

Inheritance

Inheritance diagram of PSyLoop
args_filter(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.

Return type:

List[psyclone.psyGen.Argument]

property dag_name
Returns:

the dag name to use for this loop.

Return type:

str

property field
Returns:

the field associated to this loop.

Return type:

psyclone.psyGen.Argument

property field_name
Returns:

the field name associated to this loop.

Return type:

str

property field_space
Returns:

the field_space associated this loop.

Return type:

str

gen_mark_halos_clean_dirty(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.

Parameters:

parent (psyclone.f2pygen.BaseGen) – the node in the f2pygen AST to which to add content.

has_inc_arg()
Returns:

True if any of the Kernels called within this loop have an argument with INC access, False otherwise.

Return type:

bool

property iteration_space
Returns:

the iteration_space of this loop.

Return type:

str

property kernel
Returns:

the kernel object associated with this PSyLoop (if any).

Return type:

Optional[psyclone.psyGen.Kern]

property loop_type
Returns:

the (domain-specific) type of this loop.

Return type:

str

node_str(colour=True)

Returns the name of this node with (optional) control codes to generate coloured output in a terminal that supports it.

Parameters:

colour (bool) – whether or not to include colour control codes.

Returns:

description of this node, possibly coloured.

Return type:

str

unique_fields_with_halo_reads()
Returns:

fields in this loop that require at least some of their halo to be clean to work correctly.

Return type:

List[psyclone.psyGen.Argument]

unique_modified_args(arg_type)

Return all unique arguments of the given type from kernels inside this loop that are modified.

Parameters:

arg_type (str) – 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.

Return type:

List[psyclone.psyGen.DynKernelArgument]

property valid_loop_types
Returns:

the (domain-specific) loop types allowed by this instance.

Return type:

list of str