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

An object with 1-to-1 correspondence with each block reference in the sref tree. This data structure is used to track the producer-consumer dependencies between blocks. For example even leaf nodes have a scope node, even though they have no dependencies. More...

#include <sblock_scope.h>

Inheritance diagram for tvm::tirx::SBlockScopeObj:
Collaboration diagram for tvm::tirx::SBlockScopeObj:

Public Member Functions

 TVM_FFI_DECLARE_OBJECT_INFO_FINAL ("s_tir.SBlockScope", SBlockScopeObj, ffi::Object)
 
ffi::Array< Dependency > GetDepsBySrc (const StmtSRef &src) const
 Get all dependencies whose src equals src
 
ffi::Array< Dependency > GetDepsByDst (const StmtSRef &dst) const
 Get all dependencies whose dst equals dst
 

Static Public Member Functions

static void RegisterReflection ()
 

Public Attributes

std::unordered_map< StmtSRef, ffi::Array< Dependency >, ffi::ObjectPtrHash, ffi::ObjectPtrEqual > src2deps
 Lookup table for the src of dependencies.
 
std::unordered_map< StmtSRef, ffi::Array< Dependency >, ffi::ObjectPtrHash, ffi::ObjectPtrEqual > dst2deps
 Lookup table for the dst of dependencies.
 
std::unordered_map< TensorVar, ffi::Array< StmtSRef >, ffi::ObjectPtrHash, ffi::ObjectPtrEqual > tensor_writers
 The mapping from the tensor to the blocks who write it.
 

Detailed Description

An object with 1-to-1 correspondence with each block reference in the sref tree. This data structure is used to track the producer-consumer dependencies between blocks. For example even leaf nodes have a scope node, even though they have no dependencies.

Glossary:

Member Function Documentation

◆ GetDepsByDst()

ffi::Array< Dependency > tvm::tirx::SBlockScopeObj::GetDepsByDst ( const StmtSRef &  dst) const

Get all dependencies whose dst equals dst

Parameters
dstThe queried block
Returns
The dependencies

◆ GetDepsBySrc()

ffi::Array< Dependency > tvm::tirx::SBlockScopeObj::GetDepsBySrc ( const StmtSRef &  src) const

Get all dependencies whose src equals src

Parameters
srcThe queried block
Returns
The dependencies

◆ RegisterReflection()

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

◆ TVM_FFI_DECLARE_OBJECT_INFO_FINAL()

tvm::tirx::SBlockScopeObj::TVM_FFI_DECLARE_OBJECT_INFO_FINAL ( "s_tir.SBlockScope"  ,
SBlockScopeObj  ,
ffi::Object   
)

Member Data Documentation

◆ dst2deps

std::unordered_map<StmtSRef, ffi::Array<Dependency>, ffi::ObjectPtrHash, ffi::ObjectPtrEqual> tvm::tirx::SBlockScopeObj::dst2deps

Lookup table for the dst of dependencies.

◆ src2deps

std::unordered_map<StmtSRef, ffi::Array<Dependency>, ffi::ObjectPtrHash, ffi::ObjectPtrEqual> tvm::tirx::SBlockScopeObj::src2deps

Lookup table for the src of dependencies.

Note
We intentionally didn't use tvm::Map as the data structure, because we need the values inside to be mutable so that they could be further maintained properly during transformations.

◆ tensor_writers

std::unordered_map<TensorVar, ffi::Array<StmtSRef>, ffi::ObjectPtrHash, ffi::ObjectPtrEqual> tvm::tirx::SBlockScopeObj::tensor_writers

The mapping from the tensor to the blocks who write it.


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