tvm
Loading...
Searching...
No Matches
Namespaces | Classes | Functions
tvm::script::ir_builder::s_tir Namespace Reference

Namespaces

namespace  axis
 

Classes

class  BlockInitFrame
 Managed reference to BlockInitFrameObj. More...
 
class  BlockInitFrameObj
 A frame that represents the block initialization statment. More...
 
class  FunctionFrame
 
class  FunctionFrameObj
 Function frame owning schedulable TIR construction. More...
 
class  SBlockFrame
 Managed reference to SBlockFrameObj. More...
 
class  SBlockFrameObj
 A frame that represents the block. More...
 

Functions

FunctionFrame Function (bool is_private=false, bool persistent=false)
 
FunctionFrame DeclFunction (bool is_private=false, bool persistent=false)
 
TensorVar MatchTensor (ffi::ObjectRef param, ffi::Array< PrimExpr > shape, PrimType dtype=PrimType::Float(32), ffi::Optional< Expr > data=std::nullopt, ffi::Array< PrimExpr > strides={}, ffi::Optional< PrimExpr > elem_offset=std::nullopt, ffi::String storage_scope="global", int align=-1, int offset_factor=0, ffi::Optional< Layout > layout=std::nullopt, ffi::Array< PrimExpr > allocated_addr={})
 Bind a tensor subregion in an S-TIR block.
 
SBlockFrame Block (ffi::String name, bool no_realize=false, ffi::String exec_scope="")
 The block declaration statement.
 
BlockInitFrame Init ()
 The block initialization statement.
 
void Where (PrimExpr predicate)
 The block predicate statement.
 
void Reads (ffi::Array< ffi::ObjectRef > tensor_slices)
 The block tensor region reading statement.
 
void Writes (ffi::Array< ffi::ObjectRef > tensor_slices)
 The block tensor region writing statement.
 
void BlockAttrs (ffi::Map< ffi::String, ffi::Any > attrs)
 The block annotation statement.
 
TensorVar SBlockAllocTensor (ffi::Array< PrimExpr > shape, PrimType dtype=PrimType::Float(32), ffi::Optional< Expr > data=std::nullopt, ffi::Array< PrimExpr > strides={}, ffi::Optional< PrimExpr > elem_offset=std::nullopt, ffi::String storage_scope="", int align=-1, int offset_factor=0, ffi::Optional< Layout > layout=std::nullopt, ffi::Array< PrimExpr > allocated_addr={})
 The tensor allocation function.
 

Function Documentation

◆ Block()

SBlockFrame tvm::script::ir_builder::s_tir::Block ( ffi::String  name,
bool  no_realize = false,
ffi::String  exec_scope = "" 
)

The block declaration statement.

Parameters
nameThe name of the block.
no_realizeThe flag whether to construct s_tir::SBlockRealize or s_tir::SBlock.
Returns
The SBlockFrame.

◆ BlockAttrs()

void tvm::script::ir_builder::s_tir::BlockAttrs ( ffi::Map< ffi::String, ffi::Any >  attrs)

The block annotation statement.

Parameters
attrsThe annotation of the block.

◆ DeclFunction()

FunctionFrame tvm::script::ir_builder::s_tir::DeclFunction ( bool  is_private = false,
bool  persistent = false 
)

◆ Function()

FunctionFrame tvm::script::ir_builder::s_tir::Function ( bool  is_private = false,
bool  persistent = false 
)

◆ Init()

BlockInitFrame tvm::script::ir_builder::s_tir::Init ( )

The block initialization statement.

Returns
The BlockInitFrame.

◆ MatchTensor()

TensorVar tvm::script::ir_builder::s_tir::MatchTensor ( ffi::ObjectRef  param,
ffi::Array< PrimExpr >  shape,
PrimType  dtype = PrimType::Float(32),
ffi::Optional< Expr >  data = std::nullopt,
ffi::Array< PrimExpr >  strides = {},
ffi::Optional< PrimExpr >  elem_offset = std::nullopt,
ffi::String  storage_scope = "global",
int  align = -1,
int  offset_factor = 0,
ffi::Optional< Layout >  layout = std::nullopt,
ffi::Array< PrimExpr >  allocated_addr = {} 
)

Bind a tensor subregion in an S-TIR block.

Parameters
paramThe tensor subregion to match.
shapeThe type of the tensor prior to flattening.
dtypeThe data type in the content of the tensor.
dataThe pointer to the head of the data.
stridesThe strides of each dimension.
elem_offsetThe offset in terms of number of dtype elements (including lanes).
storage_scopeThe optional storage scope of tensor data pointer.
alignThe alignment requirement of data pointer in bytes.
offset_factorThe factor of elem_offset field.
layoutThe tensor layout.
allocated_addrAddresses assigned to the tensor allocation.
Returns
The matched tensor.

◆ Reads()

void tvm::script::ir_builder::s_tir::Reads ( ffi::Array< ffi::ObjectRef >  tensor_slices)

The block tensor region reading statement.

Parameters
tensor_slicesThe array of tensor regions to read.

◆ SBlockAllocTensor()

TensorVar tvm::script::ir_builder::s_tir::SBlockAllocTensor ( ffi::Array< PrimExpr >  shape,
PrimType  dtype = PrimType::Float(32),
ffi::Optional< Expr >  data = std::nullopt,
ffi::Array< PrimExpr >  strides = {},
ffi::Optional< PrimExpr >  elem_offset = std::nullopt,
ffi::String  storage_scope = "",
int  align = -1,
int  offset_factor = 0,
ffi::Optional< Layout >  layout = std::nullopt,
ffi::Array< PrimExpr >  allocated_addr = {} 
)

The tensor allocation function.

Parameters
shapeThe type of the tensor prior to flattening.
dtypeThe data type in the content of the tensor.
dataThe pointer to the head of the data.
stridesThe strides of each dimension.
elem_offsetThe offset in terms of number of dtype elements (including lanes).
storage_scopeThe optional storage scope of tensor data pointer.
alignThe alignment requirement of data pointer in bytes.
offset_factorThe factor of elem_offset field.
layoutThe layout of the tensor.
allocated_addrThe allocated address of the tensor. Might be multi-dimensional.
Returns
The tensor attached to its enclosing block or function allocation list.

◆ Where()

void tvm::script::ir_builder::s_tir::Where ( PrimExpr  predicate)

The block predicate statement.

Parameters
predicateThe predicate condition.

◆ Writes()

void tvm::script::ir_builder::s_tir::Writes ( ffi::Array< ffi::ObjectRef >  tensor_slices)

The block tensor region writing statement.

Parameters
tensor_slicesThe array of tensor regions to write.