Reference Guide  2.5.0
psyclone.psyir.nodes.acc_directives.ACCKernelsDirective Class Reference
Inheritance diagram for psyclone.psyir.nodes.acc_directives.ACCKernelsDirective:
Collaboration diagram for psyclone.psyir.nodes.acc_directives.ACCKernelsDirective:

Public Member Functions

def __init__ (self, children=None, parent=None, default_present=True)
 
def __eq__ (self, other)
 
def default_present (self)
 
def gen_code (self, parent)
 
def begin_string (self)
 
def end_string (self)
 
- Public Member Functions inherited from psyclone.psyir.nodes.acc_directives.ACCRegionDirective
def validate_global_constraints (self)
 
def signatures (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 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)
 

Public Attributes

 default_present
 
- Public Attributes inherited from psyclone.psyir.nodes.node.Node
 position
 

Additional Inherited Members

- 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 the !$ACC KERNELS directive in the PSyIR.

:param children: the PSyIR nodes to be enclosed in the Kernels region \
                 and which are therefore children of this node.
:type children: List[:py:class:`psyclone.psyir.nodes.Node`]
:param parent: the parent of this node in the PSyIR.
:type parent: sub-class of :py:class:`psyclone.psyir.nodes.Node`
:param bool default_present: whether or not to add the "default(present)" \
                             clause to the kernels directive.

Definition at line 602 of file acc_directives.py.

Member Function Documentation

◆ __eq__()

def psyclone.psyir.nodes.acc_directives.ACCKernelsDirective.__eq__ (   self,
  other 
)
Checks whether two nodes are equal. Two ACCKernelsDirective nodes are
equal if their default_present members are equal.

:param object other: the object to check equality to.

:returns: whether other is equal to self.
:rtype: bool

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

Definition at line 619 of file acc_directives.py.

619  def __eq__(self, other):
620  '''
621  Checks whether two nodes are equal. Two ACCKernelsDirective nodes are
622  equal if their default_present members are equal.
623 
624  :param object other: the object to check equality to.
625 
626  :returns: whether other is equal to self.
627  :rtype: bool
628  '''
629  is_eq = super().__eq__(other)
630  is_eq = is_eq and self.default_present == other.default_present
631 
632  return is_eq
633 

References psyclone.psyir.nodes.acc_directives.ACCParallelDirective.default_present, and psyclone.psyir.nodes.acc_directives.ACCKernelsDirective.default_present.

◆ begin_string()

def psyclone.psyir.nodes.acc_directives.ACCKernelsDirective.begin_string (   self)
Returns the beginning statement of this directive, i.e.
"acc kernels ...". The backend is responsible for adding the
correct directive beginning (e.g. "!$").

:returns: the beginning statement for this directive.
:rtype: str

Definition at line 666 of file acc_directives.py.

666  def begin_string(self):
667  '''Returns the beginning statement of this directive, i.e.
668  "acc kernels ...". The backend is responsible for adding the
669  correct directive beginning (e.g. "!$").
670 
671  :returns: the beginning statement for this directive.
672  :rtype: str
673 
674  '''
675  result = "acc kernels"
676  if self._default_present:
677  result += " default(present)"
678  return result
679 

References psyclone.psyir.nodes.acc_directives.ACCParallelDirective._default_present, psyclone.psyir.nodes.acc_directives.ACCKernelsDirective._default_present, and psyclone.transformations.ACCParallelTrans._default_present.

Here is the caller graph for this function:

◆ default_present()

def psyclone.psyir.nodes.acc_directives.ACCKernelsDirective.default_present (   self)
:returns: whether the "default(present)" clause is added to the \
          kernels directive.
:rtype: bool

Definition at line 635 of file acc_directives.py.

635  def default_present(self):
636  '''
637  :returns: whether the "default(present)" clause is added to the \
638  kernels directive.
639  :rtype: bool
640  '''
641  return self._default_present
642 

References psyclone.psyir.nodes.acc_directives.ACCParallelDirective._default_present, psyclone.psyir.nodes.acc_directives.ACCKernelsDirective._default_present, and psyclone.transformations.ACCParallelTrans._default_present.

Here is the caller graph for this function:

◆ end_string()

def psyclone.psyir.nodes.acc_directives.ACCKernelsDirective.end_string (   self)
Returns the ending statement for this directive. The backend is
responsible for adding the language-specific syntax that marks this
as a directive.

:returns: the closing statement for this directive.
:rtype: str

Definition at line 680 of file acc_directives.py.

680  def end_string(self):
681  '''
682  Returns the ending statement for this directive. The backend is
683  responsible for adding the language-specific syntax that marks this
684  as a directive.
685 
686  :returns: the closing statement for this directive.
687  :rtype: str
688 
689  '''
690  return "acc end kernels"
691 
692 
Here is the caller graph for this function:

