psyclone.domain.lfric.kern_call_invoke_arg_list
This module implements a class that captures all the arguments of a Kernel as required by an invoke of that kernel.
Classes
KernCallInvokeArgList
: Determines the arguments that must be provided to an invoke of a
- class psyclone.domain.lfric.kern_call_invoke_arg_list.KernCallInvokeArgList(kern, symbol_table)
Determines the arguments that must be provided to an invoke of a kernel, according to that kernel’s metadata.
- Parameters:
kern (
psyclone.domain.lfric.LFRicKern
) – the kernel object for which to determine arguments.symbol_table (
psyclone.psyir.symbols.SymbolTable
) – the symbol table associated with the routine that contains the invoke of this kernel.
- Raises:
TypeError – if supplied symbol table is of incorrect type.
Inheritance
- field(arg, var_accesses=None)
Add the field array associated with the argument ‘arg’ to the argument list and an appropriate Symbol to the SymbolTable.
- Parameters:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the field to be added.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- field_vector(argvect, var_accesses=None)
Add the field vector associated with the argument ‘argvect’ to the argument list and an associated Symbol to the SymbolTable.
- Parameters:
argvect (
psyclone.dynamo0p3.DynKernelArgument
) – the field vector to add.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- property fields
- Returns:
the field (and field-vector) arguments plus their corresponding function spaces.
- Return type:
List[Tuple(
psyclone.psyir.symbols.DataSymbol
, str)]
- fs_common(function_space, var_accesses=None)
Does nothing as there are no arguments associated with function spaces at the algorithm level.
- Parameters:
function_space (
psyclone.domain.lfric.FunctionSpace
) – the function space for which arguments should be added.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- generate(var_accesses=None)
Ensures that our internal lists of arguments of various types are reset (as calling generate() populates them) before calling this method in the parent class.
- Parameters:
var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- operator(arg, var_accesses=None)
Add the operator argument. If supplied it also stores this access in var_accesses.
- Parameters:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the meta-data description of the operator.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- property operators
- Returns:
the symbols representing the operators required by the kernel along with the names of the from- and to- function spaces.
- Return type:
List[Tuple[
psyclone.psyir.symbols.DataSymbol
, str, str]]
- quad_rule(var_accesses=None)
Add quadrature-related information to the kernel argument list. Adds the necessary arguments to the argument list and suitable symbols to the SymbolTable. Optionally also adds variable access information to the var_accesses object.
- Parameters:
var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- property quadrature_objects
- Returns:
the symbols representing the quadrature objects required by the kernel along with the shape of each.
- Return type:
List[Tuple[
psyclone.psyir.symbols.DataSymbol
, str]]
- scalar(scalar_arg, var_accesses=None)
Add the necessary argument for a scalar quantity as well as an appropriate Symbol to the SymbolTable.
- Parameters:
scalar_arg (
psyclone.dynamo0p3.DynKernelArgument
) – the scalar kernel argument.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance that stores information about variable accesses.
- Raises:
NotImplementedError – if a scalar of type other than real or integer is found.
- property scalars
- Returns:
the scalar arguments to the kernel.
- Return type:
- stencil(arg, var_accesses=None)
Add general stencil information associated with the argument ‘arg’ to the argument list.
- Parameters:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the meta-data description of the kernel argument with which the stencil is associated.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- Raises:
NotImplementedError – stencils are not yet supported.
- stencil_2d(arg, var_accesses=None)
Add general 2D stencil information associated with the argument ‘arg’ to the argument list. This method passes through to the
KernCallInvokeArgList.stencil()
method.- Parameters:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the meta-data description of the kernel argument with which the stencil is associated.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- stencil_2d_unknown_extent(arg, var_accesses=None)
Add 2D stencil information to the argument list associated with the argument ‘arg’ if the extent is unknown. If supplied it also stores this access in var_accesses.
- Parameters:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the kernel argument with which the stencil is associated.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- Raises:
NotImplementedError – stencils are not yet supported.
- stencil_unknown_extent(arg, var_accesses=None)
Add stencil information to the argument list associated with the argument ‘arg’ if the extent is unknown. If supplied it also stores this access in var_accesses.
- Parameters:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the kernel argument with which the stencil is associated.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- Raises:
NotImplementedError – stencils are not yet supported.