psyclone.psyir.transformations.omp_critical_trans#

This module contains the implementation of the OpenMP Critical transformation.

Classes#

class psyclone.psyir.transformations.omp_critical_trans.OMPCriticalTrans[source]#

Adds an OpenMP critical directive around a region of code.

Note

This transformation does not currently do any validation about critical regions, and their correct usage is up to the user. In the future, we may try to improve this (after issues like #3238 are resolved).

Inheritance

Inheritance diagram of OMPCriticalTrans
apply(nodes, **kwargs)[source]#

Surrounds the provided nodes in a OMPCriticalDirective.

Parameters:
  • nodes (Union[Node, Schedule, List[Node]]) – the PSyIR node or nodes to enclose in the OpenMP critical region.

  • node_type_check (bool) – whether or not the type of the nodes enclosed in the region should be tested to avoid using unsupported nodes inside a region.

Return type:

None