An object that refers to schedulable elements (block/for-loop) in TensorIR, aka "sref".
More...
#include <block_scope.h>
|
| TVM_DECLARE_FINAL_OBJECT_INFO (StmtSRefNode, Object) |
|
void | Reset () |
| Reset the object inplace to the invalid state. More...
|
|
template<typename StmtType > |
const StmtType * | StmtAs () const |
| Get the referenced statement with proper type checking. It serves the same purpose as ObjectRef::as , but does not acquire strong reference to stmt More...
|
|
|
static constexpr const char * | _type_key = "tir.StmtSRef" |
|
An object that refers to schedulable elements (block/for-loop) in TensorIR, aka "sref".
Glossary
- Block sref: A StmtSRef that points to a TensorIR block.
- Loop sref: A StmtSRef that points to a TensorIR for loop.
- Parent sref: The parent reference of an sref is the block or loop reference to the closest schedulable statement. We define closest to be the nearest schedulable statement of an ancestor in the AST. schedulable statement of its ancestors on the TensorIR AST.
- Root sref: Sref to the root block. Every sref has exactly one parent sref except for root sref.
- Sref tree: The parent-children-relationship of srefs that forms a tree, uniquely determined by the TensorIR AST.
◆ RegisterReflection()
static void tvm::tir::StmtSRefNode::RegisterReflection |
( |
| ) |
|
|
inlinestatic |
◆ Reset()
void tvm::tir::StmtSRefNode::Reset |
( |
| ) |
|
|
inline |
Reset the object inplace to the invalid state.
◆ StmtAs()
template<typename StmtType >
const StmtType* tvm::tir::StmtSRefNode::StmtAs |
( |
| ) |
const |
|
inline |
Get the referenced statement with proper type checking. It serves the same purpose as ObjectRef::as
, but does not acquire strong reference to stmt
- Template Parameters
-
- Returns
- nullptr if type check fails, otherwise the casted result for
this->stmt
◆ TVM_DECLARE_FINAL_OBJECT_INFO()
tvm::tir::StmtSRefNode::TVM_DECLARE_FINAL_OBJECT_INFO |
( |
StmtSRefNode |
, |
|
|
Object |
|
|
) |
| |
◆ _type_key
constexpr const char* tvm::tir::StmtSRefNode::_type_key = "tir.StmtSRef" |
|
staticconstexpr |
◆ parent
◆ seq_index
int64_t tvm::tir::StmtSRefNode::seq_index |
If the statement the sref points to is an element of a SeqStmt in the AST, then seq_index
is set to its index; otherwise seq_index
is -1.
◆ stmt
const StmtNode* tvm::tir::StmtSRefNode::stmt |
The block or for
stmt the object refers to.
- Note
- Non-owned reference (raw pointer) is used here, so that we can perform copy-on-write optimization on statements when possible. The strong reference is held in the ScheduleState.
The documentation for this class was generated from the following file: