gt4py.cartesian.gtc package

Subpackages

Submodules

gt4py.cartesian.gtc.common module

class gt4py.cartesian.gtc.common.ArithmeticOperator(value)[source]

Bases: gt4py.eve.type_definitions.StrEnum

Arithmetic operators.

ADD = '+'
DIV = '/'
MATMULT = '@'
MUL = '*'
SUB = '-'
class gt4py.cartesian.gtc.common.AssignStmt(*, left: gt4py.cartesian.gtc.common.TargetT, right: gt4py.cartesian.gtc.common.ExprT)[source]

Bases: gt4py.eve.concepts.GenericNode, Generic[gt4py.cartesian.gtc.common.TargetT, gt4py.cartesian.gtc.common.ExprT]

left: gt4py.cartesian.gtc.common.TargetT
right: gt4py.cartesian.gtc.common.ExprT
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.AssignStmt__FieldAccess_Expr(*, left: gt4py.cartesian.gtc.common.TargetT, right: gt4py.cartesian.gtc.gtir.Expr)

Bases: gt4py.cartesian.gtc.common.AssignStmt

left: gt4py.cartesian.gtc.common.TargetT
right: gt4py.cartesian.gtc.gtir.Expr
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.AssignStmt__VectorLValue_Expr(*, left: gt4py.cartesian.gtc.common.TargetT, right: gt4py.cartesian.gtc.numpy.npir.Expr)

Bases: gt4py.cartesian.gtc.common.AssignStmt

left: gt4py.cartesian.gtc.common.TargetT
right: gt4py.cartesian.gtc.numpy.npir.Expr
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.AssignStmt__union_gt4py_cartesian_gtc_cuir_cuir_scalaraccess_gt4py_cartesian_gtc_cuir_cuir_fieldaccess_gt4py_cartesian_gtc_cuir_cuir_ijcacheaccess_gt4py_cartesian_gtc_cuir_cuir_kcacheaccess_Expr(*, left: gt4py.cartesian.gtc.common.TargetT, right: gt4py.cartesian.gtc.cuir.cuir.Expr)

Bases: gt4py.cartesian.gtc.common.AssignStmt

left: gt4py.cartesian.gtc.common.TargetT
right: gt4py.cartesian.gtc.cuir.cuir.Expr
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.AssignStmt__union_gt4py_cartesian_gtc_daceir_scalaraccess_gt4py_cartesian_gtc_daceir_indexaccess_Expr(*, left: gt4py.cartesian.gtc.common.TargetT, right: gt4py.cartesian.gtc.daceir.Expr)

Bases: gt4py.cartesian.gtc.common.AssignStmt

left: gt4py.cartesian.gtc.common.TargetT
right: gt4py.cartesian.gtc.daceir.Expr
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.AssignStmt__union_gt4py_cartesian_gtc_gtcpp_gtcpp_localaccess_gt4py_cartesian_gtc_gtcpp_gtcpp_accessorref_Expr(*, left: gt4py.cartesian.gtc.common.TargetT, right: gt4py.cartesian.gtc.gtcpp.gtcpp.Expr)

Bases: gt4py.cartesian.gtc.common.AssignStmt

left: gt4py.cartesian.gtc.common.TargetT
right: gt4py.cartesian.gtc.gtcpp.gtcpp.Expr
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.AssignStmt__union_gt4py_cartesian_gtc_oir_scalaraccess_gt4py_cartesian_gtc_oir_fieldaccess_Expr(*, left: gt4py.cartesian.gtc.common.TargetT, right: gt4py.cartesian.gtc.oir.Expr)

Bases: gt4py.cartesian.gtc.common.AssignStmt

left: gt4py.cartesian.gtc.common.TargetT
right: gt4py.cartesian.gtc.oir.Expr
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.AssignmentKind(value)[source]

Bases: gt4py.eve.type_definitions.StrEnum

Kind of assignment: plain or combined with operations.

ADD = '+='
DIV = '/='
MUL = '*='
PLAIN = '='
SUB = '-='
class gt4py.cartesian.gtc.common.AxisBound(*, level: gt4py.cartesian.gtc.common.LevelMarker, offset: int = 0)[source]

Bases: gt4py.eve.concepts.Node

