Reference Guide  2.5.0
psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn Class Reference
Inheritance diagram for psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn:
Collaboration diagram for psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn:

Public Member Functions

def __init__ (self)
 
def __str__ (self)
 
def reference_accesses (self, var_accesses)
 
def load (self, call, parent=None)
 
def undf_name (self)
 
def qr_required (self)
 
def reference_element (self)
 
def cma_operation (self)
 
def is_intergrid (self)
 
def fs_descriptors (self)
 
def get_dof_loop_index_symbol (self)
 
def get_indexed_field_argument_references (self)
 
def get_scalar_argument_references (self)
 
- Public Member Functions inherited from psyclone.psyGen.BuiltIn
def dag_name (self)
 
def load (self, call, arguments, parent=None)
 
def local_vars (self)
 
- Public Member Functions inherited from psyclone.psyGen.Kern
def __init__ (self, parent, call, name, ArgumentsClass, check=True)
 
def args (self)
 
def node_str (self, colour=True)
 
def is_reduction (self)
 
def reduction_arg (self)
 
def reprod_reduction (self)
 
def local_reduction_name (self)
 
def zero_reduction_variable (self, parent, position=None)
 
def reduction_sum_loop (self, parent)
 
def arg_descriptors (self)
 
def arg_descriptors (self, obj)
 
def arguments (self)
 
def name (self)
 
def name (self, value)
 
def is_coloured (self)
 
def iterates_over (self)
 
def gen_code (self, parent)
 

Static Public Member Functions

def metadata ()
 

Public Attributes

 qr_rules
 
 mesh
 
 arg_descriptors
 

Detailed Description

Abstract base class for a node representing a call to an LFRic
built-in.

:raises NotImplementedError: if a subclass of this abstract class \
    does not set the value of '_datatype'.

Definition at line 156 of file lfric_builtins.py.

Member Function Documentation

◆ cma_operation()

def psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn.cma_operation (   self)
Built-ins do not perform operations with Column-Matrix-Assembly
operators.

:returns: None
:rtype: NoneType

Definition at line 401 of file lfric_builtins.py.

401  def cma_operation(self):
402  '''
403  Built-ins do not perform operations with Column-Matrix-Assembly
404  operators.
405 
406  :returns: None
407  :rtype: NoneType
408 
409  '''
410  return None
411 

◆ fs_descriptors()

def psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn.fs_descriptors (   self)
:returns: a list of function space descriptor objects which \
          contain information about the function spaces.
:rtype: list of :py:class:`psyclone.dynamo0p3.FSDescriptor`

Definition at line 424 of file lfric_builtins.py.

424  def fs_descriptors(self):
425  '''
426  :returns: a list of function space descriptor objects which \
427  contain information about the function spaces.
428  :rtype: list of :py:class:`psyclone.dynamo0p3.FSDescriptor`
429 
430  '''
431  return self._fs_descriptors
432 

References psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn._fs_descriptors, psyclone.domain.lfric.lfric_kern.LFRicKern._fs_descriptors, and psyclone.psyGen.BuiltIn._fs_descriptors.

◆ get_dof_loop_index_symbol()

def psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn.get_dof_loop_index_symbol (   self)
Finds or creates the symbol representing the index in any loops
over DoFs.

:returns: symbol representing the DoF loop index.
:rtype: :py:class:`psyclone.psyir.symbols.DataSymbol`

Definition at line 433 of file lfric_builtins.py.

433  def get_dof_loop_index_symbol(self):
434  '''
435  Finds or creates the symbol representing the index in any loops
436  over DoFs.
437 
438  :returns: symbol representing the DoF loop index.
439  :rtype: :py:class:`psyclone.psyir.symbols.DataSymbol`
440 
441  '''
442  table = self.scope.symbol_table
443  # The symbol representing the loop index is created in the LFRicLoop
444  # constructor.
445  return table.find_or_create_integer_symbol(
446  "df", tag="dof_loop_idx")
447 

References psyclone.psyir.nodes.node.Node.scope(), and psyclone.psyir.symbols.symbol_table.SymbolTable.scope().

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

◆ get_indexed_field_argument_references()

def psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn.get_indexed_field_argument_references (   self)
Creates a DoF-indexed StructureReference for each of the field
arguments to this Built-In kernel. e.g. if the kernel has a field
argument named 'fld1' then this routine will create an
ArrayReference for 'fld1_data(df)' where 'df' is the DoF-loop
variable and 'fld1_data' is the pointer to the data array within
the fld1 object.

:returns: a reference to the 'df'th element of each kernel argument
          that is a field.
:rtype: List[:py:class:`psyclone.psyir.nodes.ArrayReference`]

Definition at line 448 of file lfric_builtins.py.

448  def get_indexed_field_argument_references(self):
449  '''
450  Creates a DoF-indexed StructureReference for each of the field
451  arguments to this Built-In kernel. e.g. if the kernel has a field
452  argument named 'fld1' then this routine will create an
453  ArrayReference for 'fld1_data(df)' where 'df' is the DoF-loop
454  variable and 'fld1_data' is the pointer to the data array within
455  the fld1 object.
456 
457  :returns: a reference to the 'df'th element of each kernel argument
458  that is a field.
459  :rtype: List[:py:class:`psyclone.psyir.nodes.ArrayReference`]
460 
461  '''
462  table = self.scope.symbol_table
463  idx_sym = self.get_dof_loop_index_symbol()
464  suffixes = LFRicConstants().ARG_TYPE_SUFFIX_MAPPING
465 
466  refs = []
467  for arg in self._arguments.args:
468  if not arg.is_field:
469  continue
470  sym = table.lookup_with_tag(
471  f"{arg.name}:{suffixes[arg.argument_type]}")
472  refs.append(ArrayReference.create(sym, [Reference(idx_sym)]))
473  return refs
474 

References psyclone.domain.lfric.lfric_kern.LFRicKern._arguments, psyclone.psyGen.Kern._arguments, psyclone.psyGen.InlinedKern._arguments, psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn.get_dof_loop_index_symbol(), psyclone.psyir.nodes.node.Node.scope(), and psyclone.psyir.symbols.symbol_table.SymbolTable.scope().

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

◆ get_scalar_argument_references()

def psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn.get_scalar_argument_references (   self)
Finds or creates either a Reference (for a symbol) or PSyIR (for a
literal expression) for any scalar arguments to this Built-In kernel.

:returns: a Reference or PSyIR expression for each scalar kernel
          argument.
