gt4py.cartesian.gtc.cuir package

Submodules

gt4py.cartesian.gtc.cuir.cuir module

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

Bases: 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[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], gt4py.cartesian.gtc.cuir.cuir.Expr], gt4py.cartesian.gtc.cuir.cuir.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.cuir.cuir.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.cuir.cuir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.BinaryOp__Expr[gt4py.cartesian.gtc.cuir.cuir.Expr], 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.cuir.cuir.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.cuir.cuir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.Cast__Expr[gt4py.cartesian.gtc.cuir.cuir.Expr], 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.cuir.cuir.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.cuir.cuir.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.cuir.cuir.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.cuir.cuir.Expr] = NOTHING)[source]

Bases: gt4py.cartesian.gtc.common.FieldAccess__Expr_VariableKOffset[gt4py.cartesian.gtc.cuir.cuir.Expr, gt4py.cartesian.gtc.cuir.cuir.VariableKOffset], 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.cuir.cuir.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.cuir.cuir.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.cuir.cuir.HorizontalExecution(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, body: List[gt4py.cartesian.gtc.cuir.cuir.Stmt], declarations: List[gt4py.cartesian.gtc.cuir.cuir.LocalScalar], extent: Optional[gt4py.cartesian.gtc.cuir.cuir.IJExtent] = None)[source]

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

body: List[gt4py.cartesian.gtc.cuir.cuir.Stmt]
declarations: List[gt4py.cartesian.gtc.cuir.cuir.LocalScalar]
extent: Optional[gt4py.cartesian.gtc.cuir.cuir.IJExtent]
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.cuir.cuir.IJCacheAccess(*, 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.cuir.cuir.Expr] = NOTHING)[source]

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

data_index: List[gt4py.cartesian.gtc.cuir.cuir.Expr]
ij_cache_is_different_from_field_access = True
no_additional_dimensions(attribute: attr._make.Attribute, value: List[int]) None[source]
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).

zero_k_offset(attribute: attr._make.Attribute, value: gt4py.cartesian.gtc.common.CartesianOffset) None[source]
class gt4py.cartesian.gtc.cuir.cuir.IJCacheDecl(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, dtype: gt4py.cartesian.gtc.common.DataType, extent: Optional[gt4py.cartesian.gtc.cuir.cuir.IJExtent] = None)[source]

Bases: gt4py.cartesian.gtc.cuir.cuir.Decl

extent: Optional[gt4py.cartesian.gtc.cuir.cuir.IJExtent]
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.cuir.cuir.IJExtent(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, i: Tuple[int, int], j: Tuple[int, int])[source]

Bases: gt4py.cartesian.gtc.common.LocNode

classmethod from_offset(offset: Union[gt4py.cartesian.gtc.common.CartesianOffset, gt4py.cartesian.gtc.cuir.cuir.VariableKOffset]) gt4py.cartesian.gtc.cuir.cuir.IJExtent[source]
i: Tuple[int, int]
j: Tuple[int, int]
union() gt4py.cartesian.gtc.cuir.cuir.IJExtent[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.cuir.cuir.IJExtent[source]
class gt4py.cartesian.gtc.cuir.cuir.KCacheAccess(*, 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.cuir.cuir.Expr] = NOTHING)[source]

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

data_index: List[gt4py.cartesian.gtc.cuir.cuir.Expr]
has_no_ij_offset(attribute: attr._make.Attribute, value: Union[gt4py.cartesian.gtc.common.CartesianOffset, gt4py.cartesian.gtc.cuir.cuir.VariableKOffset]) None[source]
k_cache_is_different_from_field_access = True
no_additional_dimensions(attribute: attr._make.Attribute, value: List[int]) None[source]
not_variable_offset(attribute: attr._make.Attribute, value: Union[gt4py.cartesian.gtc.common.CartesianOffset, gt4py.cartesian.gtc.cuir.cuir.VariableKOffset]) None[source]
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.cuir.cuir.KCacheDecl(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, dtype: gt4py.cartesian.gtc.common.DataType, extent: Optional[gt4py.cartesian.gtc.cuir.cuir.KExtent] = None)[source]

Bases: gt4py.cartesian.gtc.cuir.cuir.Decl

extent: Optional[gt4py.cartesian.gtc.cuir.cuir.KExtent]
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.cuir.cuir.KExtent(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, k: Tuple[int, int])[source]

Bases: gt4py.cartesian.gtc.common.LocNode

