psyclone.domain.lfric.kern_call_acc_arg_list
This module implements a class that manages all of the data references that must be copied over to a GPU before executing the kernel. Ordering of the parameters does not matter apart from where we have members of derived types. In that case, the derived type itself must be specified first before any members.
Classes
KernCallAccArgList
: Kernel call arguments that need to be declared by OpenACC
- class psyclone.domain.lfric.kern_call_acc_arg_list.KernCallAccArgList(kern)
Kernel call arguments that need to be declared by OpenACC directives. KernCallArgList only needs to be specialised where modified, or additional, arguments are required. Scalars are apparently not required but it is valid in OpenACC to include them and requires less specialisation to keep them in.
Inheritance
- cell_map(var_accesses=None)
Add cell-map to the list of required arrays.
- Parameters:
var_accesses (Optional[
psyclone.core.VariablesAccessInfo
]) – optional VariablesAccessInfo instance to store the information about variable accesses.
- cell_position(var_accesses=None)
Adds a cell argument to the argument list and if supplied stores this access in var_accesses. Although normally just a scalar, the cell argument may actually require a lookup from a colour map array. Either way, this method adds the name of the variable to the argument list.
- Parameters:
var_accesses (Optional[
psyclone.core.VariablesAccessInfo
]) – optional VariablesAccessInfo instance to store the information about variable accesses.
- fs_compulsory_field(function_space, var_accesses=None)
Add compulsory arguments associated with this function space to the list. OpenACC requires the full function-space map to be specified. If supplied it also stores this access in var_accesses.
- Parameters:
function_space (
psyclone.domain.lfric.FunctionSpace
) – the function space for which the compulsory arguments are added.var_accesses (Optional[
psyclone.core.VariablesAccessInfo
]) – optional VariablesAccessInfo instance to store the information about variable accesses.
- fs_intergrid(function_space, var_accesses=None)
Add arrays that need to be uploaded for inter-grid kernels. These arrays contain the mapping between fine and coarse meshes.
- Parameters:
function_space (
psyclone.domain.lfric.FunctionSpace
) – the function space associated with the mesh.var_accesses (Optional[
psyclone.core.VariablesAccessInfo
]) – optional VariablesAccessInfo instance to store the information about variable accesses.
- operator(arg, var_accesses=None)
Add the operator arguments if they have not already been added. OpenACC requires the derived type and the dereferenced data to be specified. If supplied it also stores this access in var_accesses.
- Parameters:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the meta-data description of the operator.var_accesses (Optional[
psyclone.core.VariablesAccessInfo
]) – optional VariablesAccessInfo instance to store the information about variable accesses.
- scalar(scalar_arg, var_accesses=None)
Override the default implementation as there’s no need to specify scalars for an OpenACC data region.
- Parameters:
scalar_arg (
psyclone.dynamo0p3.DynKernelArgument
) – the kernel argument.var_accesses (Optional[
psyclone.core.VariablesAccessInfo
]) – optional VariablesAccessInfo instance that stores information about variable accesses.
- stencil(arg, var_accesses=None)
Add general stencil information associated with the argument ‘arg’ to the argument list. OpenACC requires the full dofmap to be specified. If supplied it also stores this access in var_accesses.
- Parameters:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the meta-data description of the kernel argument with which the stencil is associated.var_accesses (Optional[
psyclone.core.VariablesAccessInfo
]) – optional VariablesAccessInfo instance to store the information about variable accesses.
- stencil_2d(arg, var_accesses=None)
Add general 2D stencil information associated with the argument ‘arg’ to the argument list. OpenACC requires the full dofmap to be specified. If supplied it also stores this access in var_accesses.This method passes through to the stencil method.
- Parameters:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the meta-data description of the kernel argument with which the stencil is associated.var_accesses (Optional[
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. This method passes through to the stencil_unknown_extent method.
- Parameters:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the kernel argument with which the stencil is associated.var_accesses (Optional[
psyclone.core.VariablesAccessInfo
]) – optional VariablesAccessInfo instance to store the information about variable accesses.
- 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 (Optional[
psyclone.core.VariablesAccessInfo
]) – optional VariablesAccessInfo instance to store the information about variable accesses.