:rtype: list of subclasses of `:py:class:`psyclone.psyir.nodes.Node`

Definition at line 475 of file lfric_builtins.py.

475  def get_scalar_argument_references(self):
476  '''
477  Finds or creates either a Reference (for a symbol) or PSyIR (for a
478  literal expression) for any scalar arguments to this Built-In kernel.
479 
480  :returns: a Reference or PSyIR expression for each scalar kernel
481  argument.
482  :rtype: list of subclasses of `:py:class:`psyclone.psyir.nodes.Node`
483 
484  '''
485  return [arg.psyir_expression() for arg in self._arguments.args
486  if arg.is_scalar]
487 

References psyclone.domain.lfric.lfric_kern.LFRicKern._arguments, psyclone.psyGen.Kern._arguments, psyclone.psyGen.InlinedKern._arguments, and psyclone.psyir.nodes.node.Node.replace_with().

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

◆ is_intergrid()

def psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn.is_intergrid (   self)
We don't have any inter-grid built-ins.

:returns: False
:rtype: bool

Definition at line 413 of file lfric_builtins.py.

413  def is_intergrid(self):
414  '''
415  We don't have any inter-grid built-ins.
416 
417  :returns: False
418  :rtype: bool
419 
420  '''
421  return False
422 
Here is the caller graph for this function:

◆ load()

def psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn.load (   self,
  call,
  parent = None 
)
Populate the state of this object using the supplied call object.

:param call: The BuiltIn object from which to extract information \
             about this built-in call.
:type call: :py:class:`psyclone.parse.algorithm.BuiltInCall`
:param parent: The parent node of the kernel call in the PSyIR \
               we are constructing. This will be a loop.
:type parent: :py:class:`psyclone.domain.lfric.LFRicLoop`

Definition at line 258 of file lfric_builtins.py.

258  def load(self, call, parent=None):
259  '''
260  Populate the state of this object using the supplied call object.
261 
262  :param call: The BuiltIn object from which to extract information \
263  about this built-in call.
264  :type call: :py:class:`psyclone.parse.algorithm.BuiltInCall`
265  :param parent: The parent node of the kernel call in the PSyIR \
266  we are constructing. This will be a loop.
267  :type parent: :py:class:`psyclone.domain.lfric.LFRicLoop`
268 
269  '''
270  # Avoid circular import
271  # pylint: disable=import-outside-toplevel
272  from psyclone.dynamo0p3 import FSDescriptors, DynKernelArguments
273  BuiltIn.load(self, call, DynKernelArguments, parent)
274  self.arg_descriptors = call.ktype.arg_descriptors
275  self._func_descriptors = call.ktype.func_descriptors
276  self._fs_descriptors = FSDescriptors(call.ktype.func_descriptors)
277  self._idx_name = self.get_dof_loop_index_symbol().name
278  # Check that this built-in kernel is valid
279  self._validate()
280 

References psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn._fs_descriptors, psyclone.domain.lfric.lfric_kern.LFRicKern._fs_descriptors, psyclone.psyGen.BuiltIn._fs_descriptors, psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn._func_descriptors, psyclone.domain.lfric.lfric_kern.LFRicKern._func_descriptors, psyclone.domain.lfric.lfric_kern_metadata.LFRicKernMetadata._func_descriptors, psyclone.psyGen.BuiltIn._func_descriptors, psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn._idx_name, psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn._validate(), psyclone.domain.lfric.lfric_kern_metadata.LFRicKernMetadata._validate(), psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn.arg_descriptors, psyclone.parse.kernel.KernelType.arg_descriptors(), psyclone.psyGen.Kern.arg_descriptors(), psyclone.psyGen.CodedKern.arg_descriptors, psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn.get_dof_loop_index_symbol(), psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.iterates_over, psyclone.parse.kernel.KernelType.iterates_over(), psyclone.psyGen.Kern.iterates_over(), 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_loop_trans.CreateNemoLoopTrans.name(), psyclone.domain.nemo.transformations.create_nemo_psy_trans.CreateNemoPSyTrans.name(), psyclone.domain.nemo.transformations.nemo_allarrayaccess2loop_trans.NemoAllArrayAccess2LoopTrans.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.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(), and psyclone.transformations.KernelImportsToArguments.name().

Here is the call graph for this function:

◆ metadata()

def psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn.metadata ( )
static
Must be overridden by subclass.

Definition at line 181 of file lfric_builtins.py.

181  def metadata():
182  '''Must be overridden by subclass.'''
183 

References psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn._case_name, psyclone.domain.lfric.lfric_builtins.LFRicXPlusYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncXPlusYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicAPlusXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncAPlusXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicAXPlusYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncAXPlusYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncXPlusBYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicAXPlusBYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncAXPlusBYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicAXPlusAYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicXMinusYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncXMinusYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicAMinusXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncAMinusXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicXMinusAKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncXMinusAKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicAXMinusYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicXMinusBYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncXMinusBYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicAXMinusBYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicXTimesYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncXTimesYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncAXTimesYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicATimesXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncATimesXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicXDividebyYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncXDividebyYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicXDividebyAKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncXDividebyAKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicADividebyXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncADividebyXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncXPowrealAKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncXPowintNKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicSetvalCKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicSetvalXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicSetvalRandomKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicXInnerproductYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicXInnerproductXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicSumXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicSignXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicMaxAXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncMaxAXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicMinAXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIncMinAXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicRealToIntXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicRealToRealXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntXPlusYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntIncXPlusYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntAPlusXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntIncAPlusXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntXMinusYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntIncXMinusYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntAMinusXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntIncAMinusXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntXMinusAKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntIncXMinusAKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntXTimesYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntIncXTimesYKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntATimesXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntIncATimesXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntSetvalCKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntSetvalXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntSignXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntMaxAXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntIncMaxAXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntMinAXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntIncMinAXKern._case_name, psyclone.domain.lfric.lfric_builtins.LFRicIntToRealXKern._case_name, 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(), and psyclone.domain.lfric.kernel.psyir.LFRicKernelContainer.metadata().

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

◆ qr_required()

def psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn.qr_required (   self)
Built-ins do not currently require quadrature.

:returns: False
:rtype: bool

Definition at line 379 of file lfric_builtins.py.

379  def qr_required(self):
380  '''
381  Built-ins do not currently require quadrature.
382 
383  :returns: False
384  :rtype: bool
385 
386  '''
387  return False
388 

◆ reference_accesses()

def psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn.reference_accesses (   self,
  var_accesses 
)
Get all variable access information from this node. The assigned-to
variable will be set to 'WRITE'.

:param var_accesses: VariablesAccessInfo instance that stores the \
    information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

:raises InternalError: if an unsupported argument type is encountered.

Reimplemented from psyclone.psyGen.Kern.

Definition at line 217 of file lfric_builtins.py.

217  def reference_accesses(self, var_accesses):
218  '''Get all variable access information from this node. The assigned-to
219  variable will be set to 'WRITE'.
220 
221  :param var_accesses: VariablesAccessInfo instance that stores the \
222  information about variable accesses.
223  :type var_accesses: \
224  :py:class:`psyclone.core.VariablesAccessInfo`
225 
226  :raises InternalError: if an unsupported argument type is encountered.
227 
228  '''
229  table = self.scope.symbol_table
230  # Collect all write access in a separate object, so they can be added
231  # after all read access (which must happen before something is written)
232  written = VariablesAccessInfo()
233  suffix_map = LFRicConstants().ARG_TYPE_SUFFIX_MAPPING
234 
235  for arg in self.args:
236  if arg.form in ["variable", "indexed_variable"]:
237  if arg.is_field:
238  sym = table.lookup_with_tag(
239  f"{arg.name}:{suffix_map[arg.argument_type]}")
240  name = sym.name
241  elif arg.is_scalar:
242  name = arg.declaration_name
243  else:
244  raise InternalError(
245  f"LFRicBuiltin.reference_accesses only supports field "
246  f"and scalar arguments but got '{arg.name}' of type "
247  f"'{arg.argument_type}'")
248  if arg.access == AccessType.WRITE:
249  written.add_access(Signature(name), arg.access, self)
250  else:
251  var_accesses.add_access(Signature(name), arg.access, self)
252  # Now merge the write access to the end of all other accesses:
253  var_accesses.merge(written)
254  # Forward location pointer to next index, since this built-in kernel
255  # finishes a statement
256  var_accesses.next_location()
257 

References psyclone.expression.FunctionVar.args, psyclone.f2pygen.SubroutineGen.args(), psyclone.parse.algorithm.ParsedCall.args(), psyclone.psyGen.GlobalSum.args(), psyclone.psyGen.HaloExchange.args(), psyclone.psyGen.Kern.args(), psyclone.psyGen.Arguments.args(), psyclone.psyir.nodes.node.Node.args(), psyclone.psyir.nodes.node.Node.scope(), and psyclone.psyir.symbols.symbol_table.SymbolTable.scope().

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

◆ reference_element()

def psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn.reference_element (   self)
Built-ins do not require reference-element properties.

:returns: None
:rtype: NoneType

Definition at line 390 of file lfric_builtins.py.

390  def reference_element(self):
391  '''
392  Built-ins do not require reference-element properties.
393 
394  :returns: None
395  :rtype: NoneType
396 
397  '''
398  return None
399 

◆ undf_name()

def psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn.undf_name (   self)
Dynamically looks up the name of the 'undf' variable for the
space that this kernel updates.

:returns: the name of the undf variable.
:rtype: str

Definition at line 366 of file lfric_builtins.py.

366  def undf_name(self):
367  '''
368  Dynamically looks up the name of the 'undf' variable for the
369  space that this kernel updates.
370 
371  :returns: the name of the undf variable.
372  :rtype: str
373 
374  '''
375  field = self._arguments.iteration_space_arg()
376  return field.function_space.undf_name
377 

References psyclone.domain.lfric.lfric_kern.LFRicKern._arguments, psyclone.psyGen.Kern._arguments, and psyclone.psyGen.InlinedKern._arguments.


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