classmethod from_offset(offset: Union[gt4py.cartesian.gtc.common.CartesianOffset, gt4py.cartesian.gtc.cuir.cuir.VariableKOffset]) gt4py.cartesian.gtc.cuir.cuir.KExtent[source]
k: Tuple[int, int]
union() gt4py.cartesian.gtc.cuir.cuir.KExtent[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.cuir.cuir.KExtent[source]
class gt4py.cartesian.gtc.cuir.cuir.Kernel(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, vertical_loops: List[gt4py.cartesian.gtc.cuir.cuir.VerticalLoop])[source]

Bases: gt4py.cartesian.gtc.common.LocNode

check_loops(attribute: attr._make.Attribute, value: List[gt4py.cartesian.gtc.cuir.cuir.VerticalLoop]) 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).

vertical_loops: List[gt4py.cartesian.gtc.cuir.cuir.VerticalLoop]
class gt4py.cartesian.gtc.cuir.cuir.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.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.cuir.cuir.LocalScalar(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, dtype: gt4py.cartesian.gtc.common.DataType)[source]

Bases: gt4py.cartesian.gtc.cuir.cuir.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.cuir.cuir.MaskStmt(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, mask: gt4py.cartesian.gtc.cuir.cuir.Expr, body: List[gt4py.cartesian.gtc.cuir.cuir.Stmt])[source]

Bases: gt4py.cartesian.gtc.cuir.cuir.Stmt

body: List[gt4py.cartesian.gtc.cuir.cuir.Stmt]
mask: 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.cuir.cuir.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.cuir.cuir.Expr])[source]

Bases: gt4py.cartesian.gtc.common.NativeFuncCall__Expr[gt4py.cartesian.gtc.cuir.cuir.Expr], 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.cuir.cuir.Positional(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, axis_name: str, dtype: gt4py.cartesian.gtc.common.DataType = DataType.INT32)[source]

Bases: gt4py.cartesian.gtc.cuir.cuir.Decl

axis_name: str
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.cuir.cuir.Program(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: str, params: List[gt4py.cartesian.gtc.cuir.cuir.Decl], positionals: List[gt4py.cartesian.gtc.cuir.cuir.Positional], temporaries: List[gt4py.cartesian.gtc.cuir.cuir.Temporary], kernels: List[gt4py.cartesian.gtc.cuir.cuir.Kernel], axis_sizes: List[gt4py.cartesian.gtc.cuir.cuir.ScalarDecl] = NOTHING)[source]

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

axis_sizes: List[gt4py.cartesian.gtc.cuir.cuir.ScalarDecl]
kernels: List[gt4py.cartesian.gtc.cuir.cuir.Kernel]
name: str
params: List[gt4py.cartesian.gtc.cuir.cuir.Decl]
positionals: List[gt4py.cartesian.gtc.cuir.cuir.Positional]
temporaries: List[gt4py.cartesian.gtc.cuir.cuir.Temporary]
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.cuir.cuir.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.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.cuir.cuir.ScalarDecl(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, dtype: gt4py.cartesian.gtc.common.DataType)[source]

Bases: gt4py.cartesian.gtc.cuir.cuir.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.cuir.cuir.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.cuir.cuir.Temporary(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, name: Any, dtype: gt4py.cartesian.gtc.common.DataType, data_dims: Tuple[int, ...] = NOTHING)[source]

Bases: gt4py.cartesian.gtc.cuir.cuir.Decl

data_dims: Tuple[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).

class gt4py.cartesian.gtc.cuir.cuir.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.cuir.cuir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.TernaryOp__Expr[gt4py.cartesian.gtc.cuir.cuir.Expr], 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.cuir.cuir.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.cuir.cuir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.UnaryOp__Expr[gt4py.cartesian.gtc.cuir.cuir.Expr], 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.cuir.cuir.VariableKOffset(*, k: gt4py.cartesian.gtc.cuir.cuir.Expr)[source]