classmethod end(offset: int = 0) gt4py.cartesian.gtc.common.AxisBound[source]
classmethod from_end(offset: int) gt4py.cartesian.gtc.common.AxisBound[source]
classmethod from_start(offset: int) gt4py.cartesian.gtc.common.AxisBound[source]
level: gt4py.cartesian.gtc.common.LevelMarker
offset: int
classmethod start(offset: int = 0) gt4py.cartesian.gtc.common.AxisBound[source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.BinaryOp(*, op: Union[gt4py.cartesian.gtc.common.ArithmeticOperator, gt4py.cartesian.gtc.common.ComparisonOperator, gt4py.cartesian.gtc.common.LogicalOperator], left: gt4py.cartesian.gtc.common.ExprT, right: gt4py.cartesian.gtc.common.ExprT)[source]

Bases: gt4py.eve.concepts.GenericNode, Generic[gt4py.cartesian.gtc.common.ExprT]

Generic binary operation with type propagation.

The generic BinaryOp already contains logic for - strict type checking if the dtype for left and right is set. - type propagation (taking operator type into account).

classmethod kind_propagation(instance: gt4py.cartesian.gtc.common.BinaryOp) None[source]
left: gt4py.cartesian.gtc.common.ExprT
op: Union[gt4py.cartesian.gtc.common.ArithmeticOperator, gt4py.cartesian.gtc.common.ComparisonOperator, gt4py.cartesian.gtc.common.LogicalOperator]
right: gt4py.cartesian.gtc.common.ExprT
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.BinaryOp__Expr(*, op: Union[gt4py.cartesian.gtc.common.ArithmeticOperator, gt4py.cartesian.gtc.common.ComparisonOperator, gt4py.cartesian.gtc.common.LogicalOperator], left: gt4py.cartesian.gtc.common.ExprT, right: gt4py.cartesian.gtc.numpy.npir.Expr)

Bases: gt4py.cartesian.gtc.common.BinaryOp

left: gt4py.cartesian.gtc.common.ExprT
right: gt4py.cartesian.gtc.numpy.npir.Expr
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.BlockStmt(*, body: List[gt4py.cartesian.gtc.common.StmtT])[source]

Bases: gt4py.eve.concepts.GenericNode, gt4py.eve.traits.SymbolTableTrait, Generic[gt4py.cartesian.gtc.common.StmtT]

body: List[gt4py.cartesian.gtc.common.StmtT]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.BlockStmt__Stmt(*, body: List[gt4py.cartesian.gtc.gtcpp.gtcpp.Stmt])

Bases: gt4py.cartesian.gtc.common.BlockStmt

body: List[gt4py.cartesian.gtc.gtcpp.gtcpp.Stmt]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.BuiltInLiteral(value)[source]

Bases: gt4py.eve.type_definitions.StrEnum

An enumeration.

FALSE = 'false'
MAX_VALUE = 'max'
MIN_VALUE = 'min'
ONE = 'one'
TRUE = 'true'
ZERO = 'zero'
class gt4py.cartesian.gtc.common.CartesianOffset(*, i: int, j: int, k: int)[source]

Bases: gt4py.eve.concepts.Node

i: int
j: int
k: int
to_dict() Dict[str, int][source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

classmethod zero() gt4py.cartesian.gtc.common.CartesianOffset[source]
class gt4py.cartesian.gtc.common.Cast(*, dtype: gt4py.cartesian.gtc.common.DataType, expr: gt4py.cartesian.gtc.common.ExprT)[source]

Bases: gt4py.eve.concepts.GenericNode, Generic[gt4py.cartesian.gtc.common.ExprT]

dtype: gt4py.cartesian.gtc.common.DataType
expr: gt4py.cartesian.gtc.common.ExprT
classmethod kind_propagation(instance: gt4py.cartesian.gtc.common.Cast) None[source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.Cast__Expr(*, dtype: gt4py.cartesian.gtc.common.DataType, expr: gt4py.cartesian.gtc.numpy.npir.Expr)

Bases: gt4py.cartesian.gtc.common.Cast

expr: gt4py.cartesian.gtc.numpy.npir.Expr
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.ComparisonOperator(value)[source]

Bases: gt4py.eve.type_definitions.StrEnum

Comparison operators.

EQ = '=='
GE = '>='
GT = '>'
LE = '<='
LT = '<'
NE = '!='
class gt4py.cartesian.gtc.common.DataType(value)[source]

Bases: enum.IntEnum

Data type identifier.

AUTO = 0
BOOL = 10
DEFAULT = 1
FLOAT32 = 104
FLOAT64 = 108
INT16 = 12
INT32 = 14
INT64 = 18
INT8 = 11
INVALID = -1
isbool()[source]
isfloat()[source]
isinteger()[source]
class gt4py.cartesian.gtc.common.Expr(*args: typing_extensions.Any, **kwargs: typing_extensions.Any)[source]

Bases: gt4py.cartesian.gtc.common.LocNode

Expression base class.

All expressions have - an optional dtype - an expression kind (scalar or field)

dtype: gt4py.cartesian.gtc.common.DataType
kind: gt4py.cartesian.gtc.common.ExprKind
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.ExprKind(value)[source]

Bases: enum.IntEnum

An enumeration.

FIELD: gt4py.cartesian.gtc.common.ExprKind = 2
SCALAR: gt4py.cartesian.gtc.common.ExprKind = 1
class gt4py.cartesian.gtc.common.FieldAccess(*, name: Any, offset: Union[gt4py.cartesian.gtc.common.CartesianOffset, gt4py.cartesian.gtc.common.VariableKOffsetT], data_index: List[gt4py.cartesian.gtc.common.ExprT] = NOTHING, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD)[source]

Bases: gt4py.eve.concepts.GenericNode, Generic[gt4py.cartesian.gtc.common.ExprT, gt4py.cartesian.gtc.common.VariableKOffsetT]

classmethod centered(*, name: str, loc: Optional[gt4py.eve.concepts.SourceLocation] = None) gt4py.cartesian.gtc.common.FieldAccess[source]
data_index: List[gt4py.cartesian.gtc.common.ExprT]
data_index_exprs_are_int(attribute: attr._make.Attribute, value: Any) None[source]
kind: gt4py.cartesian.gtc.common.ExprKind
name: gt4py.eve.concepts.SymbolRef
offset: Union[gt4py.cartesian.gtc.common.CartesianOffset, gt4py.cartesian.gtc.common.VariableKOffsetT]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.FieldAccess__Expr_VariableKOffset(*, name: Any, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, offset: Union[gt4py.cartesian.gtc.common.CartesianOffset, gt4py.cartesian.gtc.common.VariableKOffsetT], data_index: List[gt4py.cartesian.gtc.gtcpp.gtcpp.Expr] = NOTHING)

Bases: gt4py.cartesian.gtc.common.FieldAccess

data_index: List[gt4py.cartesian.gtc.gtcpp.gtcpp.Expr]
offset: Union[gt4py.cartesian.gtc.common.CartesianOffset, gt4py.cartesian.gtc.common.VariableKOffsetT]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

exception gt4py.cartesian.gtc.common.GTCPostconditionError(*, expected: str, **kwargs: Any)[source]

Bases: gt4py.eve.exceptions.EveError, RuntimeError

info: Dict[str, Any]
message_template = 'GTC pass postcondition error: [{info}]'
exception gt4py.cartesian.gtc.common.GTCPreconditionError(*, expected: str, **kwargs: Any)[source]

Bases: gt4py.eve.exceptions.EveError, RuntimeError

info: Dict[str, Any]
message_template = 'GTC pass precondition error: [{info}]'
class gt4py.cartesian.gtc.common.HorizontalInterval(*, start: Optional[gt4py.cartesian.gtc.common.AxisBound], end: Optional[gt4py.cartesian.gtc.common.AxisBound])[source]

Bases: gt4py.eve.concepts.Node

Represents an interval of the index space in the horizontal.

This is separate from gtir.Interval because the endpoints may be outside the compute domain.

classmethod at_endpt(level: gt4py.cartesian.gtc.common.LevelMarker, start_offset: int, end_offset: Optional[int] = None) gt4py.cartesian.gtc.common.HorizontalInterval[source]
classmethod check_start_before_end(instance: gt4py.cartesian.gtc.common.HorizontalInterval) None[source]
classmethod compute_domain(start_offset: int = 0, end_offset: int = 0) gt4py.cartesian.gtc.common.HorizontalInterval[source]
end: Optional[gt4py.cartesian.gtc.common.AxisBound]
classmethod full() gt4py.cartesian.gtc.common.HorizontalInterval[source]
is_single_index() bool[source]
overlaps(other: gt4py.cartesian.gtc.common.HorizontalInterval) bool[source]
start: Optional[gt4py.cartesian.gtc.common.AxisBound]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.HorizontalMask(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, i: gt4py.cartesian.gtc.common.HorizontalInterval, j: gt4py.cartesian.gtc.common.HorizontalInterval)[source]

Bases: gt4py.cartesian.gtc.common.LocNode

Expr to represent a convex portion of the horizontal iteration space.

i: gt4py.cartesian.gtc.common.HorizontalInterval
property intervals: Tuple[gt4py.cartesian.gtc.common.HorizontalInterval, gt4py.cartesian.gtc.common.HorizontalInterval]
j: gt4py.cartesian.gtc.common.HorizontalInterval
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.HorizontalRestriction(*, mask: gt4py.cartesian.gtc.common.HorizontalMask, body: List[gt4py.cartesian.gtc.common.StmtT])[source]

Bases: gt4py.eve.concepts.GenericNode, Generic[gt4py.cartesian.gtc.common.StmtT]

A specialization of the horizontal space.

body: List[gt4py.cartesian.gtc.common.StmtT]
mask: gt4py.cartesian.gtc.common.HorizontalMask
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.HorizontalRestriction__Stmt(*, mask: gt4py.cartesian.gtc.common.HorizontalMask, body: List[gt4py.cartesian.gtc.daceir.Stmt])

Bases: gt4py.cartesian.gtc.common.HorizontalRestriction

body: List[gt4py.cartesian.gtc.daceir.Stmt]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.IfStmt(*, cond: gt4py.cartesian.gtc.common.ExprT, true_branch: gt4py.cartesian.gtc.common.StmtT, false_branch: Optional[gt4py.cartesian.gtc.common.StmtT] = None)[source]

Bases: gt4py.eve.concepts.GenericNode, Generic[gt4py.cartesian.gtc.common.StmtT, gt4py.cartesian.gtc.common.ExprT]

Generic if statement.

Verifies that cond is a boolean expr (if dtype is set).

cond: gt4py.cartesian.gtc.common.ExprT
condition_is_boolean(attribute: attr._make.Attribute, value: gt4py.cartesian.gtc.common.Expr) None[source]
false_branch: Optional[gt4py.cartesian.gtc.common.StmtT]
true_branch: gt4py.cartesian.gtc.common.StmtT
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.IfStmt__BlockStmt_Expr(*, cond: gt4py.cartesian.gtc.common.ExprT, true_branch: gt4py.cartesian.gtc.common.StmtT, false_branch: Optional[gt4py.cartesian.gtc.gtcpp.gtcpp.BlockStmt] = None)

Bases: gt4py.cartesian.gtc.common.IfStmt

cond: gt4py.cartesian.gtc.common.ExprT
false_branch: Optional[gt4py.cartesian.gtc.gtcpp.gtcpp.BlockStmt]
true_branch: gt4py.cartesian.gtc.common.StmtT
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.LevelMarker(value)[source]

Bases: gt4py.eve.type_definitions.StrEnum

An enumeration.

END = 'end'
START = 'start'
class gt4py.cartesian.gtc.common.Literal(*, value: Union[gt4py.cartesian.gtc.common.BuiltInLiteral, str], dtype: gt4py.cartesian.gtc.common.DataType, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.SCALAR)[source]

Bases: gt4py.eve.concepts.Node

dtype: gt4py.cartesian.gtc.common.DataType
kind: gt4py.cartesian.gtc.common.ExprKind
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

value: Union[gt4py.cartesian.gtc.common.BuiltInLiteral, str]
class gt4py.cartesian.gtc.common.LocNode(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None)[source]

Bases: gt4py.eve.concepts.Node

loc: Optional[gt4py.eve.concepts.SourceLocation]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.LogicalOperator(value)[source]

Bases: gt4py.eve.type_definitions.StrEnum

Logical operators.

AND = 'and'
OR = 'or'
class gt4py.cartesian.gtc.common.LoopOrder(value)[source]

Bases: gt4py.eve.type_definitions.StrEnum

Loop order identifier.

BACKWARD = 'backward'
FORWARD = 'forward'
PARALLEL = 'parallel'
class gt4py.cartesian.gtc.common.NativeFuncCall(*, func: gt4py.cartesian.gtc.common.NativeFunction, args: List[gt4py.cartesian.gtc.common.ExprT])[source]

Bases: gt4py.eve.concepts.GenericNode, Generic[gt4py.cartesian.gtc.common.ExprT]

args: List[gt4py.cartesian.gtc.common.ExprT]
classmethod arity_check(instance: gt4py.cartesian.gtc.common.NativeFuncCall) None[source]
func: gt4py.cartesian.gtc.common.NativeFunction
classmethod kind_propagation(instance: gt4py.cartesian.gtc.common.NativeFuncCall) None[source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.NativeFuncCall__Expr(*, func: gt4py.cartesian.gtc.common.NativeFunction, args: List[gt4py.cartesian.gtc.numpy.npir.Expr])

Bases: gt4py.cartesian.gtc.common.NativeFuncCall

args: List[gt4py.cartesian.gtc.numpy.npir.Expr]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.NativeFunction(value)[source]

Bases: gt4py.eve.type_definitions.StrEnum

An enumeration.

ABS = 'abs'
ARCCOS = 'arccos'
ARCCOSH = 'arccosh'
ARCSIN = 'arcsin'
ARCSINH = 'arcsinh'
ARCTAN = 'arctan'
ARCTANH = 'arctanh'
CBRT = 'cbrt'
CEIL = 'ceil'
COS = 'cos'
COSH = 'cosh'
EXP = 'exp'
FLOOR = 'floor'
GAMMA = 'gamma'
IR_OP_TO_NUM_ARGS: ClassVar[Dict[gt4py.cartesian.gtc.common.NativeFunction, int]] = {NativeFunction.ABS: 1, NativeFunction.ARCCOS: 1, NativeFunction.ARCCOSH: 1, NativeFunction.ARCSIN: 1, NativeFunction.ARCSINH: 1, NativeFunction.ARCTAN: 1, NativeFunction.ARCTANH: 1, NativeFunction.CBRT: 1, NativeFunction.CEIL: 1, NativeFunction.COS: 1, NativeFunction.COSH: 1, NativeFunction.EXP: 1, NativeFunction.FLOOR: 1, NativeFunction.GAMMA: 1, NativeFunction.ISFINITE: 1, NativeFunction.ISINF: 1, NativeFunction.ISNAN: 1, NativeFunction.LOG: 1, NativeFunction.MAX: 2, NativeFunction.MIN: 2, NativeFunction.MOD: 2, NativeFunction.POW: 2, NativeFunction.SIN: 1, NativeFunction.SINH: 1, NativeFunction.SQRT: 1, NativeFunction.TAN: 1, NativeFunction.TANH: 1, NativeFunction.TRUNC: 1}
ISFINITE = 'isfinite'
ISINF = 'isinf'
ISNAN = 'isnan'
LOG = 'log'
MAX = 'max'
MIN = 'min'
MOD = 'mod'
POW = 'pow'
SIN = 'sin'
SINH = 'sinh'
SQRT = 'sqrt'
TAN = 'tan'
TANH = 'tanh'
TRUNC = 'trunc'
property arity: int
class gt4py.cartesian.gtc.common.ScalarAccess(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.SCALAR)[source]

Bases: gt4py.cartesian.gtc.common.LocNode

kind: gt4py.cartesian.gtc.common.ExprKind
name: gt4py.eve.concepts.SymbolRef
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.Stmt(*args: typing_extensions.Any, **kwargs: typing_extensions.Any)[source]

Bases: gt4py.cartesian.gtc.common.LocNode

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.TernaryOp(*, cond: gt4py.cartesian.gtc.common.ExprT, true_expr: gt4py.cartesian.gtc.common.ExprT, false_expr: gt4py.cartesian.gtc.common.ExprT)[source]

Bases: gt4py.eve.concepts.GenericNode, Generic[gt4py.cartesian.gtc.common.ExprT]

Generic ternary operation with type propagation.

The generic TernaryOp already contains logic for - strict type checking if the dtype for true_expr and false_expr is set. - type checking for cond - type propagation.

cond: gt4py.cartesian.gtc.common.ExprT
condition_is_boolean(attribute: attr._make.Attribute, value: gt4py.cartesian.gtc.common.Expr) None[source]
false_expr: gt4py.cartesian.gtc.common.ExprT
classmethod kind_propagation(instance: gt4py.cartesian.gtc.common.TernaryOp) None[source]
true_expr: gt4py.cartesian.gtc.common.ExprT
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.TernaryOp__Expr(*, cond: gt4py.cartesian.gtc.common.ExprT, true_expr: gt4py.cartesian.gtc.common.ExprT, false_expr: gt4py.cartesian.gtc.numpy.npir.Expr)

Bases: gt4py.cartesian.gtc.common.TernaryOp

cond: gt4py.cartesian.gtc.common.ExprT
false_expr: gt4py.cartesian.gtc.numpy.npir.Expr
true_expr: gt4py.cartesian.gtc.common.ExprT
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.UnaryOp(*, op: gt4py.cartesian.gtc.common.UnaryOperator, expr: gt4py.cartesian.gtc.common.ExprT)[source]

Bases: gt4py.eve.concepts.GenericNode, Generic[gt4py.cartesian.gtc.common.ExprT]

Generic unary operation with type propagation.

The generic UnaryOp already contains logic for type propagation.

classmethod dtype_propagation(instance: gt4py.cartesian.gtc.common.UnaryOp) None[source]
expr: gt4py.cartesian.gtc.common.ExprT
classmethod kind_propagation(instance: gt4py.cartesian.gtc.common.UnaryOp) None[source]
op: gt4py.cartesian.gtc.common.UnaryOperator
classmethod op_to_dtype_check(instance: gt4py.cartesian.gtc.common.UnaryOp) None[source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.UnaryOp__Expr(*, op: gt4py.cartesian.gtc.common.UnaryOperator, expr: gt4py.cartesian.gtc.numpy.npir.Expr)

Bases: gt4py.cartesian.gtc.common.UnaryOp

expr: gt4py.cartesian.gtc.numpy.npir.Expr
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.UnaryOperator(value)[source]

Bases: gt4py.eve.type_definitions.StrEnum

Unary operator indentifier.

NEG = '-'
NOT = 'not'
POS = '+'
class gt4py.cartesian.gtc.common.VariableKOffset(*, k: gt4py.cartesian.gtc.common.ExprT)[source]

Bases: gt4py.eve.concepts.GenericNode, Generic[gt4py.cartesian.gtc.common.ExprT]

k: gt4py.cartesian.gtc.common.ExprT
offset_expr_is_int(attribute: attr._make.Attribute, value: Any) None[source]
to_dict() Dict[str, Optional[int]][source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.VariableKOffset__Expr(*, k: gt4py.cartesian.gtc.numpy.npir.Expr)

Bases: gt4py.cartesian.gtc.common.VariableKOffset

k: gt4py.cartesian.gtc.numpy.npir.Expr
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.While(*, cond: gt4py.cartesian.gtc.common.ExprT, body: List[gt4py.cartesian.gtc.common.StmtT])[source]

Bases: gt4py.eve.concepts.GenericNode, Generic[gt4py.cartesian.gtc.common.StmtT, gt4py.cartesian.gtc.common.ExprT]

Generic while loop.

Verifies that cond is a boolean expr (if dtype is set).

body: List[gt4py.cartesian.gtc.common.StmtT]
cond: gt4py.cartesian.gtc.common.ExprT
condition_is_boolean(attribute: attr._make.Attribute, value: gt4py.cartesian.gtc.common.Expr) None[source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.common.While__Stmt_Expr(*, cond: gt4py.cartesian.gtc.common.ExprT, body: List[gt4py.cartesian.gtc.numpy.npir.Stmt])

Bases: gt4py.cartesian.gtc.common.While

body: List[gt4py.cartesian.gtc.numpy.npir.Stmt]
cond: gt4py.cartesian.gtc.common.ExprT
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

gt4py.cartesian.gtc.common.assign_stmt_dtype_validation(*, strict: bool) collections.abc.Callable[[type[_DM], gt4py.eve.datamodels.core._DM], None][source]
gt4py.cartesian.gtc.common.binary_op_dtype_propagation(*, strict: bool) collections.abc.Callable[[type[_DM], gt4py.eve.datamodels.core._DM], None][source]
gt4py.cartesian.gtc.common.compute_kind(*values: gt4py.cartesian.gtc.common.Expr) gt4py.cartesian.gtc.common.ExprKind[source]
gt4py.cartesian.gtc.common.data_type_to_typestr(dtype: gt4py.cartesian.gtc.common.DataType) str[source]
gt4py.cartesian.gtc.common.native_func_call_dtype_propagation(*, strict: bool = True) collections.abc.Callable[[type[_DM], gt4py.eve.datamodels.core._DM], None][source]
gt4py.cartesian.gtc.common.op_to_ufunc(op: Union[gt4py.cartesian.gtc.common.UnaryOperator, gt4py.cartesian.gtc.common.ArithmeticOperator, gt4py.cartesian.gtc.common.ComparisonOperator, gt4py.cartesian.gtc.common.LogicalOperator, gt4py.cartesian.gtc.common.NativeFunction]) numpy.ufunc[source]
gt4py.cartesian.gtc.common.ternary_op_dtype_propagation(*, strict: bool) collections.abc.Callable[[type[_DM], gt4py.eve.datamodels.core._DM], None][source]
gt4py.cartesian.gtc.common.typestr_to_data_type(typestr: str) gt4py.cartesian.gtc.common.DataType[source]
gt4py.cartesian.gtc.common.validate_dtype_is_set() collections.abc.Callable[[type[_DM], gt4py.eve.datamodels.core._DM], None][source]
gt4py.cartesian.gtc.common.validate_lvalue_dims(vertical_loop_type: Type[gt4py.eve.concepts.Node], decl_type: Type[gt4py.eve.concepts.Node]) collections.abc.Callable[[type[_DM], gt4py.eve.datamodels.core._DM], None][source]

Validate lvalue dimensions using the root node symbol table.

The following tree structure is expected:

Root(`SymTableTrait`)
|- *
   |- `vertical_loop_type`
       |- loop_order: `LoopOrder`
       |- *
          |- AssignStmt(`AssignStmt`)
          |- left: `Node`, validated only if reference to `decl_type` in symtable
|- symtable_: Symtable[name, Union[`decl_type`, *]]

DeclType
|- dimensions: `Tuple[bool, bool, bool]`
Parameters
  • vertical_loop_type – A node type with an LoopOrder attribute named loop_order

  • decl_type – A declaration type with field dimension information in the format Tuple[bool, bool, bool] in an attribute named dimensions.

gt4py.cartesian.gtc.common.verify_and_get_common_dtype(node_cls: Type[gt4py.eve.datamodels.core.DataModel], exprs: List[gt4py.cartesian.gtc.common.Expr], *, strict: bool = True) Optional[gt4py.cartesian.gtc.common.DataType][source]
gt4py.cartesian.gtc.common.verify_condition_is_boolean(parent_node_cls: gt4py.eve.datamodels.core.DataModel, cond: gt4py.cartesian.gtc.common.Expr) None[source]

gt4py.cartesian.gtc.daceir module

class gt4py.cartesian.gtc.daceir.AssignStmt(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, left: gt4py.cartesian.gtc.common.TargetT, right: gt4py.cartesian.gtc.daceir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.AssignStmt__union_gt4py_cartesian_gtc_daceir_scalaraccess_gt4py_cartesian_gtc_daceir_indexaccess_Expr[Union[gt4py.cartesian.gtc.daceir.ScalarAccess, gt4py.cartesian.gtc.daceir.IndexAccess], gt4py.cartesian.gtc.daceir.Expr], gt4py.cartesian.gtc.daceir.Stmt

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.Axis(value)[source]

Bases: gt4py.eve.type_definitions.StrEnum

An enumeration.

I = 'I'
J = 'J'
K = 'K'
static dims_3d() Generator[gt4py.cartesian.gtc.daceir.Axis, None, None][source]
static dims_horizontal() Generator[gt4py.cartesian.gtc.daceir.Axis, None, None][source]
domain_dace_symbol()[source]
domain_symbol() gt4py.eve.concepts.SymbolRef[source]
iteration_dace_symbol()[source]
iteration_symbol() gt4py.eve.concepts.SymbolRef[source]
tile_dace_symbol()[source]
tile_symbol() gt4py.eve.concepts.SymbolRef[source]
to_idx() int[source]
class gt4py.cartesian.gtc.daceir.AxisBound(*, level: gt4py.cartesian.gtc.common.LevelMarker, offset: int = 0, axis: gt4py.cartesian.gtc.daceir.Axis)[source]

Bases: gt4py.cartesian.gtc.common.AxisBound

axis: gt4py.cartesian.gtc.daceir.Axis
classmethod from_common(axis, node)[source]
to_dace_symbolic()[source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.BinaryOp(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, dtype: gt4py.cartesian.gtc.common.DataType, op: Union[gt4py.cartesian.gtc.common.ArithmeticOperator, gt4py.cartesian.gtc.common.ComparisonOperator, gt4py.cartesian.gtc.common.LogicalOperator], left: gt4py.cartesian.gtc.common.ExprT, right: gt4py.cartesian.gtc.daceir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.BinaryOp__Expr[gt4py.cartesian.gtc.daceir.Expr], gt4py.cartesian.gtc.daceir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.Cast(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, dtype: gt4py.cartesian.gtc.common.DataType, expr: gt4py.cartesian.gtc.daceir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.Cast__Expr[gt4py.cartesian.gtc.daceir.Expr], gt4py.cartesian.gtc.daceir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.ComputationNode(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, read_memlets: List[gt4py.cartesian.gtc.daceir.Memlet], write_memlets: List[gt4py.cartesian.gtc.daceir.Memlet])[source]

Bases: gt4py.cartesian.gtc.common.LocNode

property input_connectors
property output_connectors
property read_fields
read_memlets: List[gt4py.cartesian.gtc.daceir.Memlet]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

property write_fields
write_memlets: List[gt4py.cartesian.gtc.daceir.Memlet]
class gt4py.cartesian.gtc.daceir.ComputationState(*, grid_subset: gt4py.cartesian.gtc.daceir.GridSubset, computations: List[Union[gt4py.cartesian.gtc.daceir.Tasklet, gt4py.cartesian.gtc.daceir.DomainMap]])[source]

Bases: gt4py.cartesian.gtc.daceir.IterationNode

computations: List[Union[gt4py.cartesian.gtc.daceir.Tasklet, gt4py.cartesian.gtc.daceir.DomainMap]]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.Decl(*args: Any, **kwargs: Any)[source]

Bases: gt4py.cartesian.gtc.common.LocNode

dtype: gt4py.cartesian.gtc.common.DataType
name: gt4py.eve.concepts.SymbolName
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.DomainInterval(*, start: gt4py.cartesian.gtc.daceir.AxisBound, end: gt4py.cartesian.gtc.daceir.AxisBound)[source]

Bases: gt4py.eve.concepts.Node

end: gt4py.cartesian.gtc.daceir.AxisBound
property free_symbols: Set[gt4py.eve.concepts.SymbolRef]
property idx_range
classmethod intersection(axis, first, second)[source]
is_subset_of(other: gt4py.cartesian.gtc.daceir.DomainInterval) bool[source]
property overapproximated_size
shifted(offset: int)[source]
property size
start: gt4py.cartesian.gtc.daceir.AxisBound
to_dace_symbolic()[source]
classmethod union(first, second)[source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.DomainLoop(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, read_memlets: List[gt4py.cartesian.gtc.daceir.Memlet], write_memlets: List[gt4py.cartesian.gtc.daceir.Memlet], grid_subset: gt4py.cartesian.gtc.daceir.GridSubset, axis: gt4py.cartesian.gtc.daceir.Axis, index_range: gt4py.cartesian.gtc.daceir.Range, loop_states: List[Union[ComputationState, DomainLoop]])[source]

Bases: gt4py.cartesian.gtc.daceir.IterationNode, gt4py.cartesian.gtc.daceir.ComputationNode

axis: gt4py.cartesian.gtc.daceir.Axis
index_range: gt4py.cartesian.gtc.daceir.Range
loop_states: List[Union[gt4py.cartesian.gtc.daceir.ComputationState, gt4py.cartesian.gtc.daceir.DomainLoop]]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.DomainMap(*, grid_subset: gt4py.cartesian.gtc.daceir.GridSubset, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, read_memlets: List[gt4py.cartesian.gtc.daceir.Memlet], write_memlets: List[gt4py.cartesian.gtc.daceir.Memlet], index_ranges: List[gt4py.cartesian.gtc.daceir.Range], schedule: gt4py.cartesian.gtc.daceir.MapSchedule, computations: List[Union[Tasklet, DomainMap, NestedSDFG]])[source]

Bases: gt4py.cartesian.gtc.daceir.ComputationNode, gt4py.cartesian.gtc.daceir.IterationNode

computations: List[Union[gt4py.cartesian.gtc.daceir.Tasklet, gt4py.cartesian.gtc.daceir.DomainMap, gt4py.cartesian.gtc.daceir.NestedSDFG]]
index_ranges: List[gt4py.cartesian.gtc.daceir.Range]
schedule: gt4py.cartesian.gtc.daceir.MapSchedule
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.Expr(*args: typing_extensions.Any, **kwargs: typing_extensions.Any)[source]

Bases: gt4py.cartesian.gtc.common.Expr

dtype: gt4py.cartesian.gtc.common.DataType
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.FieldAccessInfo(*, grid_subset: gt4py.cartesian.gtc.daceir.GridSubset, global_grid_subset: gt4py.cartesian.gtc.daceir.GridSubset, dynamic_access: bool = False, variable_offset_axes: List[gt4py.cartesian.gtc.daceir.Axis] = NOTHING)[source]

Bases: gt4py.eve.concepts.Node

apply_iteration(grid_subset: gt4py.cartesian.gtc.daceir.GridSubset)[source]
axes()[source]
clamp_full_axis(axis)[source]
dynamic_access: bool
global_grid_subset: gt4py.cartesian.gtc.daceir.GridSubset
grid_subset: gt4py.cartesian.gtc.daceir.GridSubset
property is_dynamic: bool
property overapproximated_shape
restricted_to_index(axis: gt4py.cartesian.gtc.daceir.Axis, extent: Tuple[int, int] = (0, 0))[source]
property shape
union(other: gt4py.cartesian.gtc.daceir.FieldAccessInfo)[source]
untile(tile_axes: Sequence[gt4py.cartesian.gtc.daceir.Axis]) gt4py.cartesian.gtc.daceir.FieldAccessInfo[source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

variable_offset_axes: List[gt4py.cartesian.gtc.daceir.Axis]
class gt4py.cartesian.gtc.daceir.FieldDecl(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, dtype: gt4py.cartesian.gtc.common.DataType, strides: Tuple[Union[int, str], ...], data_dims: Tuple[int, ...] = NOTHING, access_info: gt4py.cartesian.gtc.daceir.FieldAccessInfo, storage: gt4py.cartesian.gtc.daceir.StorageType)[source]

Bases: gt4py.cartesian.gtc.daceir.Decl

access_info: gt4py.cartesian.gtc.daceir.FieldAccessInfo
axes()[source]
data_dims: Tuple[int, ...]
property is_dynamic: bool
property shape
storage: gt4py.cartesian.gtc.daceir.StorageType
strides: Tuple[Union[int, str], ...]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

with_set_access_info(access_info: gt4py.cartesian.gtc.daceir.FieldAccessInfo) gt4py.cartesian.gtc.daceir.FieldDecl[source]
class gt4py.cartesian.gtc.daceir.GridSubset(*, intervals: Dict[gt4py.cartesian.gtc.daceir.Axis, Union[gt4py.cartesian.gtc.daceir.DomainInterval, gt4py.cartesian.gtc.daceir.TileInterval, gt4py.cartesian.gtc.daceir.IndexWithExtent]])[source]

Bases: gt4py.eve.concepts.Node

axes()[source]
property free_symbols: Set[gt4py.eve.concepts.SymbolRef]
classmethod from_gt4py_extent(extent: gt4py.cartesian.gtc.definitions.Extent)[source]
classmethod from_interval(interval: Union[gt4py.cartesian.gtc.oir.Interval, gt4py.cartesian.gtc.daceir.TileInterval, gt4py.cartesian.gtc.daceir.DomainInterval, gt4py.cartesian.gtc.daceir.IndexWithExtent], axis: gt4py.cartesian.gtc.daceir.Axis)[source]
classmethod full_domain(axes=None)[source]
intervals: Dict[gt4py.cartesian.gtc.daceir.Axis, Union[gt4py.cartesian.gtc.daceir.DomainInterval, gt4py.cartesian.gtc.daceir.TileInterval, gt4py.cartesian.gtc.daceir.IndexWithExtent]]
items()[source]
property overapproximated_shape
restricted_to_index(axis: gt4py.cartesian.gtc.daceir.Axis, extent=(0, 0)) gt4py.cartesian.gtc.daceir.GridSubset[source]
set_interval(axis: gt4py.cartesian.gtc.daceir.Axis, interval: Union[gt4py.cartesian.gtc.daceir.DomainInterval, gt4py.cartesian.gtc.daceir.IndexWithExtent, gt4py.cartesian.gtc.daceir.TileInterval, gt4py.cartesian.gtc.oir.Interval]) gt4py.cartesian.gtc.daceir.GridSubset[source]
property shape
classmethod single_gridpoint(offset=(0, 0, 0))[source]
tile(tile_sizes: Dict[gt4py.cartesian.gtc.daceir.Axis, int])[source]
union(other)[source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.HorizontalRestriction(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, mask: gt4py.cartesian.gtc.common.HorizontalMask, body: List[gt4py.cartesian.gtc.daceir.Stmt])[source]

Bases: gt4py.cartesian.gtc.common.HorizontalRestriction__Stmt[gt4py.cartesian.gtc.daceir.Stmt], gt4py.cartesian.gtc.daceir.Stmt

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.IndexAccess(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, dtype: gt4py.cartesian.gtc.common.DataType, name: Any, data_index: List[gt4py.cartesian.gtc.common.ExprT] = NOTHING, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, offset: Optional[Union[gt4py.cartesian.gtc.common.CartesianOffset, gt4py.cartesian.gtc.daceir.VariableKOffset]])[source]

Bases: gt4py.cartesian.gtc.common.FieldAccess, gt4py.cartesian.gtc.daceir.Expr

offset: Optional[Union[gt4py.cartesian.gtc.common.CartesianOffset, gt4py.cartesian.gtc.daceir.VariableKOffset]]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.IndexWithExtent(*, axis: gt4py.cartesian.gtc.daceir.Axis, value: Union[gt4py.cartesian.gtc.daceir.AxisBound, int, str], extent: Tuple[int, int])[source]

Bases: gt4py.eve.concepts.Node

axis: gt4py.cartesian.gtc.daceir.Axis
extent: Tuple[int, int]
property free_symbols: Set[gt4py.eve.concepts.SymbolRef]
classmethod from_axis(axis: gt4py.cartesian.gtc.daceir.Axis, extent=(0, 0))[source]
property idx_range
property overapproximated_size
shifted(offset)[source]
property size
to_dace_symbolic()[source]
union(other: gt4py.cartesian.gtc.daceir.IndexWithExtent)[source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

value: Union[gt4py.cartesian.gtc.daceir.AxisBound, int, str]
class gt4py.cartesian.gtc.daceir.IterationNode(*, grid_subset: gt4py.cartesian.gtc.daceir.GridSubset)[source]

Bases: gt4py.eve.concepts.Node

grid_subset: gt4py.cartesian.gtc.daceir.GridSubset
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.Literal(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, value: Union[gt4py.cartesian.gtc.common.BuiltInLiteral, str], dtype: gt4py.cartesian.gtc.common.DataType, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.SCALAR)[source]

Bases: gt4py.cartesian.gtc.common.Literal, gt4py.cartesian.gtc.daceir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.LocalScalarDecl(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, dtype: gt4py.cartesian.gtc.common.DataType)[source]

Bases: gt4py.cartesian.gtc.daceir.ScalarDecl

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.MapSchedule(value)[source]

Bases: enum.IntEnum

An enumeration.

CPU_Multicore = 2
Default = 0
GPU_Device = 3
GPU_ThreadBlock = 4
Sequential = 1
classmethod from_dace_schedule(schedule)[source]
to_dace_schedule()[source]
class gt4py.cartesian.gtc.daceir.MaskStmt(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, mask: gt4py.cartesian.gtc.daceir.Expr, body: List[gt4py.cartesian.gtc.daceir.Stmt])[source]

Bases: gt4py.cartesian.gtc.daceir.Stmt

body: List[gt4py.cartesian.gtc.daceir.Stmt]
mask: gt4py.cartesian.gtc.daceir.Expr
mask_is_boolean_field_expr(attribute: attr._make.Attribute, v: gt4py.cartesian.gtc.daceir.Expr) None[source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.Memlet(*, field: Any, access_info: gt4py.cartesian.gtc.daceir.FieldAccessInfo, connector: Any, is_read: bool, is_write: bool)[source]

Bases: gt4py.eve.concepts.Node

access_info: gt4py.cartesian.gtc.daceir.FieldAccessInfo
connector: gt4py.eve.concepts.SymbolRef
field: gt4py.eve.concepts.SymbolRef
is_read: bool
is_write: bool
remove_read()[source]
remove_write()[source]
union(other)[source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.NativeFuncCall(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, dtype: gt4py.cartesian.gtc.common.DataType, func: gt4py.cartesian.gtc.common.NativeFunction, args: List[gt4py.cartesian.gtc.daceir.Expr])[source]

Bases: gt4py.cartesian.gtc.common.NativeFuncCall__Expr[gt4py.cartesian.gtc.daceir.Expr], gt4py.cartesian.gtc.daceir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.NestedSDFG(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, read_memlets: List[gt4py.cartesian.gtc.daceir.Memlet], write_memlets: List[gt4py.cartesian.gtc.daceir.Memlet], label: Any, field_decls: List[gt4py.cartesian.gtc.daceir.FieldDecl], symbol_decls: List[gt4py.cartesian.gtc.daceir.SymbolDecl], states: List[Union[gt4py.cartesian.gtc.daceir.DomainLoop, gt4py.cartesian.gtc.daceir.ComputationState]])[source]

Bases: gt4py.cartesian.gtc.daceir.ComputationNode, gt4py.eve.traits.SymbolTableTrait

field_decls: List[gt4py.cartesian.gtc.daceir.FieldDecl]
label: gt4py.eve.concepts.SymbolRef
states: List[Union[gt4py.cartesian.gtc.daceir.DomainLoop, gt4py.cartesian.gtc.daceir.ComputationState]]
symbol_decls: List[gt4py.cartesian.gtc.daceir.SymbolDecl]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.Range(*, var: gt4py.eve.concepts.SymbolRef, interval: Union[gt4py.cartesian.gtc.daceir.DomainInterval, gt4py.cartesian.gtc.daceir.TileInterval], stride: int)[source]

Bases: gt4py.eve.concepts.Node

property free_symbols: Set[gt4py.eve.concepts.SymbolRef]
classmethod from_axis_and_interval(axis: gt4py.cartesian.gtc.daceir.Axis, interval: Union[gt4py.cartesian.gtc.daceir.DomainInterval, gt4py.cartesian.gtc.daceir.TileInterval], stride=1)[source]
interval: Union[gt4py.cartesian.gtc.daceir.DomainInterval, gt4py.cartesian.gtc.daceir.TileInterval]
stride: int
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

var: gt4py.eve.concepts.SymbolRef
class gt4py.cartesian.gtc.daceir.ScalarAccess(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, dtype: gt4py.cartesian.gtc.common.DataType, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.SCALAR, name: Any)[source]

Bases: gt4py.cartesian.gtc.common.ScalarAccess, gt4py.cartesian.gtc.daceir.Expr

name: gt4py.eve.concepts.SymbolRef
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.ScalarDecl(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, dtype: gt4py.cartesian.gtc.common.DataType)[source]

Bases: gt4py.cartesian.gtc.daceir.Decl

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.Stmt(*args: typing_extensions.Any, **kwargs: typing_extensions.Any)[source]

Bases: gt4py.cartesian.gtc.common.Stmt

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.StorageType(value)[source]

Bases: enum.IntEnum

An enumeration.

CPU_Heap = 1
Default = 0
GPU_Global = 3
GPU_Shared = 4
Register = 5
classmethod from_dace_storage(schedule)[source]
to_dace_storage()[source]
class gt4py.cartesian.gtc.daceir.SymbolDecl(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, dtype: gt4py.cartesian.gtc.common.DataType)[source]

Bases: gt4py.cartesian.gtc.daceir.ScalarDecl

to_dace_symbol()[source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.Tasklet(*, loc: typing.Optional[gt4py.eve.concepts.SourceLocation] = None, read_memlets: typing.List[gt4py.cartesian.gtc.daceir.Memlet], write_memlets: typing.List[gt4py.cartesian.gtc.daceir.Memlet], decls: typing.List[gt4py.cartesian.gtc.daceir.LocalScalarDecl], stmts: typing.List[gt4py.cartesian.gtc.daceir.Stmt], grid_subset: gt4py.cartesian.gtc.daceir.GridSubset = GridSubset(intervals={<Axis.I: 'I'>: IndexWithExtent(axis=<Axis.I: 'I'>, value=SymbolRef('__i'), extent=(0, 0)), <Axis.J: 'J'>: IndexWithExtent(axis=<Axis.J: 'J'>, value=SymbolRef('__j'), extent=(0, 0)), <Axis.K: 'K'>: IndexWithExtent(axis=<Axis.K: 'K'>, value=SymbolRef('__k'), extent=(0, 0))}))[source]

Bases: gt4py.cartesian.gtc.daceir.ComputationNode, gt4py.cartesian.gtc.daceir.IterationNode, gt4py.eve.traits.SymbolTableTrait

decls: List[gt4py.cartesian.gtc.daceir.LocalScalarDecl]
grid_subset: gt4py.cartesian.gtc.daceir.GridSubset
stmts: List[gt4py.cartesian.gtc.daceir.Stmt]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.Temporary(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, dtype: gt4py.cartesian.gtc.common.DataType, strides: Tuple[Union[int, str], ...], data_dims: Tuple[int, ...] = NOTHING, access_info: gt4py.cartesian.gtc.daceir.FieldAccessInfo, storage: gt4py.cartesian.gtc.daceir.StorageType)[source]

Bases: gt4py.cartesian.gtc.daceir.FieldDecl

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.TernaryOp(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, dtype: gt4py.cartesian.gtc.common.DataType, cond: gt4py.cartesian.gtc.common.ExprT, true_expr: gt4py.cartesian.gtc.common.ExprT, false_expr: gt4py.cartesian.gtc.daceir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.TernaryOp__Expr[gt4py.cartesian.gtc.daceir.Expr], gt4py.cartesian.gtc.daceir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.TileInterval(*, axis: gt4py.cartesian.gtc.daceir.Axis, start_offset: int, end_offset: int, tile_size: int, domain_limit: gt4py.cartesian.gtc.daceir.AxisBound)[source]

Bases: gt4py.eve.concepts.Node

axis: gt4py.cartesian.gtc.daceir.Axis
dace_symbolic_size()[source]
domain_limit: gt4py.cartesian.gtc.daceir.AxisBound
end_offset: int
property free_symbols: Set[gt4py.eve.concepts.SymbolRef]
property idx_range
property overapproximated_size
property size
start_offset: int
tile_size: int
to_dace_symbolic()[source]
classmethod union(first, second)[source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.UnaryOp(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, dtype: gt4py.cartesian.gtc.common.DataType, op: gt4py.cartesian.gtc.common.UnaryOperator, expr: gt4py.cartesian.gtc.daceir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.UnaryOp__Expr[gt4py.cartesian.gtc.daceir.Expr], gt4py.cartesian.gtc.daceir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.VariableKOffset(*, k: gt4py.cartesian.gtc.daceir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.VariableKOffset__Expr[gt4py.cartesian.gtc.daceir.Expr]

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.daceir.While(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, cond: gt4py.cartesian.gtc.common.ExprT, body: List[gt4py.cartesian.gtc.daceir.Stmt])[source]

Bases: gt4py.cartesian.gtc.common.While__Stmt_Expr[gt4py.cartesian.gtc.daceir.Stmt, gt4py.cartesian.gtc.daceir.Expr], gt4py.cartesian.gtc.daceir.Stmt

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

gt4py.cartesian.gtc.definitions module

class gt4py.cartesian.gtc.definitions.Boundary(ranges, *args, ndims=None)[source]

Bases: gt4py.cartesian.gtc.definitions.FrameTuple

Frame size around one central origin (pairs of integers).

Negative numbers represent a boundary region substracting from the wrapped area.

property frame_size

Sizes of the boundary area, i.e., excluding the central element of the frame.

classmethod from_offset(offset)[source]
property shape

Total shape of the frame area.

class gt4py.cartesian.gtc.definitions.CartesianSpace[source]

Bases: object

class Axis(value)[source]

Bases: enum.Enum

An enumeration.

I = 0
J = 1
K = 2
names = ['I', 'J', 'K']
ndim = 3
class gt4py.cartesian.gtc.definitions.CenteredExtent(ranges, *args, ndims=None)[source]

Bases: gt4py.cartesian.gtc.definitions.Extent

Region defined by the largest negative offset (or zero) and the largest positive offset (or zero).

Size of boundary regions are expressed as minimum and maximum relative offsets related to the computation position. For example the frame for a stencil accessing 3 elements at the left of computation point and two at the right in the X axis would be: (-3, 2). If the stencil only has accesses with negative indices, the upper boundary would be 0.

classmethod empty(ndims=3)[source]
classmethod from_offset(offset)[source]
to_boundary()[source]
class gt4py.cartesian.gtc.definitions.Extent(ranges, *args, ndims=None)[source]

Bases: gt4py.cartesian.gtc.definitions.FrameTuple

Region defined by the smallest and the largest offsets.

Size of boundary regions are expressed as minimum and maximum relative offsets related to the computation position. For example the frame for a stencil accessing 3 elements at the left of computation point and two at the right in the X axis would be: (-3, 2). If the stencil only has accesses with negative indices, the upper boundary would be then a negative value.

classmethod empty(ndims=3)[source]
property frame_size

Sizes of the boundary area, i.e., excluding the central element of the frame.

classmethod from_offset(offset)[source]
property shape

Total shape of the frame area.

to_boundary()[source]
class gt4py.cartesian.gtc.definitions.FrameTuple(ranges, *args, ndims=None)[source]

Bases: tuple

N-dimensional list of pairs of numbers representing offsets around one central origin.

append(point)[source]
concatenate(other)[source]
classmethod from_k(value_pair, ndims=3)[source]
classmethod from_lower_upper(lower, upper)[source]
intersection(other)[source]
property is_symmetric
classmethod is_valid(value, *, ndims=(1, None))[source]
property is_zero
property lower_indices
property ndims
classmethod ones(ndims=3)[source]
union(other)[source]
property upper_indices
classmethod zeros(ndims=3)[source]
class gt4py.cartesian.gtc.definitions.Index(sizes, *args, ndims=None)[source]

Bases: gt4py.cartesian.gtc.definitions.NumericTuple

Index in a grid (all elements are ints).

class gt4py.cartesian.gtc.definitions.NumericTuple(sizes, *args, ndims=None)[source]

Bases: tuple

N-dimensional like vector implemented as a subclass of the tuple builtin.

filter_mask(mask)[source]
classmethod from_k(value, ndims=3)[source]
classmethod from_mask(seq, mask, default=None)[source]
classmethod from_value(value)[source]
intersection(other)[source]
classmethod is_valid(value, *, ndims=(1, None))[source]
property ndims
classmethod ones(ndims=3)[source]
union(other)[source]
classmethod zeros(ndims=3)[source]
class gt4py.cartesian.gtc.definitions.Shape(sizes, *args, ndims=None)[source]

Bases: gt4py.cartesian.gtc.definitions.NumericTuple

Shape of a n-dimensional grid (all elements are int >= 0).

gt4py.cartesian.gtc.gtir module

GridTools Intermediate Representation.

GTIR represents a computation with the semantics of the GTScript parallel model <https://github.com/GridTools/concepts/wiki/GTScript-Parallel-model>.

Type constraints and validators narrow the IR as much as reasonable to valid (executable) IR.

Analysis is required to generate valid code (complying with the parallel model) - extent analysis to define the extended compute domain - FieldIfStmt expansion to comply with the parallel model

class gt4py.cartesian.gtc.gtir.Argument(*, name: str, is_keyword: bool, default: str)[source]

Bases: gt4py.eve.concepts.Node

default: str
is_keyword: bool
name: str
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.BinaryOp(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, dtype: gt4py.cartesian.gtc.common.DataType = DataType.AUTO, op: Union[gt4py.cartesian.gtc.common.ArithmeticOperator, gt4py.cartesian.gtc.common.ComparisonOperator, gt4py.cartesian.gtc.common.LogicalOperator], left: gt4py.cartesian.gtc.common.ExprT, right: gt4py.cartesian.gtc.gtir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.BinaryOp__Expr[gt4py.cartesian.gtc.gtir.Expr], gt4py.cartesian.gtc.gtir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.BlockStmt(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, body: List[gt4py.cartesian.gtc.gtir.Stmt])[source]

Bases: gt4py.cartesian.gtc.common.BlockStmt__Stmt[gt4py.cartesian.gtc.gtir.Stmt], gt4py.cartesian.gtc.gtir.Stmt

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.Cast(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, dtype: gt4py.cartesian.gtc.common.DataType, expr: gt4py.cartesian.gtc.gtir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.Cast__Expr[gt4py.cartesian.gtc.gtir.Expr], gt4py.cartesian.gtc.gtir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.Decl(*args: Any, **kwargs: Any)[source]

Bases: gt4py.cartesian.gtc.common.LocNode

dtype: gt4py.cartesian.gtc.common.DataType
name: gt4py.eve.concepts.SymbolName
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.Expr(*args: typing_extensions.Any, **kwargs: typing_extensions.Any)[source]

Bases: gt4py.cartesian.gtc.common.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.FieldAccess(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, dtype: gt4py.cartesian.gtc.common.DataType = DataType.AUTO, name: Any, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, offset: Union[gt4py.cartesian.gtc.common.CartesianOffset, gt4py.cartesian.gtc.common.VariableKOffsetT], data_index: List[gt4py.cartesian.gtc.gtir.Expr] = NOTHING)[source]

Bases: gt4py.cartesian.gtc.common.FieldAccess__Expr_VariableKOffset[gt4py.cartesian.gtc.gtir.Expr, gt4py.cartesian.gtc.gtir.VariableKOffset], gt4py.cartesian.gtc.gtir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.FieldDecl(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, dtype: gt4py.cartesian.gtc.common.DataType, dimensions: Tuple[bool, bool, bool], data_dims: Tuple[int, ...] = NOTHING)[source]

Bases: gt4py.cartesian.gtc.gtir.Decl

data_dims: Tuple[int, ...]
dimensions: Tuple[bool, bool, bool]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.FieldIfStmt(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, true_branch: gt4py.cartesian.gtc.common.StmtT, false_branch: Optional[gt4py.cartesian.gtc.gtir.BlockStmt] = None, cond: gt4py.cartesian.gtc.common.ExprT)[source]

Bases: gt4py.cartesian.gtc.common.IfStmt__BlockStmt_Expr[gt4py.cartesian.gtc.gtir.BlockStmt, gt4py.cartesian.gtc.gtir.Expr], gt4py.cartesian.gtc.gtir.Stmt

If statement with a field expression as condition.

  • The condition is evaluated for all gridpoints and stored in a mask.

  • Each statement inside the if and else branches is executed according to the same rules as statements outside of branches.

The following restriction applies:

  • Inside the if and else blocks the same field cannot be written to and read with an offset in the parallel axes (order does not matter).

See parallel model <https://github.com/GridTools/concepts/wiki/GTScript-Parallel-model#conditionals-on-field-expressions>

cond: gt4py.cartesian.gtc.common.ExprT
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

verify_scalar_condition(attribute: attr._make.Attribute, value: gt4py.cartesian.gtc.gtir.Expr) None[source]
class gt4py.cartesian.gtc.gtir.HorizontalRestriction(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, mask: gt4py.cartesian.gtc.common.HorizontalMask, body: List[gt4py.cartesian.gtc.gtir.Stmt])[source]

Bases: gt4py.cartesian.gtc.common.HorizontalRestriction__Stmt[gt4py.cartesian.gtc.gtir.Stmt], gt4py.cartesian.gtc.gtir.Stmt

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.Interval(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, start: gt4py.cartesian.gtc.common.AxisBound, end: gt4py.cartesian.gtc.common.AxisBound)[source]

Bases: gt4py.cartesian.gtc.common.LocNode

end: gt4py.cartesian.gtc.common.AxisBound
start: gt4py.cartesian.gtc.common.AxisBound
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.Literal(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, value: Union[gt4py.cartesian.gtc.common.BuiltInLiteral, str], dtype: gt4py.cartesian.gtc.common.DataType, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.SCALAR)[source]

Bases: gt4py.cartesian.gtc.common.Literal, gt4py.cartesian.gtc.gtir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.NativeFuncCall(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, dtype: gt4py.cartesian.gtc.common.DataType = DataType.AUTO, func: gt4py.cartesian.gtc.common.NativeFunction, args: List[gt4py.cartesian.gtc.gtir.Expr])[source]

Bases: gt4py.cartesian.gtc.common.NativeFuncCall__Expr[gt4py.cartesian.gtc.gtir.Expr], gt4py.cartesian.gtc.gtir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.ParAssignStmt(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, right: gt4py.cartesian.gtc.gtir.Expr, left: gt4py.cartesian.gtc.common.TargetT)[source]

Bases: gt4py.cartesian.gtc.common.AssignStmt__FieldAccess_Expr[gt4py.cartesian.gtc.gtir.FieldAccess, gt4py.cartesian.gtc.gtir.Expr], gt4py.cartesian.gtc.gtir.Stmt

Parallel assignment.

R.h.s. is evaluated for all points and the resulting field is assigned (GTScript parallel model). Scalar variables on the l.h.s. are not allowed, as the only scalar variables are read-only stencil parameters.

left: gt4py.cartesian.gtc.common.TargetT
no_horizontal_offset_in_assignment(attribute: attr._make.Attribute, value: gt4py.cartesian.gtc.gtir.FieldAccess) None[source]
classmethod no_write_and_read_with_offset_of_same_field(instance: gt4py.cartesian.gtc.gtir.ParAssignStmt) None[source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.ScalarAccess(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, dtype: gt4py.cartesian.gtc.common.DataType = DataType.AUTO, name: Any, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.SCALAR)[source]

Bases: gt4py.cartesian.gtc.common.ScalarAccess, gt4py.cartesian.gtc.gtir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.ScalarDecl(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, dtype: gt4py.cartesian.gtc.common.DataType)[source]

Bases: gt4py.cartesian.gtc.gtir.Decl

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.ScalarIfStmt(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, true_branch: gt4py.cartesian.gtc.common.StmtT, false_branch: Optional[gt4py.cartesian.gtc.gtir.BlockStmt] = None, cond: gt4py.cartesian.gtc.common.ExprT)[source]

Bases: gt4py.cartesian.gtc.common.IfStmt__BlockStmt_Expr[gt4py.cartesian.gtc.gtir.BlockStmt, gt4py.cartesian.gtc.gtir.Expr], gt4py.cartesian.gtc.gtir.Stmt

If statement with a scalar expression as condition.

No special rules apply.

cond: gt4py.cartesian.gtc.common.ExprT
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

verify_scalar_condition(attribute: attr._make.Attribute, value: gt4py.cartesian.gtc.gtir.Expr) None[source]
class gt4py.cartesian.gtc.gtir.Stencil(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: str, api_signature: List[gt4py.cartesian.gtc.gtir.Argument], params: List[gt4py.cartesian.gtc.gtir.Decl], vertical_loops: List[gt4py.cartesian.gtc.gtir.VerticalLoop], externals: Dict[str, gt4py.cartesian.gtc.gtir.Literal], sources: Dict[str, str], docstring: str)[source]

Bases: gt4py.cartesian.gtc.common.LocNode, gt4py.eve.traits.ValidatedSymbolTableTrait

api_signature: List[gt4py.cartesian.gtc.gtir.Argument]
docstring: str
externals: Dict[str, gt4py.cartesian.gtc.gtir.Literal]
name: str
property param_names: List[str]
params: List[gt4py.cartesian.gtc.gtir.Decl]
sources: Dict[str, str]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

vertical_loops: List[gt4py.cartesian.gtc.gtir.VerticalLoop]
class gt4py.cartesian.gtc.gtir.Stmt(*args: typing_extensions.Any, **kwargs: typing_extensions.Any)[source]

Bases: gt4py.cartesian.gtc.common.Stmt

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.TernaryOp(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, dtype: gt4py.cartesian.gtc.common.DataType = DataType.AUTO, cond: gt4py.cartesian.gtc.common.ExprT, true_expr: gt4py.cartesian.gtc.common.ExprT, false_expr: gt4py.cartesian.gtc.gtir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.TernaryOp__Expr[gt4py.cartesian.gtc.gtir.Expr], gt4py.cartesian.gtc.gtir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.UnaryOp(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, dtype: gt4py.cartesian.gtc.common.DataType = DataType.AUTO, op: gt4py.cartesian.gtc.common.UnaryOperator, expr: gt4py.cartesian.gtc.gtir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.UnaryOp__Expr[gt4py.cartesian.gtc.gtir.Expr], gt4py.cartesian.gtc.gtir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.VariableKOffset(*, k: gt4py.cartesian.gtc.gtir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.VariableKOffset__Expr[gt4py.cartesian.gtc.gtir.Expr]

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.VerticalLoop(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, interval: gt4py.cartesian.gtc.gtir.Interval, loop_order: gt4py.cartesian.gtc.common.LoopOrder, temporaries: List[gt4py.cartesian.gtc.gtir.FieldDecl], body: List[gt4py.cartesian.gtc.gtir.Stmt])[source]

Bases: gt4py.cartesian.gtc.common.LocNode

classmethod _no_write_and_read_with_horizontal_offset(instance: gt4py.cartesian.gtc.gtir.VerticalLoop) None[source]

In the same VerticalLoop a field must not be written and read with a horizontal offset.

Temporaries don’t have this constraint. Backends are required to implement them using block-private halos.

body: List[gt4py.cartesian.gtc.gtir.Stmt]
interval: gt4py.cartesian.gtc.gtir.Interval
loop_order: gt4py.cartesian.gtc.common.LoopOrder
temporaries: List[gt4py.cartesian.gtc.gtir.FieldDecl]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.gtir.While(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, cond: gt4py.cartesian.gtc.common.ExprT, body: List[gt4py.cartesian.gtc.gtir.Stmt])[source]

Bases: gt4py.cartesian.gtc.common.While__Stmt_Expr[gt4py.cartesian.gtc.gtir.Stmt, gt4py.cartesian.gtc.gtir.Expr], gt4py.cartesian.gtc.gtir.Stmt

While loop with a field or scalar expression as condition.

_no_write_and_read_with_horizontal_offset_all(attribute: attr._make.Attribute, value: List[gt4py.cartesian.gtc.gtir.Stmt]) None[source]

In a while loop all variables must not be written and read with a horizontal offset.

body: List[gt4py.cartesian.gtc.gtir.Stmt]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

gt4py.cartesian.gtc.gtir._written_and_read_with_offset(stmts: List[gt4py.cartesian.gtc.gtir.Stmt]) Set[str][source]

Return a list of names that are written to and read with offset.

gt4py.cartesian.gtc.gtir_to_oir module

class gt4py.cartesian.gtc.gtir_to_oir.GTIRToOIR[source]

Bases: gt4py.eve.visitors.NodeTranslator

class Context(local_scalars: List[gt4py.cartesian.gtc.oir.ScalarDecl] = <factory>, temp_fields: List[gt4py.cartesian.gtc.oir.FieldDecl] = <factory>)[source]

Bases: object

local_scalars: List[gt4py.cartesian.gtc.oir.ScalarDecl]
reset_local_scalars()[source]
temp_fields: List[gt4py.cartesian.gtc.oir.FieldDecl]
visit_BinaryOp(node: gt4py.cartesian.gtc.gtir.BinaryOp) gt4py.cartesian.gtc.oir.BinaryOp[source]
visit_Cast(node: gt4py.cartesian.gtc.gtir.Cast) gt4py.cartesian.gtc.oir.Cast[source]
visit_FieldAccess(node: gt4py.cartesian.gtc.gtir.FieldAccess) gt4py.cartesian.gtc.oir.FieldAccess[source]
visit_FieldDecl(node: gt4py.cartesian.gtc.gtir.FieldDecl) gt4py.cartesian.gtc.oir.FieldDecl[source]
visit_FieldIfStmt(node: gt4py.cartesian.gtc.gtir.FieldIfStmt, *, mask: Optional[gt4py.cartesian.gtc.oir.Expr] = None, ctx: gt4py.cartesian.gtc.gtir_to_oir.GTIRToOIR.Context, **kwargs: Any) List[gt4py.cartesian.gtc.oir.Stmt][source]
visit_HorizontalRestriction(node: gt4py.cartesian.gtc.gtir.HorizontalRestriction, **kwargs: Any) gt4py.cartesian.gtc.oir.HorizontalRestriction[source]
visit_Interval(node: gt4py.cartesian.gtc.gtir.Interval) gt4py.cartesian.gtc.oir.Interval[source]
visit_Literal(node: gt4py.cartesian.gtc.gtir.Literal) gt4py.cartesian.gtc.oir.Literal[source]
visit_NativeFuncCall(node: gt4py.cartesian.gtc.gtir.NativeFuncCall) gt4py.cartesian.gtc.oir.NativeFuncCall[source]
visit_ParAssignStmt(node: gt4py.cartesian.gtc.gtir.ParAssignStmt, *, mask: Optional[gt4py.cartesian.gtc.oir.Expr] = None, **kwargs: Any) Union[gt4py.cartesian.gtc.oir.AssignStmt, gt4py.cartesian.gtc.oir.MaskStmt][source]
visit_ScalarAccess(node: gt4py.cartesian.gtc.gtir.ScalarAccess) gt4py.cartesian.gtc.oir.ScalarAccess[source]
visit_ScalarDecl(node: gt4py.cartesian.gtc.gtir.ScalarDecl) gt4py.cartesian.gtc.oir.ScalarDecl[source]
visit_ScalarIfStmt(node: gt4py.cartesian.gtc.gtir.ScalarIfStmt, *, mask: Optional[gt4py.cartesian.gtc.oir.Expr] = None, ctx: gt4py.cartesian.gtc.gtir_to_oir.GTIRToOIR.Context, **kwargs: Any) List[gt4py.cartesian.gtc.oir.Stmt][source]
visit_Stencil(node: gt4py.cartesian.gtc.gtir.Stencil) gt4py.cartesian.gtc.oir.Stencil[source]
visit_TernaryOp(node: gt4py.cartesian.gtc.gtir.TernaryOp) gt4py.cartesian.gtc.oir.TernaryOp[source]
visit_UnaryOp(node: gt4py.cartesian.gtc.gtir.UnaryOp) gt4py.cartesian.gtc.oir.UnaryOp[source]
visit_VariableKOffset(node: gt4py.cartesian.gtc.gtir.VariableKOffset) gt4py.cartesian.gtc.oir.VariableKOffset[source]
visit_VerticalLoop(node: gt4py.cartesian.gtc.gtir.VerticalLoop, *, ctx: gt4py.cartesian.gtc.gtir_to_oir.GTIRToOIR.Context) gt4py.cartesian.gtc.oir.VerticalLoop[source]
visit_While(node: gt4py.cartesian.gtc.gtir.While, *, mask: Optional[gt4py.cartesian.gtc.oir.Expr] = None, **kwargs: Any) Union[gt4py.cartesian.gtc.oir.While, gt4py.cartesian.gtc.oir.MaskStmt][source]
gt4py.cartesian.gtc.gtir_to_oir.validate_stencil_memory_accesses(node: gt4py.cartesian.gtc.oir.Stencil) gt4py.cartesian.gtc.oir.Stencil[source]

Check that no memory races occur in GridTools backends.

Since this is required for GridTools backends, it’s imposed on all backends at the OIR level. This is similar to the check at the gtir level for read-with-offset and writes, but more complete because it involves extent analysis, so it catches indirect read-with-offset through temporaries.

gt4py.cartesian.gtc.oir module

Optimizable Intermediate Representation (working title).

OIR represents a computation at the level of GridTools stages and multistages, e.g. stage merging, staged computations to compute-on-the-fly, cache annotations, etc.

class gt4py.cartesian.gtc.oir.AssignStmt(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, right: gt4py.cartesian.gtc.oir.Expr, left: gt4py.cartesian.gtc.common.TargetT)[source]

Bases: gt4py.cartesian.gtc.common.AssignStmt__union_gt4py_cartesian_gtc_oir_scalaraccess_gt4py_cartesian_gtc_oir_fieldaccess_Expr[Union[gt4py.cartesian.gtc.oir.ScalarAccess, gt4py.cartesian.gtc.oir.FieldAccess], gt4py.cartesian.gtc.oir.Expr], gt4py.cartesian.gtc.oir.Stmt

left: gt4py.cartesian.gtc.common.TargetT
no_horizontal_offset_in_assignment(attribute: attr._make.Attribute, value: Union[gt4py.cartesian.gtc.oir.ScalarAccess, gt4py.cartesian.gtc.oir.FieldAccess]) None[source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.BinaryOp(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, dtype: gt4py.cartesian.gtc.common.DataType = DataType.AUTO, op: Union[gt4py.cartesian.gtc.common.ArithmeticOperator, gt4py.cartesian.gtc.common.ComparisonOperator, gt4py.cartesian.gtc.common.LogicalOperator], left: gt4py.cartesian.gtc.common.ExprT, right: gt4py.cartesian.gtc.oir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.BinaryOp__Expr[gt4py.cartesian.gtc.oir.Expr], gt4py.cartesian.gtc.oir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.CacheDesc(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any)[source]

Bases: gt4py.cartesian.gtc.common.LocNode

name: gt4py.eve.concepts.SymbolRef
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.Cast(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, dtype: gt4py.cartesian.gtc.common.DataType, expr: gt4py.cartesian.gtc.oir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.Cast__Expr[gt4py.cartesian.gtc.oir.Expr], gt4py.cartesian.gtc.oir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.Decl(*args: Any, **kwargs: Any)[source]

Bases: gt4py.cartesian.gtc.common.LocNode

dtype: gt4py.cartesian.gtc.common.DataType
name: gt4py.eve.concepts.SymbolName
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.Expr(*args: typing_extensions.Any, **kwargs: typing_extensions.Any)[source]

Bases: gt4py.cartesian.gtc.common.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.FieldAccess(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, dtype: gt4py.cartesian.gtc.common.DataType = DataType.AUTO, name: Any, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, offset: Union[gt4py.cartesian.gtc.common.CartesianOffset, gt4py.cartesian.gtc.common.VariableKOffsetT], data_index: List[gt4py.cartesian.gtc.oir.Expr] = NOTHING)[source]

Bases: gt4py.cartesian.gtc.common.FieldAccess__Expr_VariableKOffset[gt4py.cartesian.gtc.oir.Expr, gt4py.cartesian.gtc.oir.VariableKOffset], gt4py.cartesian.gtc.oir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.FieldDecl(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, dtype: gt4py.cartesian.gtc.common.DataType, dimensions: Tuple[bool, bool, bool], data_dims: Tuple[int, ...] = NOTHING)[source]

Bases: gt4py.cartesian.gtc.oir.Decl

data_dims: Tuple[int, ...]
dimensions: Tuple[bool, bool, bool]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.HorizontalExecution(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, body: List[gt4py.cartesian.gtc.oir.Stmt], declarations: List[gt4py.cartesian.gtc.oir.LocalScalar])[source]

Bases: gt4py.cartesian.gtc.common.LocNode, gt4py.eve.traits.SymbolTableTrait

body: List[gt4py.cartesian.gtc.oir.Stmt]
declarations: List[gt4py.cartesian.gtc.oir.LocalScalar]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.HorizontalRestriction(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, mask: gt4py.cartesian.gtc.common.HorizontalMask, body: List[gt4py.cartesian.gtc.oir.Stmt])[source]

Bases: gt4py.cartesian.gtc.common.HorizontalRestriction__Stmt[gt4py.cartesian.gtc.oir.Stmt], gt4py.cartesian.gtc.oir.Stmt

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.IJCache(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any)[source]

Bases: gt4py.cartesian.gtc.oir.CacheDesc

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.Interval(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, start: gt4py.cartesian.gtc.common.AxisBound, end: gt4py.cartesian.gtc.common.AxisBound)[source]

Bases: gt4py.cartesian.gtc.common.LocNode

classmethod check(instance: gt4py.cartesian.gtc.oir.Interval) None[source]
covers(other: gt4py.cartesian.gtc.oir.Interval) bool[source]
end: gt4py.cartesian.gtc.common.AxisBound
classmethod full()[source]
intersects(other: gt4py.cartesian.gtc.oir.Interval) bool[source]
shifted(offset: Optional[int]) Union[gt4py.cartesian.gtc.oir.Interval, gt4py.cartesian.gtc.oir.UnboundedInterval][source]
start: gt4py.cartesian.gtc.common.AxisBound
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.KCache(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, fill: bool, flush: bool)[source]

Bases: gt4py.cartesian.gtc.oir.CacheDesc

fill: bool
flush: bool
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.Literal(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, value: Union[gt4py.cartesian.gtc.common.BuiltInLiteral, str], dtype: gt4py.cartesian.gtc.common.DataType, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.SCALAR)[source]

Bases: gt4py.cartesian.gtc.common.Literal, gt4py.cartesian.gtc.oir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.LocalScalar(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, dtype: gt4py.cartesian.gtc.common.DataType)[source]

Bases: gt4py.cartesian.gtc.oir.Decl

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.MaskStmt(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, mask: gt4py.cartesian.gtc.oir.Expr, body: List[gt4py.cartesian.gtc.oir.Stmt])[source]

Bases: gt4py.cartesian.gtc.oir.Stmt

body: List[gt4py.cartesian.gtc.oir.Stmt]
mask: gt4py.cartesian.gtc.oir.Expr
mask_is_boolean_field_expr(attribute: attr._make.Attribute, v: gt4py.cartesian.gtc.oir.Expr) None[source]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.NativeFuncCall(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, dtype: gt4py.cartesian.gtc.common.DataType = DataType.AUTO, func: gt4py.cartesian.gtc.common.NativeFunction, args: List[gt4py.cartesian.gtc.oir.Expr])[source]

Bases: gt4py.cartesian.gtc.common.NativeFuncCall__Expr[gt4py.cartesian.gtc.oir.Expr], gt4py.cartesian.gtc.oir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.ScalarAccess(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, dtype: gt4py.cartesian.gtc.common.DataType = DataType.AUTO, name: Any, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.SCALAR)[source]

Bases: gt4py.cartesian.gtc.common.ScalarAccess, gt4py.cartesian.gtc.oir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.ScalarDecl(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, dtype: gt4py.cartesian.gtc.common.DataType)[source]

Bases: gt4py.cartesian.gtc.oir.Decl

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.Stencil(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: str, params: List[gt4py.cartesian.gtc.oir.Decl], vertical_loops: List[gt4py.cartesian.gtc.oir.VerticalLoop], declarations: List[gt4py.cartesian.gtc.oir.Temporary])[source]

Bases: gt4py.cartesian.gtc.common.LocNode, gt4py.eve.traits.ValidatedSymbolTableTrait

declarations: List[gt4py.cartesian.gtc.oir.Temporary]
name: str
params: List[gt4py.cartesian.gtc.oir.Decl]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

vertical_loops: List[gt4py.cartesian.gtc.oir.VerticalLoop]
class gt4py.cartesian.gtc.oir.Stmt(*args: typing_extensions.Any, **kwargs: typing_extensions.Any)[source]

Bases: gt4py.cartesian.gtc.common.Stmt

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.Temporary(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, dtype: gt4py.cartesian.gtc.common.DataType, dimensions: Tuple[bool, bool, bool], data_dims: Tuple[int, ...] = NOTHING)[source]

Bases: gt4py.cartesian.gtc.oir.FieldDecl

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.TernaryOp(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, dtype: gt4py.cartesian.gtc.common.DataType = DataType.AUTO, cond: gt4py.cartesian.gtc.common.ExprT, true_expr: gt4py.cartesian.gtc.common.ExprT, false_expr: gt4py.cartesian.gtc.oir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.TernaryOp__Expr[gt4py.cartesian.gtc.oir.Expr], gt4py.cartesian.gtc.oir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.UnaryOp(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, kind: gt4py.cartesian.gtc.common.ExprKind = ExprKind.FIELD, dtype: gt4py.cartesian.gtc.common.DataType = DataType.AUTO, op: gt4py.cartesian.gtc.common.UnaryOperator, expr: gt4py.cartesian.gtc.oir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.UnaryOp__Expr[gt4py.cartesian.gtc.oir.Expr], gt4py.cartesian.gtc.oir.Expr

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.UnboundedInterval[source]

Bases: object

classmethod check(instance: gt4py.cartesian.gtc.oir.UnboundedInterval) None[source]
covers(other: Union[gt4py.cartesian.gtc.oir.Interval, gt4py.cartesian.gtc.oir.UnboundedInterval]) bool[source]
end: Optional[gt4py.cartesian.gtc.common.AxisBound] = None
classmethod full()[source]
intersects(other: Union[gt4py.cartesian.gtc.oir.Interval, gt4py.cartesian.gtc.oir.UnboundedInterval]) bool[source]
shifted(offset: Optional[int]) gt4py.cartesian.gtc.oir.UnboundedInterval[source]
start: Optional[gt4py.cartesian.gtc.common.AxisBound] = None
class gt4py.cartesian.gtc.oir.VariableKOffset(*, k: gt4py.cartesian.gtc.oir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.VariableKOffset__Expr[gt4py.cartesian.gtc.oir.Expr]

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.VerticalLoop(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, loop_order: gt4py.cartesian.gtc.common.LoopOrder, sections: List[gt4py.cartesian.gtc.oir.VerticalLoopSection], caches: List[gt4py.cartesian.gtc.oir.CacheDesc] = NOTHING)[source]

Bases: gt4py.cartesian.gtc.common.LocNode

caches: List[gt4py.cartesian.gtc.oir.CacheDesc]
loop_order: gt4py.cartesian.gtc.common.LoopOrder
nonempty_loop(attribute: attr._make.Attribute, v: List[gt4py.cartesian.gtc.oir.VerticalLoopSection]) None[source]
sections: List[gt4py.cartesian.gtc.oir.VerticalLoopSection]
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

classmethod valid_section_intervals(instance: gt4py.cartesian.gtc.oir.VerticalLoop) None[source]
class gt4py.cartesian.gtc.oir.VerticalLoopSection(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, interval: gt4py.cartesian.gtc.oir.Interval, horizontal_executions: List[gt4py.cartesian.gtc.oir.HorizontalExecution])[source]

Bases: gt4py.cartesian.gtc.common.LocNode

horizontal_executions: List[gt4py.cartesian.gtc.oir.HorizontalExecution]
interval: gt4py.cartesian.gtc.oir.Interval
classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

class gt4py.cartesian.gtc.oir.While(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, cond: gt4py.cartesian.gtc.common.ExprT, body: List[gt4py.cartesian.gtc.oir.Stmt])[source]

Bases: gt4py.cartesian.gtc.common.While__Stmt_Expr[gt4py.cartesian.gtc.oir.Stmt, gt4py.cartesian.gtc.oir.Expr], gt4py.cartesian.gtc.oir.Stmt

classmethod update_forward_refs(localns: Optional[dict[str, typing_extensions.Any]] = None) type[_DataModelT]

Update Data Model class meta-information replacing forwarded type annotations with actual types.

Parameters

localns – locals dict used in the evaluation of the annotations (globals are automatically taken from model.__module__).

Returns

The provided class (so it can be used as a decorator too).

gt4py.cartesian.gtc.utils module

gt4py.cartesian.gtc.utils.dimension_flags_to_names(mask: Tuple[bool, bool, bool]) str[source]
gt4py.cartesian.gtc.utils.filter_mask(seq: Sequence[Any], mask: Sequence[bool]) Tuple[Any, ...][source]

Return a reduced-size tuple, with indices where mask[i]=False removed.

Example: >>> a = (1, 2, 3) >>> mask = (False, True, False) >>> filter_mask(a, mask) (2,)

gt4py.cartesian.gtc.utils.flatten_list(nested_iterables: typing.Iterable[typing.Any], filter_none: bool = False, *, skip_types: typing.Tuple[typing.Type[typing.Any], ...] = (<class 'str'>, <class 'bytes'>)) List[Any][source]
gt4py.cartesian.gtc.utils.flatten_list_iter(nested_iterables: typing.Iterable[typing.Any], filter_none: bool = False, *, skip_types: typing.Tuple[typing.Type[typing.Any], ...] = (<class 'str'>, <class 'bytes'>)) Any[source]
gt4py.cartesian.gtc.utils.interpolate_mask(seq: Sequence[Any], mask: Sequence[bool], default) Tuple[Any, ...][source]

Replace True values by those from the seq in the mask, else default.

Example: >>> default = 0 >>> a = (1, 2) >>> mask = (False, True, False, True) >>> interpolate_mask(a, mask, 0) (0, 1, 0, 2)

gt4py.cartesian.gtc.utils.listify(value)[source]

Module contents