Reference Guide  2.5.0
psyclone.domain.lfric.kernel.psyir.LFRicKernelContainer Class Reference
Inheritance diagram for psyclone.domain.lfric.kernel.psyir.LFRicKernelContainer:
Collaboration diagram for psyclone.domain.lfric.kernel.psyir.LFRicKernelContainer:

Public Member Functions

def __init__ (self, name, metadata, **kwargs)
 
def create (cls, name, metadata, symbol_table, children)
 
def metadata (self)
 
def lower_to_language_level (self)
 

Detailed Description

An LFRic-specific Container. This specialises the generic Container
node and adds in any domain-specific information.

:param str name: the name of the container.
:param metadata: the metadata object.
:type metadata: \
    :py:class:`psyclone.domain.lfric.kernel.LFRicKernelMetadata`
:param kwargs: additional keyword arguments to pass to parent \
    constructor.
:type kwargs: unwrapped dict

Definition at line 43 of file psyir.py.

Member Function Documentation

◆ create()

def psyclone.domain.lfric.kernel.psyir.LFRicKernelContainer.create (   cls,
  name,
  metadata,
  symbol_table,
  children 
)
Create an LFRic Container instance given a name, metadata, a symbol
table and a list of child nodes. An LFRic-specific kernel is
created with the metadata describing the kernel interface for
a single kernel routine within the container.

:param str name: the name of the Container.
:param metadata: the metadata object.
:type metadata: \
    :py:class:`psyclone.domain.lfric.kernel.LFRicKernelMetadata`
:param symbol_table: the symbol table associated with this \
    Container.
:type symbol_table: :py:class:`psyclone.psyir.symbols.SymbolTable`
:param children: a list of PSyIR nodes contained in the \
    Container. These must be Containers or Routines.
:type children: List[:py:class:`psyclone.psyir.nodes.Container` \
    | :py:class:`psyclone.psyir.nodes.Routine`]

:returns: an instance of `cls`.
:rtype: :py:class:`psyclone.psyir.nodes.Container` or subclass
    thereof.

Definition at line 62 of file psyir.py.

62  def create(cls, name, metadata, symbol_table, children):
63  '''Create an LFRic Container instance given a name, metadata, a symbol
64  table and a list of child nodes. An LFRic-specific kernel is
65  created with the metadata describing the kernel interface for
66  a single kernel routine within the container.
67 
68  :param str name: the name of the Container.
69  :param metadata: the metadata object.
70  :type metadata: \
71  :py:class:`psyclone.domain.lfric.kernel.LFRicKernelMetadata`
72  :param symbol_table: the symbol table associated with this \
73  Container.
74  :type symbol_table: :py:class:`psyclone.psyir.symbols.SymbolTable`
75  :param children: a list of PSyIR nodes contained in the \
76  Container. These must be Containers or Routines.
77  :type children: List[:py:class:`psyclone.psyir.nodes.Container` \
78  | :py:class:`psyclone.psyir.nodes.Routine`]
79 
80  :returns: an instance of `cls`.
81  :rtype: :py:class:`psyclone.psyir.nodes.Container` or subclass
82  thereof.
83 
84  '''
85  return cls(name, metadata, children=children,
86  symbol_table=symbol_table.detach())
87 
Here is the caller graph for this function:

◆ lower_to_language_level()

def psyclone.domain.lfric.kernel.psyir.LFRicKernelContainer.lower_to_language_level (   self)
Lower this LFRic-specific container to language level psyir.

:returns: the lowered version of this node.
:rtype: :py:class:`psyclone.psyir.node.Node`

Definition at line 97 of file psyir.py.

97  def lower_to_language_level(self):
98  '''Lower this LFRic-specific container to language level psyir.
99 
100  :returns: the lowered version of this node.
101  :rtype: :py:class:`psyclone.psyir.node.Node`
102 
103  '''
104  # Create metadata symbol and add it to the container symbol
105  # table.
106  data_symbol = self.metadata.lower_to_psyir()
107  self.symbol_table.add(data_symbol)
108 
109  # Replace this LFRic container with a generic container
110  children = self.pop_all_children()
111  generic_container = Container.create(
112  self.name, self.symbol_table.detach(), children)
113  self.replace_with(generic_container)
114  return generic_container
115 
116 

References psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicXPlusYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncXPlusYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicAPlusXKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncAPlusXKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicAXPlusYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncAXPlusYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncXPlusBYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicAXPlusBYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncAXPlusBYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicAXPlusAYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicXMinusYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncXMinusYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicAMinusXKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncAMinusXKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicXMinusAKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncXMinusAKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicAXMinusYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicXMinusBYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncXMinusBYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicAXMinusBYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicXTimesYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncXTimesYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncAXTimesYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicATimesXKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncATimesXKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicXDividebyYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncXDividebyYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicXDividebyAKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncXDividebyAKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicADividebyXKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncADividebyXKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncXPowrealAKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncXPowintNKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicSetvalCKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicSetvalXKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicSetvalRandomKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicXInnerproductYKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicXInnerproductXKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicSumXKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicSignXKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicMaxAXKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncMaxAXKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicMinAXKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIncMinAXKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicRealToIntXKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicRealToRealXKern.metadata(), psyclone.domain.lfric.lfric_builtins.LFRicIntToRealXKern.metadata(), psyclone.domain.gocean.kernel.psyir.GOceanContainer.metadata(), psyclone.domain.lfric.kernel.psyir.LFRicKernelContainer.metadata(), psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.name, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.GridArg.name, psyclone.domain.gocean.transformations.gocean_const_loop_bounds_trans.GOConstLoopBoundsTrans.name(), psyclone.domain.gocean.transformations.gocean_move_iteration_boundaries_inside_kernel_trans.GOMoveIterationBoundariesInsideKernelTrans.name(), psyclone.domain.gocean.transformations.gocean_opencl_trans.GOOpenCLTrans.name(), psyclone.domain.lfric.kernel.lfric_kernel_metadata.LFRicKernelMetadata.name, psyclone.domain.nemo.transformations.create_nemo_invoke_schedule_trans.CreateNemoInvokeScheduleTrans.name(), psyclone.domain.nemo.transformations.create_nemo_psy_trans.CreateNemoPSyTrans.name(), psyclone.domain.nemo.transformations.nemo_allarrayrange2loop_trans.NemoAllArrayRange2LoopTrans.name(), psyclone.domain.nemo.transformations.nemo_arrayrange2loop_trans.NemoArrayRange2LoopTrans.name(), psyclone.domain.nemo.transformations.nemo_outerarrayrange2loop_trans.NemoOuterArrayRange2LoopTrans.name(), psyclone.dynamo0p3.DynamoPSy.name(), psyclone.expression.FunctionVar.name, psyclone.expression.NamedArg.name(), psyclone.gocean1p0.GOKernelGridArgument.name(), psyclone.gocean1p0.GOStencil.name(), psyclone.parse.algorithm.FileInfo.name(), psyclone.parse.algorithm.InvokeCall.name(), psyclone.parse.kernel.KernelProcedure.name(), psyclone.parse.kernel.KernelType.name(), psyclone.parse.module_info.ModuleInfo.name(), psyclone.psyad.transformations.assignment_trans.AssignmentTrans.name(), psyclone.psyGen.PSy.name(), psyclone.psyGen.Invoke.name(), psyclone.psyGen.Kern.name(), psyclone.psyGen.CodedKern.name, psyclone.psyGen.Argument.name(), psyclone.psyGen.Transformation.name(), psyclone.psyGen.DummyTransformation.name(), psyclone.psyir.nodes.container.Container.name, psyclone.psyir.nodes.member.Member.name, psyclone.psyir.nodes.reference.Reference.name(), psyclone.psyir.nodes.routine.Routine.name, psyclone.psyir.symbols.symbol.Symbol.name(), psyclone.psyir.transformations.allarrayaccess2loop_trans.AllArrayAccess2LoopTrans.name(), psyclone.psyir.transformations.arrayrange2loop_trans.ArrayRange2LoopTrans.name(), psyclone.psyir.transformations.fold_conditional_return_expressions_trans.FoldConditionalReturnExpressionsTrans.name(), psyclone.psyir.transformations.loop_trans.LoopTrans.name(), psyclone.psyir.transformations.omp_task_trans.OMPTaskTrans.name(), psyclone.psyir.transformations.psy_data_trans.PSyDataTrans.name(), psyclone.transformations.OMPSingleTrans.name(), psyclone.transformations.OMPMasterTrans.name(), psyclone.transformations.OMPParallelTrans.name(), psyclone.transformations.MoveTrans.name(), psyclone.transformations.Dynamo0p3AsyncHaloExchangeTrans.name(), psyclone.transformations.Dynamo0p3KernelConstTrans.name(), psyclone.transformations.ACCEnterDataTrans.name(), psyclone.transformations.ACCRoutineTrans.name(), psyclone.transformations.ACCKernelsTrans.name(), psyclone.transformations.ACCDataTrans.name(), psyclone.transformations.KernelImportsToArguments.name(), psyclone.psyir.nodes.node.Node.pop_all_children(), psyclone.psyir.nodes.node.Node.replace_with(), psyclone.psyGen.InvokeSchedule.symbol_table(), and psyclone.psyir.nodes.scoping_node.ScopingNode.symbol_table.

Here is the caller graph for this function:

◆ metadata()

def psyclone.domain.lfric.kernel.psyir.LFRicKernelContainer.metadata (   self)
:returns the LFRic metadata object.
:rtype: :py:class:`psyclone.domain.lfric.kernel.psyir.\
    LFRicKernelMetadata`

Definition at line 89 of file psyir.py.

89  def metadata(self):
90  '''
91  :returns the LFRic metadata object.
92  :rtype: :py:class:`psyclone.domain.lfric.kernel.psyir.\
93  LFRicKernelMetadata`
94  '''
95  return self._metadata
96 

References psyclone.domain.gocean.kernel.psyir.GOceanContainer._metadata, psyclone.domain.lfric.kernel.psyir.LFRicKernelContainer._metadata, and psyclone.domain.lfric.metadata_to_arguments_rules.MetadataToArgumentsRules._metadata.

Here is the caller graph for this function:

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