psyclone.domain.lfric.algorithm.psyir.lfric_kernel_functor
Module containing the implementation of the LFRic-specific kernel-functor classes.
Classes
LFRicBuiltinFunctor
: Base class which all LFRic builtins subclass. Contains a builtin call,LFRicKernelFunctor
: Object containing a call to a user-provided LFRic kernel, a descriptionLFRicBuiltinFunctorFactory
: This class is a singleton which generates and stores a Functor class for
- class psyclone.domain.lfric.algorithm.psyir.lfric_kernel_functor.LFRicBuiltinFunctor(symbol, parent=None)
Base class which all LFRic builtins subclass. Contains a builtin call, a description of its required interface and the arguments to be passed to it.
Inheritance
- classmethod create(table, arguments)
An appropriate DataTypeSymbol is created and added to the supplied symbol table (if it does not already contain one). This is then passed to the create() method in the base class to create an instance of an LFRic builtin call with the supplied list of arguments.
- Parameters:
table (
psyclone.psyir.symbols.SymbolTable
) – the symbol table to which to add the symbol for this functor.arguments (List[
psyclone.psyir.nodes.DataNode
]) – the arguments to this routine. These are added as child nodes.
- Returns:
a functor object describing an LFRic builtin.
- Return type:
- Raises:
InternalError – if a symbol is found that has the same name as a built-in but does not have the correct properties.
- lower_to_language_level()
Removes the symbol representing this BuiltIn as it only exists in the DSL.
- Returns:
the lowered version of this node.
- Return type:
psyclone.psyir.node.Node
- class psyclone.domain.lfric.algorithm.psyir.lfric_kernel_functor.LFRicKernelFunctor(symbol, parent=None)
Object containing a call to a user-provided LFRic kernel, a description of its required interface and the arguments to be passed to it.
Inheritance
- class psyclone.domain.lfric.algorithm.psyir.lfric_kernel_functor.LFRicBuiltinFunctorFactory
This class is a singleton which generates and stores a Functor class for each built-in supported by LFRic. An instance of one of these classes may be obtained by using the create() method.
- Raises:
ValueError – if an attempt is made to construct a second instance of this class.
Inheritance
- create(name, table, arguments)
Create a BuiltinFunctor for the named LFRic builtin.
- Parameters:
name (str) – the built-in for which a functor is required.
table (
psyclone.psyir.symbols.SymbolTable
) – the symbol table to which to add a corresponding symbol.arguments (List[
psyclone.psyir.nodes.DataNode
]) – the arguments to give to the functor.
- static get()
- Returns:
the singleton instance of this class.
- Return type:
- py:class:
psyclone.domain.lfric.algorithm.psyir.LFRicBuiltinFunctorFactory