19#ifndef TVM_S_TIR_SCRIPT_IR_BUILDER_FRAME_H_
20#define TVM_S_TIR_SCRIPT_IR_BUILDER_FRAME_H_
39 namespace refl = tvm::ffi::reflection;
40 refl::ObjectDef<FunctionFrameObj>()
48 ffi::Array<PrimExpr> allocated_addr);
72 ffi::Optional<ffi::Array<tvm::TensorRegion>>
reads;
74 ffi::Optional<ffi::Array<tvm::TensorRegion>>
writes;
76 ffi::Optional<tvm::SeqStmt>
init;
96 namespace refl = tvm::ffi::reflection;
97 refl::ObjectDef<SBlockFrameObj>()
130 explicit SBlockFrame(ffi::ObjectPtr<SBlockFrameObj> data) : ir::StmtFrame(ffi::UnsafeInit{}) {
131 TVM_FFI_ICHECK(data !=
nullptr);
132 data_ = std::move(data);
145 namespace refl = tvm::ffi::reflection;
146 refl::ObjectDef<BlockInitFrameObj>();
161 void ExitWithScope() final;
172 : ir::StmtFrame(ffi::UnsafeInit{}) {
173 TVM_FFI_ICHECK(data !=
nullptr);
174 data_ = std::move(data);
Managed reference to TensorRegionNode.
Definition expr.h:1079
A shared frame containing a sequence of core IR statements.
Definition frame.h:84
Managed reference to StmtFrameObj.
Definition frame.h:96
A frame that represents the block initialization statment.
Definition frame.h:142
static void RegisterReflection()
Definition frame.h:144
void EnterWithScope() final
The method called when entering RAII scope.
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("script.ir_builder.s_tir.BlockInitFrame", BlockInitFrameObj, ir::StmtFrameObj)
Managed reference to BlockInitFrameObj.
Definition frame.h:169
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(BlockInitFrame, ir::StmtFrame, BlockInitFrameObj)
BlockInitFrame(ffi::ObjectPtr< BlockInitFrameObj > data)
Definition frame.h:171
Function frame owning schedulable TIR construction.
Definition frame.h:31
ffi::Array< tvm::tirx::TensorVar > root_alloc_tensors
Tensors allocated in the implicit root block.
Definition frame.h:34
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("script.ir_builder.s_tir.FunctionFrame", FunctionFrameObj, tirx::FunctionFrameObj)
static void BindTensorRegion(tvm::tirx::TensorVar tensor, tvm::TensorRegion region, ffi::Array< PrimExpr > allocated_addr)
Register an alias in the current block, including standalone block construction.
tvm::tirx::Function FinalizeFunction(tvm::tirx::Function func) final
Complete dialect-specific function construction before publication.
static void RegisterReflection()
Definition frame.h:38
tvm::s_tir::TensorAllocatedAddresses root_allocated_addresses
Placement of allocations owned by the implicit root block.
Definition frame.h:36
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(FunctionFrame, tirx::FunctionFrame, FunctionFrameObj)
FunctionFrame(ffi::ObjectPtr< FunctionFrameObj > data)
Definition frame.h:54
A frame that represents the block.
Definition frame.h:65
ffi::Optional< PrimExpr > predicate
The predicate of the block realization, the block will only be executed when the predicate is true.
Definition frame.h:91
ffi::Array< PrimExpr > iter_values
The corresponding values of the iter vars.
Definition frame.h:86
ffi::Optional< ffi::Array< tvm::TensorRegion > > writes
The write tensor regions of the block.
Definition frame.h:74
bool no_realize
The flag whether to construct BlockRealize or Block.
Definition frame.h:93
ffi::Optional< ffi::Map< ffi::String, Any > > annotations
The annotation of the block.
Definition frame.h:84
tvm::s_tir::TensorAllocatedAddresses allocated_addresses
Placement attached to the block's allocations and aliases.
Definition frame.h:82
static void RegisterReflection()
Definition frame.h:95
ffi::Array< tvm::s_tir::MatchTensorRegion > match_tensors
The match tensor regions.
Definition frame.h:80
void ExitWithScope() final
The method called when exiting RAII scope.
ffi::String name
The name of the block.
Definition frame.h:68
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("script.ir_builder.s_tir.SBlockFrame", SBlockFrameObj, ir::StmtFrameObj)
ffi::Optional< ffi::Array< tvm::TensorRegion > > reads
The read tensor regions of the block.
Definition frame.h:72
ffi::Array< tvm::s_tir::IterVar > iter_vars
The variables of the block.
Definition frame.h:70
ffi::Array< tvm::tirx::TensorVar > alloc_tensors
The tensor allocated in the block.
Definition frame.h:78
ffi::Optional< tvm::SeqStmt > init
The init statement of the bolck.
Definition frame.h:76
Managed reference to SBlockFrameObj.
Definition frame.h:128
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(SBlockFrame, ir::StmtFrame, SBlockFrameObj)
SBlockFrame(ffi::ObjectPtr< SBlockFrameObj > data)
Definition frame.h:130
A frame that represents the Function containing TIR statements.
Definition frame.h:57
Managed reference to FunctionFrameObj.
Definition frame.h:114
Managed reference to FunctionNode.
Definition function.h:105
Checked zero-state view over an ordinary VarNode with TensorType.
Definition expr.h:50
ffi::Array< ffi::Tuple< Var, ffi::Array< PrimExpr > > > TensorAllocatedAddresses
Placement entries owned by a block, traversable with their tensor references.
Definition stmt.h:38
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition attr.h:23
S-TIR (Schedulable TIR) statements and attributes.