◆ gen_code()

def psyclone.psyir.nodes.acc_directives.ACCKernelsDirective.gen_code (   self,
  parent 
)
Generate the f2pygen AST entries in the Schedule for this
OpenACC Kernels directive.

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

Definition at line 643 of file acc_directives.py.

643  def gen_code(self, parent):
644  '''
645  Generate the f2pygen AST entries in the Schedule for this
646  OpenACC Kernels directive.
647 
648  :param parent: the parent Node in the Schedule to which to add this \
649  content.
650  :type parent: sub-class of :py:class:`psyclone.f2pygen.BaseGen`
651 
652  '''
653  self.validate_global_constraints()
654 
655  # We re-use the 'begin_string' method but must skip the leading 'acc'
656  # that it includes.
657  parent.add(DirectiveGen(parent, "acc", "begin",
658  *self.begin_string().split()[1:]))
659  for child in self.children:
660  child.gen_code(parent)
661 
662  parent.add(DirectiveGen(parent, *self.end_string().split()))
663 
664  self.gen_post_region_code(parent)
665 

References psyclone.psyir.nodes.acc_directives.ACCRoutineDirective.begin_string(), psyclone.psyir.nodes.acc_directives.ACCEnterDataDirective.begin_string(), psyclone.psyir.nodes.acc_directives.ACCParallelDirective.begin_string(), psyclone.psyir.nodes.acc_directives.ACCKernelsDirective.begin_string(), psyclone.psyir.nodes.acc_directives.ACCDataDirective.begin_string(), psyclone.psyir.nodes.acc_directives.ACCUpdateDirective.begin_string(), psyclone.psyir.nodes.acc_directives.ACCAtomicDirective.begin_string(), psyclone.psyir.nodes.omp_directives.OMPDeclareTargetDirective.begin_string(), psyclone.psyir.nodes.omp_directives.OMPTaskwaitDirective.begin_string(), psyclone.psyir.nodes.omp_directives.OMPSingleDirective.begin_string(), psyclone.psyir.nodes.omp_directives.OMPMasterDirective.begin_string(), psyclone.psyir.nodes.omp_directives.OMPParallelDirective.begin_string(), psyclone.psyir.nodes.omp_directives.OMPTaskloopDirective.begin_string(), psyclone.psyir.nodes.omp_directives.OMPDoDirective.begin_string(), psyclone.psyir.nodes.omp_directives.OMPParallelDoDirective.begin_string(), psyclone.psyir.nodes.omp_directives.OMPTargetDirective.begin_string(), psyclone.psyir.nodes.omp_directives.OMPLoopDirective.begin_string(), psyclone.psyir.nodes.omp_directives.OMPAtomicDirective.begin_string(), psyclone.psyir.nodes.omp_directives.OMPSimdDirective.begin_string(), psyclone.psyir.nodes.omp_task_directive.OMPTaskDirective.begin_string(), psyclone.psyir.nodes.acc_directives.ACCLoopDirective.begin_string(), psyclone.f2pygen.BaseGen.children(), psyclone.psyGen.InlinedKern.children, psyclone.psyir.nodes.node.Node.children(), psyclone.psyir.nodes.acc_directives.ACCParallelDirective.end_string(), psyclone.psyir.nodes.acc_directives.ACCLoopDirective.end_string(), psyclone.psyir.nodes.acc_directives.ACCKernelsDirective.end_string(), psyclone.psyir.nodes.acc_directives.ACCDataDirective.end_string(), psyclone.psyir.nodes.acc_directives.ACCAtomicDirective.end_string(), psyclone.psyir.nodes.omp_directives.OMPSingleDirective.end_string(), psyclone.psyir.nodes.omp_directives.OMPMasterDirective.end_string(), psyclone.psyir.nodes.omp_directives.OMPParallelDirective.end_string(), psyclone.psyir.nodes.omp_directives.OMPTaskloopDirective.end_string(), psyclone.psyir.nodes.omp_directives.OMPDoDirective.end_string(), psyclone.psyir.nodes.omp_directives.OMPParallelDoDirective.end_string(), psyclone.psyir.nodes.omp_directives.OMPTargetDirective.end_string(), psyclone.psyir.nodes.omp_directives.OMPLoopDirective.end_string(), psyclone.psyir.nodes.omp_directives.OMPAtomicDirective.end_string(), psyclone.psyir.nodes.omp_directives.OMPSimdDirective.end_string(), psyclone.psyir.nodes.omp_task_directive.OMPTaskDirective.end_string(), psyclone.psyir.nodes.directive.RegionDirective.gen_post_region_code(), 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:

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