Bases: gt4py.cartesian.gtc.common.VariableKOffset__Expr[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.cuir.cuir.VerticalLoop(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, loop_order: gt4py.cartesian.gtc.common.LoopOrder, sections: List[gt4py.cartesian.gtc.cuir.cuir.VerticalLoopSection], ij_caches: List[gt4py.cartesian.gtc.cuir.cuir.IJCacheDecl], k_caches: List[gt4py.cartesian.gtc.cuir.cuir.KCacheDecl])[source]

Bases: gt4py.cartesian.gtc.common.LocNode

ij_caches: List[gt4py.cartesian.gtc.cuir.cuir.IJCacheDecl]
k_caches: List[gt4py.cartesian.gtc.cuir.cuir.KCacheDecl]
loop_order: gt4py.cartesian.gtc.common.LoopOrder
sections: List[gt4py.cartesian.gtc.cuir.cuir.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).

class gt4py.cartesian.gtc.cuir.cuir.VerticalLoopSection(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, start: gt4py.cartesian.gtc.common.AxisBound, end: gt4py.cartesian.gtc.common.AxisBound, horizontal_executions: List[gt4py.cartesian.gtc.cuir.cuir.HorizontalExecution])[source]

Bases: gt4py.cartesian.gtc.common.LocNode

end: gt4py.cartesian.gtc.common.AxisBound
horizontal_executions: List[gt4py.cartesian.gtc.cuir.cuir.HorizontalExecution]
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.cuir.cuir.While(*, loc: Optional[gt4py.eve.concepts.SourceLocation] = None, cond: gt4py.cartesian.gtc.common.ExprT, body: List[gt4py.cartesian.gtc.cuir.cuir.Stmt])[source]

Bases: gt4py.cartesian.gtc.common.While__Stmt_Expr[gt4py.cartesian.gtc.cuir.cuir.Stmt, gt4py.cartesian.gtc.cuir.cuir.Expr], gt4py.cartesian.gtc.cuir.cuir.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.cuir.cuir.axis_size_decls() List[gt4py.cartesian.gtc.cuir.cuir.ScalarDecl][source]

gt4py.cartesian.gtc.cuir.cuir_codegen module

class gt4py.cartesian.gtc.cuir.cuir_codegen.CUIRCodegen[source]

Bases: gt4py.eve.codegen.TemplatedGenerator, gt4py.eve.traits.VisitorWithSymbolTableTrait

AssignStmt = <gt4py.eve.codegen.FormatTemplate object>
BUILTIN_LITERAL_TO_CODE = {BuiltInLiteral.FALSE: 'false', BuiltInLiteral.TRUE: 'true'}
BinaryOp = <gt4py.eve.codegen.FormatTemplate object>
CartesianOffset = <gt4py.eve.codegen.FormatTemplate object>
Cast = <gt4py.eve.codegen.FormatTemplate object>
DATA_TYPE_TO_CODE = {DataType.BOOL: 'bool', DataType.INT8: 'std::int8_t', DataType.INT16: 'std::int16_t', DataType.INT32: 'std::int32_t', DataType.INT64: 'std::int64_t', DataType.FLOAT32: 'float', DataType.FLOAT64: 'double'}
FieldDecl = <gt4py.eve.codegen.FormatTemplate object>
HorizontalExecution = <gt4py.eve.codegen.MakoTemplate object>
IJCacheDecl = <gt4py.eve.codegen.MakoTemplate object>
IJExtent = <gt4py.eve.codegen.FormatTemplate object>
KCacheAccess = <gt4py.eve.codegen.MakoTemplate object>
KCacheDecl = <gt4py.eve.codegen.MakoTemplate object>
Kernel = <gt4py.eve.codegen.MakoTemplate object>
LocalScalar = <gt4py.eve.codegen.FormatTemplate object>
MaskStmt = <gt4py.eve.codegen.MakoTemplate object>
NATIVE_FUNCTION_TO_CODE = {NativeFunction.ABS: 'std::abs', NativeFunction.ARCCOS: 'std::acos', NativeFunction.ARCCOSH: 'std::acosh', NativeFunction.ARCSIN: 'std::asin', NativeFunction.ARCSINH: 'std::asinh', NativeFunction.ARCTAN: 'std::atan', NativeFunction.ARCTANH: 'std::atanh', NativeFunction.CBRT: 'std::cbrt', NativeFunction.CEIL: 'std::ceil', NativeFunction.COS: 'std::cos', NativeFunction.COSH: 'std::cosh', NativeFunction.EXP: 'std::exp', NativeFunction.FLOOR: 'std::floor', NativeFunction.GAMMA: 'std::tgamma', NativeFunction.ISFINITE: 'std::isfinite', NativeFunction.ISINF: 'std::isinf', NativeFunction.ISNAN: 'std::isnan', NativeFunction.LOG: 'std::log', NativeFunction.MAX: 'std::max', NativeFunction.MIN: 'std::min', NativeFunction.MOD: 'std::fmod', NativeFunction.POW: 'std::pow', NativeFunction.SIN: 'std::sin', NativeFunction.SINH: 'std::sinh', NativeFunction.SQRT: 'std::sqrt', NativeFunction.TAN: 'std::tan', NativeFunction.TANH: 'std::tanh', NativeFunction.TRUNC: 'std::trunc'}
NativeFuncCall = <gt4py.eve.codegen.MakoTemplate object>
Positional = <gt4py.eve.codegen.FormatTemplate object>
Program = <gt4py.eve.codegen.MakoTemplate object>
ScalarAccess = <gt4py.eve.codegen.FormatTemplate object>
ScalarDecl = <gt4py.eve.codegen.FormatTemplate object>
Temporary = <gt4py.eve.codegen.FormatTemplate object>
TernaryOp = <gt4py.eve.codegen.FormatTemplate object>
UNARY_OPERATOR_TO_CODE = {UnaryOperator.POS: '+', UnaryOperator.NEG: '-', UnaryOperator.NOT: '!'}
UnaryOp = <gt4py.eve.codegen.FormatTemplate object>
VariableKOffset = <gt4py.eve.codegen.FormatTemplate object>
VerticalLoop = <gt4py.eve.codegen.MakoTemplate object>
VerticalLoopSection = <gt4py.eve.codegen.MakoTemplate object>
While = <gt4py.eve.codegen.MakoTemplate object>
classmethod apply(root: Union[gt4py.eve.concepts.NodeT, bool, bytes, int, float, str, enum.IntEnum, gt4py.eve.type_definitions.StrEnum], **kwargs: Any) str[source]

Public method to build a class instance and visit an IR node.

Parameters
  • root – An IR node.

  • node_templates (optiona) – see NodeDumper.

  • dump_function (optiona) – see NodeDumper.

  • **kwargs (optional) – custom extra parameters forwarded to visit_NODE_TYPE_NAME().

Returns

String (or collection of strings) with the dumped version of the root IR node.

static k_cache_var(name: str, offset: int) str[source]
classmethod k_cache_vars(k_cache: gt4py.cartesian.gtc.cuir.cuir.KCacheDecl) List[str][source]
visit_AxisBound(node: gt4py.cartesian.gtc.common.AxisBound, **kwargs: Any) str[source]
visit_BuiltInLiteral(builtin: gt4py.cartesian.gtc.common.BuiltInLiteral, **kwargs: Any) str[source]
visit_DataType(dtype: gt4py.cartesian.gtc.common.DataType, **kwargs: Any) str[source]
visit_FieldAccess(node: gt4py.cartesian.gtc.cuir.cuir.FieldAccess, **kwargs: Any)[source]
visit_IJCacheAccess(node: gt4py.cartesian.gtc.cuir.cuir.IJCacheAccess, symtable: Dict[str, Any], **kwargs: Any) str[source]
visit_Literal(node: gt4py.cartesian.gtc.cuir.cuir.Literal, *, in_data_index: bool = False, **kwargs: Any) str[source]
visit_NativeFunction(func: gt4py.cartesian.gtc.common.NativeFunction, **kwargs: Any) str[source]
visit_Program(node: gt4py.cartesian.gtc.cuir.cuir.Program, **kwargs: Any) Union[str, Collection[str]][source]
visit_VerticalLoop(node: gt4py.cartesian.gtc.cuir.cuir.VerticalLoop, *, symtable: Dict[str, Any], **kwargs: Any) Union[str, Collection[str]][source]

gt4py.cartesian.gtc.cuir.extent_analysis module

class gt4py.cartesian.gtc.cuir.extent_analysis.CacheExtents[source]

Bases: gt4py.eve.visitors.NodeTranslator

visit_IJCacheDecl(node: gt4py.cartesian.gtc.cuir.cuir.IJCacheDecl, *, ij_extents: Dict[str, gt4py.cartesian.gtc.cuir.cuir.KExtent], **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.IJCacheDecl[source]
visit_KCacheDecl(node: gt4py.cartesian.gtc.cuir.cuir.KCacheDecl, *, k_extents: Dict[str, gt4py.cartesian.gtc.cuir.cuir.KExtent], **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.KCacheDecl[source]
visit_VerticalLoop(node: gt4py.cartesian.gtc.cuir.cuir.VerticalLoop) gt4py.cartesian.gtc.cuir.cuir.VerticalLoop[source]

gt4py.cartesian.gtc.cuir.kernel_fusion module

class gt4py.cartesian.gtc.cuir.kernel_fusion.FuseKernels[source]

Bases: gt4py.eve.visitors.NodeTranslator

Fuse consecutive kernels into single kernel for better launch overhead.

Fuse kernels that are directly translated from OIR vertical loops into separate kernels if no synchronization is required.

visit_Program(node: gt4py.cartesian.gtc.cuir.cuir.Program) gt4py.cartesian.gtc.cuir.cuir.Program[source]

gt4py.cartesian.gtc.cuir.oir_to_cuir module

class gt4py.cartesian.gtc.cuir.oir_to_cuir.OIRToCUIR[source]

Bases: gt4py.eve.visitors.NodeTranslator, gt4py.eve.traits.VisitorWithSymbolTableTrait

class Context(new_symbol_name: gt4py.cartesian.gtc.cuir.oir_to_cuir.SymbolNameCreator, accessed_fields: Set[str] = <factory>, positionals: Dict[int, gt4py.cartesian.gtc.cuir.cuir.Positional] = <factory>)[source]

Bases: object

accessed_fields: Set[str]
make_positional(axis: int) gt4py.cartesian.gtc.cuir.cuir.FieldAccess[source]
new_symbol_name: gt4py.cartesian.gtc.cuir.oir_to_cuir.SymbolNameCreator
positionals: Dict[int, gt4py.cartesian.gtc.cuir.cuir.Positional]
visit_AssignStmt(node: gt4py.cartesian.gtc.oir.AssignStmt, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.AssignStmt[source]
visit_BinaryOp(node: gt4py.cartesian.gtc.oir.BinaryOp, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.BinaryOp[source]
visit_Cast(node: gt4py.cartesian.gtc.oir.Cast, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.Cast[source]
visit_FieldAccess(node: gt4py.cartesian.gtc.oir.FieldAccess, *, ij_caches: Dict[str, gt4py.cartesian.gtc.cuir.cuir.IJCacheDecl], k_caches: Dict[str, gt4py.cartesian.gtc.cuir.cuir.KCacheDecl], ctx: Context, **kwargs: Any) Union[gt4py.cartesian.gtc.cuir.cuir.FieldAccess, gt4py.cartesian.gtc.cuir.cuir.IJCacheAccess, gt4py.cartesian.gtc.cuir.cuir.KCacheAccess][source]
visit_FieldDecl(node: gt4py.cartesian.gtc.oir.FieldDecl, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.FieldDecl[source]
visit_HorizontalExecution(node: gt4py.cartesian.gtc.oir.HorizontalExecution, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.HorizontalExecution[source]
visit_HorizontalRestriction(node: gt4py.cartesian.gtc.oir.HorizontalRestriction, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.MaskStmt[source]
visit_Literal(node: gt4py.cartesian.gtc.oir.Literal, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.Literal[source]
visit_LocalScalar(node: gt4py.cartesian.gtc.oir.LocalScalar, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.LocalScalar[source]
visit_MaskStmt(node: gt4py.cartesian.gtc.oir.MaskStmt, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.MaskStmt[source]
visit_NativeFuncCall(node: gt4py.cartesian.gtc.oir.NativeFuncCall, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.NativeFuncCall[source]
visit_ScalarAccess(node: gt4py.cartesian.gtc.oir.ScalarAccess, *, symtable: Dict[str, Any], **kwargs: Any) Union[gt4py.cartesian.gtc.cuir.cuir.ScalarAccess, gt4py.cartesian.gtc.cuir.cuir.FieldAccess][source]
visit_ScalarDecl(node: gt4py.cartesian.gtc.oir.ScalarDecl, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.ScalarDecl[source]
visit_Stencil(node: gt4py.cartesian.gtc.oir.Stencil, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.Program[source]
visit_Temporary(node: gt4py.cartesian.gtc.oir.Temporary, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.Temporary[source]
visit_TernaryOp(node: gt4py.cartesian.gtc.oir.TernaryOp, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.TernaryOp[source]
visit_UnaryOp(node: gt4py.cartesian.gtc.oir.UnaryOp, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.UnaryOp[source]
visit_VariableKOffset(node: gt4py.cartesian.gtc.cuir.cuir.VariableKOffset, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.VariableKOffset[source]
visit_VerticalLoop(node: gt4py.cartesian.gtc.oir.VerticalLoop, *, symtable: Dict[str, Any], ctx: Context, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.Kernel[source]
visit_VerticalLoopSection(node: gt4py.cartesian.gtc.oir.VerticalLoopSection, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.VerticalLoopSection[source]
visit_While(node: gt4py.cartesian.gtc.oir.While, **kwargs: Any) gt4py.cartesian.gtc.cuir.cuir.While[source]
class gt4py.cartesian.gtc.cuir.oir_to_cuir.SymbolNameCreator(*args, **kwargs)[source]

Bases: Protocol

__call__(name: str) str[source]

Call self as a function.

Module contents