psyclone.psyir.transformations.omp_task_trans#

This module provides the OMPTaskTrans transformation.

Classes#

  • OMPTaskTrans: Apply an OpenMP Task Transformation to a Loop. The Loop must

class psyclone.psyir.transformations.omp_task_trans.OMPTaskTrans[source]#

Apply an OpenMP Task Transformation to a Loop. The Loop must be within an OpenMP Serial region (Single or Master) at codegen time. Once lowering begins, no more modifications to the tree should occur as the task directives do not recompute dependencies after lowering. In the future it may be possible to do this through an _update_node implementation.

Inheritance

Inheritance diagram of OMPTaskTrans
apply(node, options=None, **kwargs)[source]#

Apply the OMPTaskTrans to the specified node in a Schedule.

Can only be applied to a Loop.

The specified node is wrapped by directives during code generation like so:

!$OMP TASK
...
!$OMP END TASK

At code-generation time, this node must be within (i.e. a child of) an OpenMP Serial region (OpenMP Single or OpenMP Master)

Any kernels or Calls will be inlined into the region before the task transformation is applied.

Parameters:
  • node (psyclone.psyir.nodes.Loop) – the supplied node to which we will apply the OMPTaskTrans transformation

  • options (dictionary of string:values or None) – a dictionary with options for transformations and validation.

property name#
Returns:

the name of this transformation.

Return type:

str

validate(node, options=None, **kwargs)[source]#

Validity checks for input arguments.

Note that currently this implementation calls the apply methods of KernelModuleInlineTrans and FoldConditionalReturnExpressionsTrans. Although a copy of the provided node is used for this (so as to avoid any modifications to it in case the validation fails), this pattern indicates we should possibly re-write this transformation to require that those transformations have been applied first.

Parameters:
  • node (psyclone.psyir.nodes.Loop) – the Loop node to validate.

  • options (dict of string:values or None) – a dictionary with options for transformations.