19#ifndef TVM_S_TIR_SCRIPT_IR_BUILDER_IR_H_
20#define TVM_S_TIR_SCRIPT_IR_BUILDER_IR_H_
54 ffi::Array<PrimExpr> strides = {},
55 ffi::Optional<PrimExpr> elem_offset = std::nullopt,
56 ffi::String storage_scope =
"global",
int align = -1,
int offset_factor = 0,
57 ffi::Optional<Layout> layout = std::nullopt,
58 ffi::Array<PrimExpr> allocated_addr = {});
66SBlockFrame Block(ffi::String name,
bool no_realize =
false, ffi::String exec_scope =
"");
84void Reads(ffi::Array<ffi::ObjectRef> tensor_slices);
90void Writes(ffi::Array<ffi::ObjectRef> tensor_slices);
113 ffi::Optional<Expr> data = std::nullopt,
114 ffi::Array<PrimExpr> strides = {},
115 ffi::Optional<PrimExpr> elem_offset = std::nullopt,
116 ffi::String storage_scope =
"",
int align = -1,
int offset_factor = 0,
117 ffi::Optional<Layout> layout = std::nullopt,
118 ffi::Array<PrimExpr> allocated_addr = {});
169ffi::Array<Var>
Remap(ffi::String kinds, ffi::Array<PrimExpr> bindings,
Typed reference/view over any Expr whose ExprNode::ty is PrimType.
Definition base_expr.h:447
Definition base_expr.h:161
static TVM_TIRX_DLL PrimType Int(int bits, int lanes=1)
Construct a signed integer type with fixed lanes.
static TVM_TIRX_DLL PrimType Float(int bits, int lanes=1)
Construct a floating-point type with fixed lanes.
Range container
Definition expr.h:1025
Managed reference to VarNode.
Definition expr.h:714
Managed reference to BlockInitFrameObj.
Definition frame.h:169
Managed reference to SBlockFrameObj.
Definition frame.h:128
Checked zero-state view over an ordinary VarNode with TensorType.
Definition expr.h:50
Var Reduce(Range dom, ffi::Optional< PrimExpr > binding=std::nullopt, PrimType dtype=PrimType::Int(32))
The reduced block axis defining function.
Var Spatial(Range dom, ffi::Optional< PrimExpr > binding=std::nullopt, PrimType dtype=PrimType::Int(32))
The spatial block axis defining function.
Var Opaque(Range dom, ffi::Optional< PrimExpr > binding=std::nullopt, PrimType dtype=PrimType::Int(32))
The opaque block axis defining function.
Var Scan(Range dom, ffi::Optional< PrimExpr > binding=std::nullopt, PrimType dtype=PrimType::Int(32))
The scanning block axis defining function.
ffi::Array< Var > Remap(ffi::String kinds, ffi::Array< PrimExpr > bindings, PrimType dtype=PrimType::Int(32))
The block axis remapping function.
void BlockAttrs(ffi::Map< ffi::String, ffi::Any > attrs)
The block annotation statement.
TensorVar SBlockAllocTensor(ffi::Array< PrimExpr > shape, PrimType dtype=PrimType::Float(32), ffi::Optional< Expr > data=std::nullopt, ffi::Array< PrimExpr > strides={}, ffi::Optional< PrimExpr > elem_offset=std::nullopt, ffi::String storage_scope="", int align=-1, int offset_factor=0, ffi::Optional< Layout > layout=std::nullopt, ffi::Array< PrimExpr > allocated_addr={})
The tensor allocation function.
void Reads(ffi::Array< ffi::ObjectRef > tensor_slices)
The block tensor region reading statement.
void Where(PrimExpr predicate)
The block predicate statement.
TensorVar MatchTensor(ffi::ObjectRef param, ffi::Array< PrimExpr > shape, PrimType dtype=PrimType::Float(32), ffi::Optional< Expr > data=std::nullopt, ffi::Array< PrimExpr > strides={}, ffi::Optional< PrimExpr > elem_offset=std::nullopt, ffi::String storage_scope="global", int align=-1, int offset_factor=0, ffi::Optional< Layout > layout=std::nullopt, ffi::Array< PrimExpr > allocated_addr={})
Bind a tensor subregion in an S-TIR block.
SBlockFrame Block(ffi::String name, bool no_realize=false, ffi::String exec_scope="")
The block declaration statement.
BlockInitFrame Init()
The block initialization statement.
FunctionFrame DeclFunction(bool is_private=false, bool persistent=false)
void Writes(ffi::Array< ffi::ObjectRef > tensor_slices)
The block tensor region writing statement.
FunctionFrame Function(bool is_private=false, bool persistent=false)
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition attr.h:23