Reference Guide
2.5.0
|
Public Member Functions | |
def | __init__ (self, alg_invocation, idx, schedule_class, invokes, reserved_names=None) |
def | __str__ (self) |
def | invokes (self) |
def | name (self) |
def | alg_unique_args (self) |
def | psy_unique_vars (self) |
def | psy_unique_var_names (self) |
def | schedule (self) |
def | schedule (self, obj) |
def | unique_declarations (self, argument_types, access=None, intrinsic_type=None) |
def | first_access (self, arg_name) |
def | unique_declns_by_intent (self, argument_types, intrinsic_type=None) |
def | gen (self) |
def | gen_code (self, parent) |
Manage an individual invoke call. :param alg_invocation: metadata from the parsed code capturing \ information for this Invoke instance. :type alg_invocation: :py:class:`psyclone.parse.algorithm.InvokeCall` :param int idx: position/index of this invoke call in the subroutine. \ If not None, this number is added to the name ("invoke\_"). :param schedule_class: the schedule class to create for this invoke. :type schedule_class: :py:class:`psyclone.psyGen.InvokeSchedule` :param invokes: the Invokes instance that contains this Invoke \ instance. :type invokes: :py:class:`psyclone.psyGen.Invokes` :param reserved_names: optional list of reserved names, i.e. names that \ should not be used e.g. as a PSyclone-created \ variable name. :type reserved_names: list of str
def psyclone.psyGen.Invoke.__init__ | ( | self, | |
alg_invocation, | |||
idx, | |||
schedule_class, | |||
invokes, | |||
reserved_names = None |
|||
) |
Construct an invoke object.
Definition at line 386 of file psyGen.py.
References psyclone.psyGen.Invoke._alg_unique_args, psyclone.dynamo0p3.DynKernelArguments._dofs, psyclone.gocean1p0.GOKernelArguments._dofs, psyclone.psyGen.Invoke._dofs, psyclone.dynamo0p3.DynamoPSy._invokes, psyclone.gocean1p0.GOPSy._invokes, psyclone.nemo.NemoInvoke._invokes, psyclone.nemo.NemoPSy._invokes, psyclone.psyGen.PSy._invokes, psyclone.psyGen.Invoke._invokes, psyclone.domain.common.algorithm.psyir.AlgorithmInvokeCall._name, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata._name, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.GridArg._name, psyclone.domain.lfric.kernel.lfric_kernel_metadata.LFRicKernelMetadata._name, psyclone.dynamo0p3.DynFuncDescriptor03._name, psyclone.expression.NamedArg._name, psyclone.gocean1p0.GOKernelGridArgument._name, psyclone.gocean1p0.GOStencil._name, psyclone.nemo.NemoInvoke._name, psyclone.nemo.NemoPSy._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.psyGen.PSy._name, psyclone.psyGen.Invoke._name, psyclone.psyGen.Kern._name, psyclone.psyGen.Argument._name, psyclone.psyir.nodes.container.Container._name, psyclone.psyir.nodes.routine.Routine._name, psyclone.psyir.symbols.symbol.Symbol._name, psyclone.psyGen.Invoke._psy_unique_vars, psyclone.domain.lfric.lfric_invoke.LFRicInvoke._schedule, psyclone.dynamo0p3.DynMeshes._schedule, psyclone.gocean1p0.GOInvoke._schedule, psyclone.nemo.NemoInvoke._schedule, psyclone.psyGen.Invoke._schedule, psyclone.psyir.nodes.omp_clauses.OMPScheduleClause._schedule, psyclone.psyGen.PSy.invokes(), psyclone.psyGen.Invoke.invokes(), psyclone.psyGen.Invoke.schedule(), and psyclone.psyir.nodes.omp_clauses.OMPScheduleClause.schedule.
def psyclone.psyGen.Invoke.first_access | ( | self, | |
arg_name | |||
) |
Returns the first argument with the specified name passed to a kernel in our schedule
Definition at line 561 of file psyGen.py.
References psyclone.psyGen.Invoke.schedule(), and psyclone.psyir.nodes.omp_clauses.OMPScheduleClause.schedule.
def psyclone.psyGen.Invoke.gen_code | ( | self, | |
parent | |||
) |
Generates invocation code (the subroutine called by the associated invoke call in the algorithm layer). This consists of the PSy invocation subroutine and the declaration of its arguments. :param parent: the node in the generated AST to which to add content. :type parent: :py:class:`psyclone.f2pygen.ModuleGen`
Reimplemented in psyclone.gocean1p0.GOInvoke, and psyclone.domain.lfric.lfric_invoke.LFRicInvoke.
Definition at line 653 of file psyGen.py.
def psyclone.psyGen.Invoke.invokes | ( | self | ) |
:returns: the Invokes instance that contains this instance. :rtype: :py:class`psyclone.psyGen.Invokes`
Definition at line 464 of file psyGen.py.
References psyclone.psyGen.Invoke._alg_unique_args, psyclone.dynamo0p3.DynamoPSy._invokes, psyclone.gocean1p0.GOPSy._invokes, psyclone.nemo.NemoInvoke._invokes, psyclone.nemo.NemoPSy._invokes, psyclone.psyGen.PSy._invokes, psyclone.psyGen.Invoke._invokes, psyclone.domain.common.algorithm.psyir.AlgorithmInvokeCall._name, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata._name, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.GridArg._name, psyclone.domain.lfric.kernel.lfric_kernel_metadata.LFRicKernelMetadata._name, psyclone.dynamo0p3.DynFuncDescriptor03._name, psyclone.expression.NamedArg._name, psyclone.gocean1p0.GOKernelGridArgument._name, psyclone.gocean1p0.GOStencil._name, psyclone.nemo.NemoInvoke._name, psyclone.nemo.NemoPSy._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.psyGen.PSy._name, psyclone.psyGen.Invoke._name, psyclone.psyGen.Kern._name, psyclone.psyGen.Argument._name, psyclone.psyir.nodes.container.Container._name, psyclone.psyir.nodes.routine.Routine._name, psyclone.psyir.symbols.symbol.Symbol._name, psyclone.psyGen.Invoke._psy_unique_vars, psyclone.domain.lfric.lfric_invoke.LFRicInvoke._schedule, psyclone.dynamo0p3.DynMeshes._schedule, psyclone.gocean1p0.GOInvoke._schedule, psyclone.nemo.NemoInvoke._schedule, psyclone.psyGen.Invoke._schedule, and psyclone.psyir.nodes.omp_clauses.OMPScheduleClause._schedule.
def psyclone.psyGen.Invoke.unique_declarations | ( | self, | |
argument_types, | |||
access = None , |
|||
intrinsic_type = None |
|||
) |
Returns a list of all required declarations for the specified API argument types. If access is supplied (e.g. "write") then only declarations with that access are returned. If an intrinsic type is supplied then only declarations with that intrinsic type are returned. :param argument_types: the types of the kernel argument for the \ particular API. :type argument_types: list of str :param access: optional AccessType that the declaration should have. :type access: :py:class:`psyclone.core.access_type.AccessType` :param intrinsic_type: optional intrinsic type of argument data. :type intrinsic_type: str :returns: a list of all declared kernel arguments. :rtype: list of :py:class:`psyclone.psyGen.KernelArgument` :raises InternalError: if at least one kernel argument type is \ not valid for the particular API. :raises InternalError: if an invalid access is specified. :raises InternalError: if an invalid intrinsic type is specified.
Definition at line 499 of file psyGen.py.
References psyclone.psyGen.Invoke.schedule(), and psyclone.psyir.nodes.omp_clauses.OMPScheduleClause.schedule.
def psyclone.psyGen.Invoke.unique_declns_by_intent | ( | self, | |
argument_types, | |||
intrinsic_type = None |
|||
) |
Returns a dictionary listing all required declarations for each type of intent ('inout', 'out' and 'in'). :param argument_types: the types of the kernel argument for the \ particular API for which the intent is required. :type argument_types: list of str :param intrinsic_type: optional intrinsic type of argument data. :type intrinsic_type: str :returns: dictionary containing 'intent' keys holding the kernel \ arguments as values for each type of intent. :rtype: dict of :py:class:`psyclone.psyGen.KernelArgument` :raises InternalError: if at least one kernel argument type is \ not valid for the particular API. :raises InternalError: if an invalid intrinsic type is specified.
Definition at line 572 of file psyGen.py.
References psyclone.psyGen.Invoke.first_access(), psyclone.psyir.nodes.acc_directives.ACCDataDirective.gen_code(), psyclone.domain.lfric.lfric_invoke.LFRicInvoke.gen_code(), psyclone.domain.lfric.lfric_loop.LFRicLoop.gen_code(), psyclone.dynamo0p3.DynGlobalSum.gen_code(), psyclone.dynamo0p3.LFRicHaloExchange.gen_code(), psyclone.gocean1p0.GOInvokes.gen_code(), psyclone.gocean1p0.GOInvoke.gen_code(), psyclone.gocean1p0.GOLoop.gen_code(), psyclone.psyGen.Invokes.gen_code(), psyclone.psyGen.Invoke.gen_code(), psyclone.psyGen.InvokeSchedule.gen_code(), psyclone.psyGen.Kern.gen_code(), psyclone.psyir.nodes.acc_directives.ACCRoutineDirective.gen_code(), psyclone.psyir.nodes.acc_directives.ACCEnterDataDirective.gen_code(), psyclone.psyir.nodes.acc_directives.ACCParallelDirective.gen_code(), psyclone.psyir.nodes.acc_directives.ACCLoopDirective.gen_code(), psyclone.psyir.nodes.acc_directives.ACCKernelsDirective.gen_code(), psyclone.psyir.nodes.assignment.Assignment.gen_code(), psyclone.psyir.nodes.extract_node.ExtractNode.gen_code(), psyclone.psyir.nodes.loop.Loop.gen_code(), psyclone.psyir.nodes.omp_directives.OMPDeclareTargetDirective.gen_code(), psyclone.psyir.nodes.omp_directives.OMPTaskwaitDirective.gen_code(), psyclone.psyir.nodes.omp_directives.OMPSingleDirective.gen_code(), psyclone.psyir.nodes.omp_directives.OMPMasterDirective.gen_code(), psyclone.psyir.nodes.omp_directives.OMPParallelDirective.gen_code(), psyclone.psyir.nodes.omp_directives.OMPTaskloopDirective.gen_code(), psyclone.psyir.nodes.omp_directives.OMPDoDirective.gen_code(), psyclone.psyir.nodes.omp_directives.OMPParallelDoDirective.gen_code(), psyclone.psyir.nodes.schedule.Schedule.gen_code(), psyclone.psyir.nodes.psy_data_node.PSyDataNode.gen_code(), psyclone.psyGen.Invoke.schedule(), psyclone.psyir.nodes.omp_clauses.OMPScheduleClause.schedule, and psyclone.psyGen.Invoke.unique_declarations().