tvm
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
tvm::s_tir::SBlockNode Class Reference

A block is a basic schedule unit in TIR. More...

#include <stmt.h>

Inheritance diagram for tvm::s_tir::SBlockNode:
Collaboration diagram for tvm::s_tir::SBlockNode:

Public Member Functions

 SBlockNode (ffi::UnsafeInit tag)
 
 SBlockNode (SeqStmt body)
 
 TVM_FFI_DECLARE_OBJECT_INFO_FINAL ("s_tir.SBlock", SBlockNode, StmtNode)
 
- Public Member Functions inherited from tvm::StmtNode
 StmtNode ()=default
 
 StmtNode (Location loc)
 
 TVM_FFI_DECLARE_OBJECT_INFO ("ir.Stmt", StmtNode, ffi::Object)
 

Static Public Member Functions

static void RegisterReflection ()
 
- Static Public Member Functions inherited from tvm::StmtNode
static void RegisterReflection ()
 

Public Attributes

ffi::Array< s_tir::IterVar > iter_vars
 The variables of the block.
 
ffi::Array< TensorRegion > reads
 The read tensor regions of the block.
 
ffi::Array< TensorRegion > writes
 The write tensor regions of the block.
 
ffi::String name_hint
 The name_hint of the block.
 
ffi::Array< tirx::TensorVar > alloc_tensors
 The tensor allocated in the block.
 
ffi::Array< MatchTensorRegion > match_tensors
 The match tensor regions.
 
ffi::Map< ffi::String, ffi::Any > annotations
 The annotation of the block.
 
ffi::Optional< SeqStmt > init
 The init statement is executed during the first iteration of reduction loops in a reduction block. The optional init field allows us to represent initialization and reduction update in a single block and transform them collectively. We also provide primitives to decompose the init into a separate block during scheduling. Init field is std::nullopt if there is no reduction iter_vars.
 
SeqStmt body
 The body of the block.
 
- Public Attributes inherited from tvm::StmtNode
Location loc = UnknownLoc()
 Location that points to the original source code. Reserved debug information.
 

Additional Inherited Members

- Static Public Attributes inherited from tvm::StmtNode
static constexpr TVMFFISEqHashKind _type_s_eq_hash_kind = kTVMFFISEqHashKindTreeNode
 
static constexpr bool _type_s_eq_hash_subclass_kind_fixed = true
 
static constexpr const uint32_t _type_child_slots = 15
 

Detailed Description

A block is a basic schedule unit in TIR.

Note
SBlock's body is parameterized by iter vars.
with T.sblock(name):
v0 = T.axis.S(domain, value0)
v1 = T.axis.R(domain, value1)
...
T.reads([tensor0[start:end, ...], ...])
T.writes([tensor1[start:end, ...], ...])
T.where(predicate)
tensor2 = T.alloc_tensor(ty_args=[T.Tensor(shape, dtype)])
tensor3 = Ts.match_tensor(source_tensor[start:end, ...])
Ts.sblock_attr({attr_key: attr_value, ...})
with T.init():
// init body
// body
ffi::Array< TensorRegion > writes
The write tensor regions of the block.
Definition stmt.h:123

Constructor & Destructor Documentation

◆ SBlockNode() [1/2]

tvm::s_tir::SBlockNode::SBlockNode ( ffi::UnsafeInit  tag)
inlineexplicit

◆ SBlockNode() [2/2]

tvm::s_tir::SBlockNode::SBlockNode ( SeqStmt  body)
inlineexplicit

Member Function Documentation

◆ RegisterReflection()

static void tvm::s_tir::SBlockNode::RegisterReflection ( )
inlinestatic

◆ TVM_FFI_DECLARE_OBJECT_INFO_FINAL()

tvm::s_tir::SBlockNode::TVM_FFI_DECLARE_OBJECT_INFO_FINAL ( "s_tir.SBlock"  ,
SBlockNode  ,
StmtNode   
)

Member Data Documentation

◆ alloc_tensors

ffi::Array<tirx::TensorVar> tvm::s_tir::SBlockNode::alloc_tensors

The tensor allocated in the block.

◆ annotations

ffi::Map<ffi::String, ffi::Any> tvm::s_tir::SBlockNode::annotations

The annotation of the block.

◆ body

SeqStmt tvm::s_tir::SBlockNode::body

The body of the block.

◆ init

ffi::Optional<SeqStmt> tvm::s_tir::SBlockNode::init

The init statement is executed during the first iteration of reduction loops in a reduction block. The optional init field allows us to represent initialization and reduction update in a single block and transform them collectively. We also provide primitives to decompose the init into a separate block during scheduling. Init field is std::nullopt if there is no reduction iter_vars.

◆ iter_vars

ffi::Array<s_tir::IterVar> tvm::s_tir::SBlockNode::iter_vars

The variables of the block.

◆ match_tensors

ffi::Array<MatchTensorRegion> tvm::s_tir::SBlockNode::match_tensors

The match tensor regions.

◆ name_hint

ffi::String tvm::s_tir::SBlockNode::name_hint

The name_hint of the block.

◆ reads

ffi::Array<TensorRegion> tvm::s_tir::SBlockNode::reads

The read tensor regions of the block.

◆ writes

ffi::Array<TensorRegion> tvm::s_tir::SBlockNode::writes

The write tensor regions of the block.


The documentation for this class was generated from the following file: