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

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

#include <sblock_scope.h>

Inheritance diagram for tvm::tirx::StmtSRefObj:
Collaboration diagram for tvm::tirx::StmtSRefObj:

Public Member Functions

 TVM_FFI_DECLARE_OBJECT_INFO_FINAL ("s_tir.StmtSRef", StmtSRefObj, ffi::Object)
 
void Reset ()
 Reset the object inplace to the invalid state.
 
template<typename StmtType >
const StmtType * StmtAs () const
 Get the referenced statement with proper type checking. It serves the same purpose as ffi::ObjectRef::as, but does not acquire strong reference to stmt
 

Static Public Member Functions

static void RegisterReflection ()
 

Public Attributes

const StmtNode * stmt
 The block or for stmt the object refers to.
 
StmtSRefObj * parent
 The parent sref.
 
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.
 

Static Public Attributes

static constexpr const bool _type_mutable = true
 

Detailed Description

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

Glossary

Member Function Documentation

◆ RegisterReflection()

static void tvm::tirx::StmtSRefObj::RegisterReflection ( )
inlinestatic

◆ Reset()

void tvm::tirx::StmtSRefObj::Reset ( )
inline

Reset the object inplace to the invalid state.

◆ StmtAs()

template<typename StmtType >
const StmtType * tvm::tirx::StmtSRefObj::StmtAs ( ) const
inline

Get the referenced statement with proper type checking. It serves the same purpose as ffi::ObjectRef::as, but does not acquire strong reference to stmt

Template Parameters
StmtTypeThe type that this->stmt to be downcasted to. Presumably tvm::s_tir::SBlockNode or tvm::ForNode
Returns
nullptr if type check fails, otherwise the casted result for this->stmt

◆ TVM_FFI_DECLARE_OBJECT_INFO_FINAL()

tvm::tirx::StmtSRefObj::TVM_FFI_DECLARE_OBJECT_INFO_FINAL ( "s_tir.StmtSRef"  ,
StmtSRefObj  ,
ffi::Object   
)

Member Data Documentation

◆ _type_mutable

constexpr const bool tvm::tirx::StmtSRefObj::_type_mutable = true
staticconstexpr

◆ parent

StmtSRefObj* tvm::tirx::StmtSRefObj::parent

The parent sref.

◆ seq_index

int64_t tvm::tirx::StmtSRefObj::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::tirx::StmtSRefObj::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: