Reference Guide  2.5.0
psyclone.psyir.nodes.dynamic_omp_task_directive.DynamicOMPTaskDirective Class Reference
Inheritance diagram for psyclone.psyir.nodes.dynamic_omp_task_directive.DynamicOMPTaskDirective:
Collaboration diagram for psyclone.psyir.nodes.dynamic_omp_task_directive.DynamicOMPTaskDirective:

Public Member Functions

def __init__ (self, children=None, parent=None)
 
def lower_to_language_level (self)
 
- Public Member Functions inherited from psyclone.psyir.nodes.omp_task_directive.OMPTaskDirective
def __init__ (self, children=None, parent=None, clauses=None)
 
def input_depend_clause (self)
 
def output_depend_clause (self)
 
def begin_string (self)
 
def end_string (self)
 
def validate_global_constraints (self)
 
- Public Member Functions inherited from psyclone.psyir.nodes.directive.RegionDirective
def dir_body (self)
 
def clauses (self)
 
def gen_post_region_code (self, parent)
 
- Public Member Functions inherited from psyclone.psyir.nodes.directive.Directive
def create_data_movement_deep_copy_refs (self)
 
- Public Member Functions inherited from psyclone.psyir.nodes.node.Node
def __init__ (self, ast=None, children=None, parent=None, annotations=None)
 
def __eq__ (self, other)
 
def coloured_name (self, colour=True)
 
def node_str (self, colour=True)
 
def __str__ (self)
 
def ast (self)
 
def ast_end (self)
 
def ast (self, ast)
 
def ast_end (self, ast_end)
 
def annotations (self)
 
def dag (self, file_name='dag', file_format='svg')
 
def dag_gen (self, graph)
 
def dag_name (self)
 
def args (self)
 
def backward_dependence (self)
 
def forward_dependence (self)
 
def is_valid_location (self, new_node, position="before")
 
def depth (self)
 
def view (self, depth=0, colour=True, indent=" ", _index=None)
 
def addchild (self, child, index=None)
 
def children (self)
 
def children (self, my_children)
 
def parent (self)
 
def siblings (self)
 
def has_constructor_parent (self)
 
def position (self)
 
def abs_position (self)
 
def root (self)
 
def sameParent (self, node_2)
 
def walk (self, my_type, stop_type=None, depth=None)
 
def get_sibling_lists (self, my_type, stop_type=None)
 
def ancestor (self, my_type, excluding=None, include_self=False, limit=None, shared_with=None)
 
def kernels (self)
 
def following (self, routine=True)
 
def preceding (self, reverse=False, routine=True)
 
def immediately_precedes (self, node_2)
 
def immediately_follows (self, node_1)
 
def coded_kernels (self)
 
def loops (self)
 
def reductions (self, reprod=None)
 
def is_openmp_parallel (self)
 
def reference_accesses (self, var_accesses)
 
def scope (self)
 
def replace_with (self, node, keep_name_in_context=True)
 
def pop_all_children (self)
 
def detach (self)
 
def copy (self)
 
def debug_string (self)
 
def origin_string (self)
 
def update_signal (self)
 
def path_from (self, ancestor)
 
- Public Member Functions inherited from psyclone.psyir.nodes.commentable_mixin.CommentableMixin
def preceding_comment (self)
 
def preceding_comment (self, comment)
 
def inline_comment (self)
 
def inline_comment (self, comment)
 

Additional Inherited Members

- Public Attributes inherited from psyclone.psyir.nodes.node.Node
 position
 
- Static Public Attributes inherited from psyclone.psyir.nodes.node.Node
int START_DEPTH = 0
 
int START_POSITION = 0
 
 valid_annotations = tuple()
 

Detailed Description

Class representing an OpenMP TASK directive in the PSyIR.

:param list children: list of Nodes that are children of this Node.
:param parent: the Node in the AST that has this directive as a child
:type parent: :py:class:`psyclone.psyir.nodes.Node`

Definition at line 78 of file dynamic_omp_task_directive.py.

Member Function Documentation

◆ lower_to_language_level()

def psyclone.psyir.nodes.dynamic_omp_task_directive.DynamicOMPTaskDirective.lower_to_language_level (   self)
Lowers the structure of the PSyIR tree inside the Directive
to generate the Clauses that are required for this Directive.

Reimplemented from psyclone.psyir.nodes.node.Node.

Definition at line 2105 of file dynamic_omp_task_directive.py.

2105  def lower_to_language_level(self):
2106  """
2107  Lowers the structure of the PSyIR tree inside the Directive
2108  to generate the Clauses that are required for this Directive.
2109  """
2110  # pylint: disable=import-outside-toplevel
2111  from psyclone.psyGen import Kern
2112 
2113  # If we find a Kern or Call child then we abort.
2114  # Note that if the transformation is used it will have already
2115  # attempted to do this inlining.
2116  if self.walk(Kern):
2117  raise GenerationError(
2118  "Attempted to lower to OMPTaskDirective "
2119  "node, but the node contains a Kern "
2120  "which must be inlined first."
2121  )
2122  # We allow a subset of IntrinsicCall nodes
2123  for child in self.walk(Call):
2124  if not isinstance(child, IntrinsicCall):
2125  raise GenerationError(
2126  "Attempted to lower to OMPTaskDirective "
2127  "node, but the node contains a Call "
2128  "which must be inlined first."
2129  )
2130  # Otherwise we have an IntrinsicCall
2131  if child.intrinsic not in self._allowed_intrinsics:
2132  raise GenerationError(
2133  f"Attempted to lower to OMPTaskDirective "
2134  f"node, but the node contains a "
2135  f"'{child.debug_string()}' intrinsic call, which "
2136  f"is not supported."
2137  )
2138 
2139  # Create the clauses
2140  (
2141  private_clause,
2142  firstprivate_clause,
2143  shared_clause,
2144  in_clause,
2145  out_clause,
2146  ) = self._compute_clauses()
2147 
2148  # Replace the children with the new children
2149  old_children = self.pop_all_children()
2150  self.addchild(old_children[0])
2151  self.addchild(private_clause)
2152  self.addchild(firstprivate_clause)
2153  self.addchild(shared_clause)
2154  self.addchild(in_clause)
2155  self.addchild(out_clause)
2156  super().lower_to_language_level()
2157 
2158  # Replace this node with an OMPTaskDirective
2159  childs = self.dir_body.pop_all_children()
2160  clauses = self.clauses[:]
2161  self.pop_all_children()
2162  replacement = OMPTaskDirective(children=childs, clauses=clauses)
2163  self.replace_with(replacement)

References psyclone.psyir.nodes.dynamic_omp_task_directive.DynamicOMPTaskDirective._allowed_intrinsics, psyclone.psyir.nodes.dynamic_omp_task_directive.DynamicOMPTaskDirective._compute_clauses(), psyclone.psyir.nodes.node.Node.addchild(), psyclone.psyir.nodes.directive.Directive.clauses(), psyclone.psyir.nodes.directive.RegionDirective.clauses(), psyclone.psyir.nodes.directive.StandaloneDirective.clauses(), psyclone.psyir.nodes.directive.RegionDirective.dir_body(), psyclone.psyir.nodes.node.Node.pop_all_children(), psyclone.psyir.nodes.node.Node.replace_with(), and psyclone.psyir.nodes.node.Node.walk().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: