Reference Guide
2.5.0
|
Public Member Functions | |
def | __init__ (self, name, datatype, is_constant=False, initial_value=None, **kwargs) |
def | is_constant (self) |
def | is_constant (self, value) |
def | initial_value (self) |
def | initial_value (self, new_value) |
def | __str__ (self) |
def | copy (self) |
def | copy_properties (self, symbol_in) |
Public Member Functions inherited from psyclone.psyir.symbols.typed_symbol.TypedSymbol | |
def | __init__ (self, name, datatype, **kwargs) |
def | datatype (self) |
def | datatype (self, value) |
def | resolve_type (self) |
def | is_scalar (self) |
def | is_array (self) |
def | shape (self) |
Public Member Functions inherited from psyclone.psyir.symbols.symbol.Symbol | |
def | __init__ (self, name, visibility=DEFAULT_VISIBILITY, interface=None) |
def | specialise (self, subclass, **kwargs) |
def | get_external_symbol (self) |
def | name (self) |
def | visibility (self) |
def | visibility (self, value) |
def | interface (self) |
def | interface (self, value) |
def | is_automatic (self) |
def | is_modulevar (self) |
def | is_import (self) |
def | is_argument (self) |
def | is_commonblock (self) |
def | is_static (self) |
def | is_unresolved (self) |
def | is_unknown_interface (self) |
def | find_symbol_table (self, node) |
def | is_array_access (self, index_variable=None, access_info=None) |
Public Attributes | |
initial_value | |
is_constant | |
interface | |
Public Attributes inherited from psyclone.psyir.symbols.typed_symbol.TypedSymbol | |
datatype | |
interface | |
Public Attributes inherited from psyclone.psyir.symbols.symbol.Symbol | |
interface | |
visibility | |
Additional Inherited Members | |
Static Public Attributes inherited from psyclone.psyir.symbols.symbol.Symbol | |
DEFAULT_VISIBILITY = Visibility.PUBLIC | |
Symbol identifying a data element. It contains information about: the datatype, the shape (in column-major order) and the interface to that symbol (i.e. Local, Global, Argument). :param str name: name of the symbol. :param datatype: data type of the symbol. :type datatype: :py:class:`psyclone.psyir.symbols.DataType` :param bool is_constant: whether this DataSymbol is a compile-time constant (default is False). If True then an `initial_value` must also be provided. :param initial_value: sets a fixed known expression as an initial value for this DataSymbol. If `is_constant` is True then this Symbol will always have this value. If the value is None then this symbol does not have an initial value (and cannot be a constant). Otherwise it can receive PSyIR expressions or Python intrinsic types available in the TYPE_MAP_TO_PYTHON map. By default it is None. :type initial_value: Optional[item of TYPE_MAP_TO_PYTHON | :py:class:`psyclone.psyir.nodes.Node`] :param kwargs: additional keyword arguments provided by :py:class:`psyclone.psyir.symbols.TypedSymbol` :type kwargs: unwrapped dict.
Definition at line 45 of file datasymbol.py.
def psyclone.psyir.symbols.datasymbol.DataSymbol.__str__ | ( | self | ) |
Abstract method. Must be overridden in sub-class.
Reimplemented from psyclone.psyir.symbols.typed_symbol.TypedSymbol.
Definition at line 287 of file datasymbol.py.
References psyclone.psyir.symbols.symbol.Symbol._interface, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.ScalarArg.datatype(), psyclone.domain.lfric.kernel.common_meta_arg_metadata.CommonMetaArgMetadata.datatype, psyclone.psyir.nodes.array_reference.ArrayReference.datatype(), psyclone.psyir.nodes.datanode.DataNode.datatype(), psyclone.psyir.nodes.literal.Literal.datatype, psyclone.psyir.nodes.operation.UnaryOperation.datatype(), psyclone.psyir.nodes.operation.BinaryOperation.datatype(), psyclone.psyir.nodes.reference.Reference.datatype(), psyclone.psyir.nodes.structure_reference.StructureReference.datatype(), psyclone.psyir.symbols.data_type_symbol.DataTypeSymbol.datatype, psyclone.psyir.symbols.datatypes.ArrayType.datatype(), psyclone.psyir.symbols.typed_symbol.TypedSymbol.datatype, psyclone.psyir.symbols.datasymbol.DataSymbol.initial_value, psyclone.psyir.symbols.datasymbol.DataSymbol.is_constant, 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_psy_trans.CreateNemoPSyTrans.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.allarrayaccess2loop_trans.AllArrayAccess2LoopTrans.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().
def psyclone.psyir.symbols.datasymbol.DataSymbol.copy | ( | self | ) |
Create and return a copy of this object. Any references to the original will not be affected so the copy will not be referred to by any other object. :returns: An object with the same properties as this symbol object. :rtype: :py:class:`psyclone.psyir.symbols.DataSymbol`
Reimplemented from psyclone.psyir.symbols.typed_symbol.TypedSymbol.
Definition at line 296 of file datasymbol.py.
References psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.ScalarArg.datatype(), psyclone.domain.lfric.kernel.common_meta_arg_metadata.CommonMetaArgMetadata.datatype, psyclone.psyir.nodes.array_reference.ArrayReference.datatype(), psyclone.psyir.nodes.datanode.DataNode.datatype(), psyclone.psyir.nodes.literal.Literal.datatype, psyclone.psyir.nodes.operation.UnaryOperation.datatype(), psyclone.psyir.nodes.operation.BinaryOperation.datatype(), psyclone.psyir.nodes.reference.Reference.datatype(), psyclone.psyir.nodes.structure_reference.StructureReference.datatype(), psyclone.psyir.symbols.data_type_symbol.DataTypeSymbol.datatype, psyclone.psyir.symbols.datatypes.ArrayType.datatype(), psyclone.psyir.symbols.typed_symbol.TypedSymbol.datatype, psyclone.psyir.symbols.datasymbol.DataSymbol.initial_value, psyclone.psyir.symbols.datasymbol.DataSymbol.interface, psyclone.psyir.symbols.symbol.Symbol.interface, psyclone.psyir.symbols.typed_symbol.TypedSymbol.interface, psyclone.psyir.symbols.datasymbol.DataSymbol.is_constant, 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_psy_trans.CreateNemoPSyTrans.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.allarrayaccess2loop_trans.AllArrayAccess2LoopTrans.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(), psyclone.transformations.KernelImportsToArguments.name(), and psyclone.psyir.symbols.symbol.Symbol.visibility.
def psyclone.psyir.symbols.datasymbol.DataSymbol.copy_properties | ( | self, | |
symbol_in | |||
) |
Replace all properties in this object with the properties from symbol_in, apart from the name (which is immutable) and visibility. :param symbol_in: the symbol from which the properties are copied. :type symbol_in: :py:class:`psyclone.psyir.symbols.DataSymbol` :raises TypeError: if the argument is not the expected type.
Reimplemented from psyclone.psyir.symbols.typed_symbol.TypedSymbol.
Definition at line 314 of file datasymbol.py.
References psyclone.psyir.symbols.datasymbol.DataSymbol._initial_value, and psyclone.psyir.symbols.datasymbol.DataSymbol._is_constant.
def psyclone.psyir.symbols.datasymbol.DataSymbol.initial_value | ( | self | ) |
:returns: the initial value associated with this symbol (if any). :rtype: :py:class:`psyclone.psyir.nodes.Node`
Definition at line 184 of file datasymbol.py.
References psyclone.psyir.symbols.datasymbol.DataSymbol._initial_value.
def psyclone.psyir.symbols.datasymbol.DataSymbol.initial_value | ( | self, | |
new_value | |||
) |
:param new_value: set or change the initial value associated with this DataSymbol. If the value is None then this symbol does not have an initial value (and cannot be a constant). Otherwise it can receive PSyIR expressions or Python intrinsic types available in the TYPE_MAP_TO_PYTHON map. :type new_value: Optional[item of TYPE_MAP_TO_PYTHON | :py:class:`psyclone.psyir.nodes.Node`] :raises ValueError: if a non-None value is provided and 1) this DataSymbol instance represents an argument, or 2) this DataSymbol instance is not a scalar (as the shape attribute is not empty), or 3) an initial value is provided but the type of the value is not supported, or 4) the type of the value provided is not compatible with the datatype of this DataSymbol instance, or 5) the provided PSyIR expression is unsupported. :raises ValueError: if a None value is provided and this DataSymbol represents a constant and is not imported.
Definition at line 193 of file datasymbol.py.
References psyclone.psyir.symbols.datasymbol.DataSymbol._initial_value, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.ScalarArg.datatype(), psyclone.domain.lfric.kernel.common_meta_arg_metadata.CommonMetaArgMetadata.datatype, psyclone.psyir.nodes.array_reference.ArrayReference.datatype(), psyclone.psyir.nodes.datanode.DataNode.datatype(), psyclone.psyir.nodes.literal.Literal.datatype, psyclone.psyir.nodes.operation.UnaryOperation.datatype(), psyclone.psyir.nodes.operation.BinaryOperation.datatype(), psyclone.psyir.nodes.reference.Reference.datatype(), psyclone.psyir.nodes.structure_reference.StructureReference.datatype(), psyclone.psyir.symbols.data_type_symbol.DataTypeSymbol.datatype, psyclone.psyir.symbols.datatypes.ArrayType.datatype(), psyclone.psyir.symbols.typed_symbol.TypedSymbol.datatype, psyclone.psyir.symbols.symbol.Symbol.is_argument(), psyclone.psyir.symbols.datasymbol.DataSymbol.is_constant, and psyclone.psyir.symbols.symbol.Symbol.is_import().
def psyclone.psyir.symbols.datasymbol.DataSymbol.is_constant | ( | self | ) |
:returns: Whether the symbol is a compile-time constant (True) or not (False). :rtype: bool
Definition at line 152 of file datasymbol.py.
References psyclone.psyir.symbols.datasymbol.DataSymbol._is_constant.
def psyclone.psyir.symbols.datasymbol.DataSymbol.is_constant | ( | self, | |
value | |||
) |
:param bool value: whether or not this symbol is a compile-time constant. :raises ValueError: if `value` is True but this symbol does not have an initial value or an import or unresolved interface.
Definition at line 161 of file datasymbol.py.
References psyclone.psyir.symbols.datasymbol.DataSymbol._is_constant, psyclone.domain.gocean.kernel.psyir.GOceanKernelMetadata.ScalarArg.datatype(), psyclone.domain.lfric.kernel.common_meta_arg_metadata.CommonMetaArgMetadata.datatype, psyclone.psyir.nodes.array_reference.ArrayReference.datatype(), psyclone.psyir.nodes.datanode.DataNode.datatype(), psyclone.psyir.nodes.literal.Literal.datatype, psyclone.psyir.nodes.operation.UnaryOperation.datatype(), psyclone.psyir.nodes.operation.BinaryOperation.datatype(), psyclone.psyir.nodes.reference.Reference.datatype(), psyclone.psyir.nodes.structure_reference.StructureReference.datatype(), psyclone.psyir.symbols.data_type_symbol.DataTypeSymbol.datatype, psyclone.psyir.symbols.datatypes.ArrayType.datatype(), psyclone.psyir.symbols.typed_symbol.TypedSymbol.datatype, psyclone.psyir.symbols.datasymbol.DataSymbol.initial_value, psyclone.psyir.symbols.symbol.Symbol.is_import(), and psyclone.psyir.symbols.symbol.Symbol.is_unresolved().