tvm
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
tvm::tir::StmtSRefNode Class Reference

An object that refers to schedulable elements (block/for-loop) in TensorIR, aka "sref". More...

#include <block_scope.h>

Inheritance diagram for tvm::tir::StmtSRefNode:
Collaboration diagram for tvm::tir::StmtSRefNode:

Public Member Functions

 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 Public Member Functions

static void RegisterReflection ()
 

Public Attributes

const StmtNodestmt
 The block or for stmt the object refers to. More...
 
StmtSRefNodeparent
 The parent sref. More...
 
int64_t 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. More...
 

Static Public Attributes

static constexpr const char * _type_key = "tir.StmtSRef"
 

Detailed Description

An object that refers to schedulable elements (block/for-loop) in TensorIR, aka "sref".

Glossary

Member Function Documentation

◆ 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
StmtTypeThe type that this->stmt to be downcasted to. Presumably tvm::tir::BlockNode or tvm::tir::ForNode
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   
)

Member Data Documentation

◆ _type_key

constexpr const char* tvm::tir::StmtSRefNode::_type_key = "tir.StmtSRef"
staticconstexpr

◆ parent

StmtSRefNode* tvm::tir::StmtSRefNode::parent

The parent sref.

◆ 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: