Reference Guide  2.5.0
psyclone.psyir.nodes.omp_directives.OMPDeclareTargetDirective Class Reference
Inheritance diagram for psyclone.psyir.nodes.omp_directives.OMPDeclareTargetDirective:
Collaboration diagram for psyclone.psyir.nodes.omp_directives.OMPDeclareTargetDirective:

Public Member Functions

def gen_code (self, parent)
 
def begin_string (self)
 
def validate_global_constraints (self)
 
- Public Member Functions inherited from psyclone.psyir.nodes.directive.StandaloneDirective
def clauses (self)
 
- 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 lower_to_language_level (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 Declare Target directive in the PSyIR.

Definition at line 140 of file omp_directives.py.

Member Function Documentation

◆ begin_string()

def psyclone.psyir.nodes.omp_directives.OMPDeclareTargetDirective.begin_string (   self)
Returns the beginning statement of this directive, i.e.
"omp routine". The visitor is responsible for adding the
correct directive beginning (e.g. "!$").

:returns: the opening statement of this directive.
:rtype: str

Definition at line 159 of file omp_directives.py.

159  def begin_string(self):
160  '''Returns the beginning statement of this directive, i.e.
161  "omp routine". The visitor is responsible for adding the
162  correct directive beginning (e.g. "!$").
163 
164  :returns: the opening statement of this directive.
165  :rtype: str
166 
167  '''
168  return "omp declare target"
169 
Here is the caller graph for this function:

◆ gen_code()

def psyclone.psyir.nodes.omp_directives.OMPDeclareTargetDirective.gen_code (   self,
  parent 
)
Generate the fortran OMP Declare Target Directive and any
associated code.

:param parent: the parent Node in the Schedule to which to add our \
               content.
:type parent: sub-class of :py:class:`psyclone.f2pygen.BaseGen`

Definition at line 145 of file omp_directives.py.

145  def gen_code(self, parent):
146  '''Generate the fortran OMP Declare Target Directive and any
147  associated code.
148 
149  :param parent: the parent Node in the Schedule to which to add our \
150  content.
151  :type parent: sub-class of :py:class:`psyclone.f2pygen.BaseGen`
152  '''
153  # Check the constraints are correct
154  self.validate_global_constraints()
155 
156  # Generate the code for this Directive
157  parent.add(DirectiveGen(parent, "omp", "begin", "declare", "target"))
158 

References psyclone.domain.lfric.lfric_kern.LFRicKern.validate_global_constraints(), psyclone.psyir.nodes.acc_directives.ACCRegionDirective.validate_global_constraints(), psyclone.psyir.nodes.acc_directives.ACCLoopDirective.validate_global_constraints(), psyclone.psyir.nodes.acc_directives.ACCAtomicDirective.validate_global_constraints(), psyclone.psyir.nodes.node.Node.validate_global_constraints(), psyclone.psyir.nodes.omp_directives.OMPDeclareTargetDirective.validate_global_constraints(), psyclone.psyir.nodes.omp_directives.OMPTaskwaitDirective.validate_global_constraints(), psyclone.psyir.nodes.omp_directives.OMPSerialDirective.validate_global_constraints(), psyclone.psyir.nodes.omp_directives.OMPParallelDirective.validate_global_constraints(), psyclone.psyir.nodes.omp_directives.OMPTaskloopDirective.validate_global_constraints(), psyclone.psyir.nodes.omp_directives.OMPDoDirective.validate_global_constraints(), psyclone.psyir.nodes.omp_directives.OMPParallelDoDirective.validate_global_constraints(), psyclone.psyir.nodes.omp_directives.OMPLoopDirective.validate_global_constraints(), psyclone.psyir.nodes.omp_directives.OMPAtomicDirective.validate_global_constraints(), psyclone.psyir.nodes.omp_directives.OMPSimdDirective.validate_global_constraints(), and psyclone.psyir.nodes.omp_task_directive.OMPTaskDirective.validate_global_constraints().

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

◆ validate_global_constraints()

def psyclone.psyir.nodes.omp_directives.OMPDeclareTargetDirective.validate_global_constraints (   self)
Perform validation checks that can only be done at code-generation
time.

:raises GenerationError: if this directive is not the first statement \
    in a routine.

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

Definition at line 170 of file omp_directives.py.

170  def validate_global_constraints(self):
171  '''
172  Perform validation checks that can only be done at code-generation
173  time.
174 
175  :raises GenerationError: if this directive is not the first statement \
176  in a routine.
177 
178  '''
179  if self.parent and (not isinstance(self.parent, Routine) or
180  self.parent.children[0] is not self):
181  raise GenerationError(
182  f"A OMPDeclareTargetDirective must be the first child (index "
183  f"0) of a Routine but found one as child {self.position} of a "
184  f"{type(self.parent).__name__}.")
185 
186  super().validate_global_constraints()
187 
188 

References psyclone.f2pygen.BaseGen.parent(), and psyclone.psyir.nodes.node.Node.parent().

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: