tvm
Namespaces | Classes | Functions
tvm::script::ir_builder::tir Namespace Reference

Namespaces

 axis
 

Classes

class  TIRFrameNode
 A base frame that represents the TIR fame with body of statements. More...
 
class  TIRFrame
 Managed reference to TIRFrameNode. More...
 
class  PrimFuncFrameNode
 A frame that represents the PrimFunc containing TIR statements. More...
 
class  PrimFuncFrame
 Managed reference to PrimFuncFrameNode. More...
 
class  BlockFrameNode
 A frame that represents the block. More...
 
class  BlockFrame
 Managed reference to BlockFrameNode. More...
 
class  BlockInitFrameNode
 A frame that represents the block initialization statment. More...
 
class  BlockInitFrame
 Managed reference to BlockInitFrameNode. More...
 
class  ForFrameNode
 A frame that represents the for loop. More...
 
class  ForFrame
 Managed reference to ForFrameNode. More...
 
class  AssertFrameNode
 A frame that represents the assert statement. Proceeds if the condition is true, otherwise aborts with the message. More...
 
class  AssertFrame
 Managed reference to AssertFrameNode. More...
 
class  LetFrameNode
 A frame represents the let binding expression, which binds a var. More...
 
class  LetFrame
 Managed reference to LetFrameNode. More...
 
class  LaunchThreadFrameNode
 The LaunchThreadFrameNode. More...
 
class  LaunchThreadFrame
 Managed reference to LaunchThreadFrameNode. More...
 
class  RealizeFrameNode
 A frame that represents realization. More...
 
class  RealizeFrame
 Managed reference to RealizeFrameNode. More...
 
class  AllocateFrameNode
 A frame represents the allocate. More...
 
class  AllocateFrame
 Managed reference to AllocateFrameNode. More...
 
class  AllocateConstFrameNode
 A frame represents the allocate constant. More...
 
class  AllocateConstFrame
 Managed reference to AllocateConstFrameNode. More...
 
class  AttrFrameNode
 A frame that represents attribute node. More...
 
class  AttrFrame
 Managed reference to AttrFrameNode. More...
 
class  WhileFrameNode
 A frame that represents while loop. More...
 
class  WhileFrame
 Managed reference to WhileFrameNode. More...
 
class  IfFrameNode
 A frame that represents if statement. More...
 
class  IfFrame
 Managed reference to IfFrameNode. More...
 
class  ThenFrameNode
 A frame that represents then. More...
 
class  ThenFrame
 Managed reference to ThenFrameNode. More...
 
class  ElseFrameNode
 A frame that represents else. More...
 
class  ElseFrame
 Managed reference to ElseFrameNode. More...
 
class  DeclBufferFrameNode
 
class  DeclBufferFrame
 

Functions

Buffer BufferDecl (Array< PrimExpr > shape, DataType dtype, String buffer_name, Optional< Var > data, Optional< Array< PrimExpr >> strides, Optional< PrimExpr > elem_offset, String storage_scope, int align, int offset_factor, String buffer_type, Optional< Array< IntImm >> axis_separators)
 The buffer declaration function. More...
 
PrimFuncFrame PrimFunc (bool is_private)
 The primitive function statement. More...
 
Var Arg (String name, Var var)
 The PrimFunc variable arguments adding function. More...
 
Buffer Arg (String name, Buffer buffer)
 The PrimFunc buffer arguments adding function. More...
 
void FuncName (String name)
 The PrimFunc naming statement. More...
 
void FuncAttrs (Map< String, ObjectRef > attrs)
 The PrimFunc annotation statement. More...
 
Type FuncRet (Type ret_type)
 The PrimFunc return type statement. More...
 
Buffer MatchBuffer (ObjectRef param, Array< PrimExpr > shape, DataType dtype=DataType::Float(32), Optional< Var > data=NullOpt, Array< PrimExpr > strides={}, PrimExpr elem_offset=PrimExpr(), String storage_scope="global", int align=-1, int offset_factor=0, String buffer_type="default", Array< IntImm > axis_separators={})
 The buffer match statement. More...
 
BlockFrame Block (String name, bool no_realize=false)
 The block declaration statement. More...
 
BlockInitFrame Init ()
 The block initialization statement. More...
 
void Where (PrimExpr predicate)
 The block predicate statement. More...
 
void Reads (Array< ObjectRef > buffer_slices)
 The block buffer region reading statement. More...
 
void Writes (Array< ObjectRef > buffer_slices)
 The block buffer region writing statement. More...
 
void BlockAttrs (Map< String, ObjectRef > attrs)
 The block annotation statement. More...
 
Buffer AllocBuffer (Array< PrimExpr > shape, DataType dtype=DataType::Float(32), Optional< Var > data=NullOpt, Array< PrimExpr > strides={}, PrimExpr elem_offset=PrimExpr(), String storage_scope="", int align=-1, int offset_factor=0, String buffer_type="default", Array< IntImm > axis_separators={})
 The buffer allocation function. More...
 
ForFrame Serial (PrimExpr start, PrimExpr stop, Optional< Map< String, ObjectRef >> annotations=NullOpt)
 The serial For statement. More...
 
ForFrame Parallel (PrimExpr start, PrimExpr stop, Optional< Map< String, ObjectRef >> annotations=NullOpt)
 The parallel For statement. More...
 
ForFrame Vectorized (PrimExpr start, PrimExpr stop, Optional< Map< String, ObjectRef >> annotations=NullOpt)
 The vectorized For statement. More...
 
ForFrame Unroll (PrimExpr start, PrimExpr stop, Optional< Map< String, ObjectRef >> annotations=NullOpt)
 The unrolled For statement. More...
 
ForFrame ThreadBinding (PrimExpr start, PrimExpr stop, String thread, Optional< Map< String, ObjectRef >> annotations=NullOpt)
 The thread-binding For statement. More...
 
ForFrame Grid (Array< PrimExpr > extents)
 The grid For statement. More...
 
AssertFrame Assert (PrimExpr condition, String message)
 The assertion statement. More...
 
LetFrame LetStmt (PrimExpr value, Optional< Type > type_annotation=NullOpt, Optional< Var > var=NullOpt)
 The let binding. More...
 
RealizeFrame Realize (tvm::tir::BufferRegion buffer_slice, String storage_scope, PrimExpr condition)
 The realization. More...
 
AllocateFrame Allocate (Array< PrimExpr > extents, DataType dtype, String storage_scope="", Optional< PrimExpr > condition=NullOpt, Optional< Map< String, ObjectRef >> annotations=NullOpt)
 The allocate node. More...
 
AllocateConstFrame AllocateConst (NDArray data, DataType dtype, Array< PrimExpr > extents, Optional< Map< String, ObjectRef >> annotations=NullOpt)
 The allocate constant node. More...
 
AttrFrame Attr (ObjectRef node, String attr_key, PrimExpr value)
 Create an attribute. More...
 
WhileFrame While (PrimExpr condition)
 Create a while loop. More...
 
IfFrame If (PrimExpr condition)
 Create an if statement. More...
 
ThenFrame Then ()
 Create a then. More...
 
ElseFrame Else ()
 Create an else. More...
 
DeclBufferFrame DeclBuffer (Array< PrimExpr > shape, DataType dtype, String buffer_name, Optional< Var > data, Optional< Array< PrimExpr >> strides, Optional< PrimExpr > elem_offset, String storage_scope, int align, int offset_factor, String buffer_type, Optional< Array< IntImm >> axis_separators)
 The buffer declaration frame. More...
 
LaunchThreadFrame LaunchThread (Var var, PrimExpr extent)
 Launch a thread. More...
 
LaunchThreadFrame LaunchThread (String thread_tag, PrimExpr extent)
 Launch a new thread. More...
 
Var EnvThread (String thread_tag, DataType dtype=DataType::Int(32))
 Bind a var to thread env. More...
 
void BufferStore (Buffer buffer, PrimExpr value, Array< PrimExpr > indices, Optional< PrimExpr > predicate)
 Store data in a buffer. More...
 
void Prefetch (Buffer buffer, Array< Range > bounds)
 The prefetch hint for a buffer. More...
 
void Evaluate (PrimExpr value)
 Evaluate the input expression. More...
 
Var Handle (runtime::DataType dtype=runtime::DataType::Void(), String storage_scope="global", bool is_size_var=false, bool is_unknown_type=false)
 Create a TIR var that represents a pointer. More...
 
PrimExpr Float8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float16 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float32 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float64 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt16 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt32 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt64 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int16 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int32 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int64 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float8x4 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float8x8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float8x16 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float8x32 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float8x64 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float16x4 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float16x8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float16x16 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float16x32 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float16x64 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float32x4 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float32x8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float32x16 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float32x32 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float32x64 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float64x4 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float64x8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float64x16 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float64x32 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Float64x64 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt8x4 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt8x8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt8x16 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt8x32 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt8x64 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt16x4 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt16x8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt16x16 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt16x32 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt16x64 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt32x4 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt32x8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt32x16 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt32x32 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt32x64 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt64x4 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt64x8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt64x16 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt64x32 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr UInt64x64 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int8x4 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int8x8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int8x16 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int8x32 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int8x64 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int16x4 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int16x8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int16x16 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int16x32 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int16x64 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int32x4 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int32x8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int32x16 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int32x32 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int32x64 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int64x4 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int64x8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int64x16 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int64x32 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Int64x64 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr E4M3Float8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr E4M3Float8x4 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr E4M3Float8x8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr E4M3Float8x16 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr E4M3Float8x32 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr E4M3Float8x64 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr E5M2Float8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr E5M2Float8x4 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr E5M2Float8x8 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr E5M2Float8x16 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr E5M2Float8x32 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr E5M2Float8x64 (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Boolean (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 
PrimExpr Void (Optional< PrimExpr > expr=NullOpt, bool is_size_var=false)
 

Function Documentation

◆ Allocate()

AllocateFrame tvm::script::ir_builder::tir::Allocate ( Array< PrimExpr extents,
DataType  dtype,
String  storage_scope = "",
Optional< PrimExpr condition = NullOpt,
Optional< Map< String, ObjectRef >>  annotations = NullOpt 
)

The allocate node.

Parameters
extentsThe extents of the allocate.
dtypeThe data type of the buffer.
storage_scopeThe storage scope.
conditionThe condition.
annotationsAdditional annotation hints.
Returns
The created AllocateFrame.

◆ AllocateConst()

AllocateConstFrame tvm::script::ir_builder::tir::AllocateConst ( NDArray  data,
DataType  dtype,
Array< PrimExpr extents,
Optional< Map< String, ObjectRef >>  annotations = NullOpt 
)

The allocate constant node.

Parameters
dataThe data associated with the constant.
dtypeThe data type of the buffer.
extentsThe extents of the allocate.
annotationsAdditional annotation hints.
Returns
The created AllocateConstFrame.

◆ AllocBuffer()

Buffer tvm::script::ir_builder::tir::AllocBuffer ( Array< PrimExpr shape,
DataType  dtype = DataType::Float(32),
Optional< Var data = NullOpt,
Array< PrimExpr strides = {},
PrimExpr  elem_offset = PrimExpr(),
String  storage_scope = "",
int  align = -1,
int  offset_factor = 0,
String  buffer_type = "default",
Array< IntImm axis_separators = {} 
)

The buffer allocation function.

Parameters
shapeThe type of the buffer prior to flattening.
dtypeThe data type in the content of the buffer.
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 buffer data pointer.
alignThe alignment requirement of data pointer in bytes.
offset_factorThe factor of elem_offset field.
buffer_typeThe buffer type.
axis_separatorsThe separators between input axes when generating flattened output axes.
Returns
The allocated buffer.

◆ Arg() [1/2]

Buffer tvm::script::ir_builder::tir::Arg ( String  name,
Buffer  buffer 
)

The PrimFunc buffer arguments adding function.

Parameters
nameThe name of the buffer.
bufferThe buffer argument.
Returns
The buffer.

◆ Arg() [2/2]

Var tvm::script::ir_builder::tir::Arg ( String  name,
Var  var 
)

The PrimFunc variable arguments adding function.

Parameters
nameThe name of the variable.
varThe variable argument.
Returns
The variable.

◆ Assert()

AssertFrame tvm::script::ir_builder::tir::Assert ( PrimExpr  condition,
String  message 
)

The assertion statement.

Parameters
conditionThe assertion condition.
messageThe error message when the assertion fails.
Returns
The AssertFrame.

◆ Attr()

AttrFrame tvm::script::ir_builder::tir::Attr ( ObjectRef  node,
String  attr_key,
PrimExpr  value 
)

Create an attribute.

Parameters
nodeThe node to annotate the attribute.
attr_keyAttribute type key.
valueThe value of the attribute.
Returns
The result AttrFrame.

◆ Block()

BlockFrame tvm::script::ir_builder::tir::Block ( String  name,
bool  no_realize = false 
)

The block declaration statement.

Parameters
nameThe name of the block.
no_realizeThe flag whether to construct BlockRealize or Block.
Returns
The BlockFrame.

◆ BlockAttrs()

void tvm::script::ir_builder::tir::BlockAttrs ( Map< String, ObjectRef attrs)

The block annotation statement.

Parameters
attrsThe annotation of the block.

◆ Boolean()

PrimExpr tvm::script::ir_builder::tir::Boolean ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ BufferDecl()

Buffer tvm::script::ir_builder::tir::BufferDecl ( Array< PrimExpr shape,
DataType  dtype,
String  buffer_name,
Optional< Var data,
Optional< Array< PrimExpr >>  strides,
Optional< PrimExpr elem_offset,
String  storage_scope,
int  align,
int  offset_factor,
String  buffer_type,
Optional< Array< IntImm >>  axis_separators 
)

The buffer declaration function.

Parameters
shapeThe type of the buffer prior to flattening.
dtypeThe data type in the content of the buffer.
buffer_nameThe name of the buffer.
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 buffer data pointer.
alignThe alignment requirement of data pointer in bytes.
offset_factorThe factor of elem_offset field.
buffer_typeThe buffer type.
axis_separatorsThe separators between input axes when generating flattened output axes.
Returns
The declared buffer.

◆ BufferStore()

void tvm::script::ir_builder::tir::BufferStore ( Buffer  buffer,
PrimExpr  value,
Array< PrimExpr indices,
Optional< PrimExpr predicate 
)

Store data in a buffer.

Parameters
bufferThe buffer.
valueThe value to be stored.
indicesThe indices location to be stored.
predicateA vector mask of boolean values indicating which lanes of a vector are to be stored. The number lanes of the mask must be equal to the number of lanes in value.

◆ DeclBuffer()

DeclBufferFrame tvm::script::ir_builder::tir::DeclBuffer ( Array< PrimExpr shape,
DataType  dtype,
String  buffer_name,
Optional< Var data,
Optional< Array< PrimExpr >>  strides,
Optional< PrimExpr elem_offset,
String  storage_scope,
int  align,
int  offset_factor,
String  buffer_type,
Optional< Array< IntImm >>  axis_separators 
)

The buffer declaration frame.

Parameters
shapeThe type of the buffer prior to flattening.
dtypeThe data type in the content of the buffer.
buffer_nameThe name of the buffer.
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 buffer data pointer.
alignThe alignment requirement of data pointer in bytes.
offset_factorThe factor of elem_offset field.
buffer_typeThe buffer type.
axis_separatorsThe separators between input axes when generating flattened output axes.
Returns
The declared buffer.

◆ E4M3Float8()

PrimExpr tvm::script::ir_builder::tir::E4M3Float8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ E4M3Float8x16()

PrimExpr tvm::script::ir_builder::tir::E4M3Float8x16 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ E4M3Float8x32()

PrimExpr tvm::script::ir_builder::tir::E4M3Float8x32 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ E4M3Float8x4()

PrimExpr tvm::script::ir_builder::tir::E4M3Float8x4 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ E4M3Float8x64()

PrimExpr tvm::script::ir_builder::tir::E4M3Float8x64 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ E4M3Float8x8()

PrimExpr tvm::script::ir_builder::tir::E4M3Float8x8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ E5M2Float8()

PrimExpr tvm::script::ir_builder::tir::E5M2Float8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ E5M2Float8x16()

PrimExpr tvm::script::ir_builder::tir::E5M2Float8x16 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ E5M2Float8x32()

PrimExpr tvm::script::ir_builder::tir::E5M2Float8x32 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ E5M2Float8x4()

PrimExpr tvm::script::ir_builder::tir::E5M2Float8x4 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ E5M2Float8x64()

PrimExpr tvm::script::ir_builder::tir::E5M2Float8x64 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ E5M2Float8x8()

PrimExpr tvm::script::ir_builder::tir::E5M2Float8x8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Else()

ElseFrame tvm::script::ir_builder::tir::Else ( )

Create an else.

Returns
The result ElseFrame.

◆ EnvThread()

Var tvm::script::ir_builder::tir::EnvThread ( String  thread_tag,
DataType  dtype = DataType::Int(32) 
)

Bind a var to thread env.

Parameters
thread_tagThe thread type tag.
dtypeThe data type of the variable.
Returns
The result variable which gets bound to the thread env.

◆ Evaluate()

void tvm::script::ir_builder::tir::Evaluate ( PrimExpr  value)

Evaluate the input expression.

Parameters
valueThe input expression to evaluate.

◆ Float16()

PrimExpr tvm::script::ir_builder::tir::Float16 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float16x16()

PrimExpr tvm::script::ir_builder::tir::Float16x16 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float16x32()

PrimExpr tvm::script::ir_builder::tir::Float16x32 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float16x4()

PrimExpr tvm::script::ir_builder::tir::Float16x4 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float16x64()

PrimExpr tvm::script::ir_builder::tir::Float16x64 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float16x8()

PrimExpr tvm::script::ir_builder::tir::Float16x8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float32()

PrimExpr tvm::script::ir_builder::tir::Float32 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float32x16()

PrimExpr tvm::script::ir_builder::tir::Float32x16 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float32x32()

PrimExpr tvm::script::ir_builder::tir::Float32x32 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float32x4()

PrimExpr tvm::script::ir_builder::tir::Float32x4 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float32x64()

PrimExpr tvm::script::ir_builder::tir::Float32x64 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float32x8()

PrimExpr tvm::script::ir_builder::tir::Float32x8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float64()

PrimExpr tvm::script::ir_builder::tir::Float64 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float64x16()

PrimExpr tvm::script::ir_builder::tir::Float64x16 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float64x32()

PrimExpr tvm::script::ir_builder::tir::Float64x32 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float64x4()

PrimExpr tvm::script::ir_builder::tir::Float64x4 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float64x64()

PrimExpr tvm::script::ir_builder::tir::Float64x64 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float64x8()

PrimExpr tvm::script::ir_builder::tir::Float64x8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float8()

PrimExpr tvm::script::ir_builder::tir::Float8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float8x16()

PrimExpr tvm::script::ir_builder::tir::Float8x16 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float8x32()

PrimExpr tvm::script::ir_builder::tir::Float8x32 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float8x4()

PrimExpr tvm::script::ir_builder::tir::Float8x4 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float8x64()

PrimExpr tvm::script::ir_builder::tir::Float8x64 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Float8x8()

PrimExpr tvm::script::ir_builder::tir::Float8x8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ FuncAttrs()

void tvm::script::ir_builder::tir::FuncAttrs ( Map< String, ObjectRef attrs)

The PrimFunc annotation statement.

Parameters
attrsThe annotations of the PrimFunc.

◆ FuncName()

void tvm::script::ir_builder::tir::FuncName ( String  name)

The PrimFunc naming statement.

Parameters
nameThe name of the PrimFunc.

◆ FuncRet()

Type tvm::script::ir_builder::tir::FuncRet ( Type  ret_type)

The PrimFunc return type statement.

Parameters
ret_typeThe return type of the PrimFunc.
Returns
The return type.

◆ Grid()

ForFrame tvm::script::ir_builder::tir::Grid ( Array< PrimExpr extents)

The grid For statement.

Parameters
extentsThe extents of the iteration.
Returns
The ForFrame.

◆ Handle()

Var tvm::script::ir_builder::tir::Handle ( runtime::DataType  dtype = runtime::DataType::Void(),
String  storage_scope = "global",
bool  is_size_var = false,
bool  is_unknown_type = false 
)
inline

Create a TIR var that represents a pointer.

Parameters
dtypeThe data type of the pointer.
storage_scopeThe storage scope of the pointer.
is_size_varWhether the pointer is a size var.
is_unknown_typeUsed to distinguish between PrimType(DataType::Handle()) and PointerType(PrimType(DataType::Void())). If true, resolve dtype of Void() as PrimType, and if false resolve dtype of Void() as a PointerType.
Returns
The pointer.

◆ If()

IfFrame tvm::script::ir_builder::tir::If ( PrimExpr  condition)

Create an if statement.

Parameters
conditionThe condition of if statement.
Returns
The result IfFrame.

◆ Init()

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

The block initialization statement.

Returns
The BlockInitFrame.

◆ Int16()

PrimExpr tvm::script::ir_builder::tir::Int16 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int16x16()

PrimExpr tvm::script::ir_builder::tir::Int16x16 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int16x32()

PrimExpr tvm::script::ir_builder::tir::Int16x32 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int16x4()

PrimExpr tvm::script::ir_builder::tir::Int16x4 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int16x64()

PrimExpr tvm::script::ir_builder::tir::Int16x64 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int16x8()

PrimExpr tvm::script::ir_builder::tir::Int16x8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int32()

PrimExpr tvm::script::ir_builder::tir::Int32 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int32x16()

PrimExpr tvm::script::ir_builder::tir::Int32x16 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int32x32()

PrimExpr tvm::script::ir_builder::tir::Int32x32 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int32x4()

PrimExpr tvm::script::ir_builder::tir::Int32x4 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int32x64()

PrimExpr tvm::script::ir_builder::tir::Int32x64 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int32x8()

PrimExpr tvm::script::ir_builder::tir::Int32x8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int64()

PrimExpr tvm::script::ir_builder::tir::Int64 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int64x16()

PrimExpr tvm::script::ir_builder::tir::Int64x16 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int64x32()

PrimExpr tvm::script::ir_builder::tir::Int64x32 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int64x4()

PrimExpr tvm::script::ir_builder::tir::Int64x4 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int64x64()

PrimExpr tvm::script::ir_builder::tir::Int64x64 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int64x8()

PrimExpr tvm::script::ir_builder::tir::Int64x8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int8()

PrimExpr tvm::script::ir_builder::tir::Int8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int8x16()

PrimExpr tvm::script::ir_builder::tir::Int8x16 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int8x32()

PrimExpr tvm::script::ir_builder::tir::Int8x32 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int8x4()

PrimExpr tvm::script::ir_builder::tir::Int8x4 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int8x64()

PrimExpr tvm::script::ir_builder::tir::Int8x64 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Int8x8()

PrimExpr tvm::script::ir_builder::tir::Int8x8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ LaunchThread() [1/2]

LaunchThreadFrame tvm::script::ir_builder::tir::LaunchThread ( String  thread_tag,
PrimExpr  extent 
)

Launch a new thread.

Parameters
thread_tagThe thread type tag.
extentThe extent of environment thread.
Returns
The result LaunchThreadFrame.

◆ LaunchThread() [2/2]

LaunchThreadFrame tvm::script::ir_builder::tir::LaunchThread ( Var  var,
PrimExpr  extent 
)

Launch a thread.

Parameters
varThe iteration variable.
extentThe extent of environment thread.
Returns
The result LaunchThreadFrame.

◆ LetStmt()

LetFrame tvm::script::ir_builder::tir::LetStmt ( PrimExpr  value,
Optional< Type type_annotation = NullOpt,
Optional< Var var = NullOpt 
)

The let binding.

Parameters
valueThe value to be bound.
type_annotationThe type annotation of the let binding. Usually it is used for fine-grained var typing, particularly, PointerType.
varThe variable to be bound. If not specified, a new variable will be created.
Returns
The created LetFrame.

◆ MatchBuffer()

Buffer tvm::script::ir_builder::tir::MatchBuffer ( ObjectRef  param,
Array< PrimExpr shape,
DataType  dtype = DataType::Float(32),
Optional< Var data = NullOpt,
Array< PrimExpr strides = {},
PrimExpr  elem_offset = PrimExpr(),
String  storage_scope = "global",
int  align = -1,
int  offset_factor = 0,
String  buffer_type = "default",
Array< IntImm axis_separators = {} 
)

The buffer match statement.

Parameters
paramThe parameter of the PrimFunc to match.
shapeThe type of the buffer prior to flattening.
dtypeThe data type in the content of the buffer.
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 buffer data pointer.
alignThe alignment requirement of data pointer in bytes.
offset_factorThe factor of elem_offset field.
buffer_typeThe buffer type.
axis_separatorsThe separators between input axes when generating flattened output axes.
Returns
The matched buffer.
Examples
/workspace/include/tvm/script/ir_builder/base.h.

◆ Parallel()

ForFrame tvm::script::ir_builder::tir::Parallel ( PrimExpr  start,
PrimExpr  stop,
Optional< Map< String, ObjectRef >>  annotations = NullOpt 
)

The parallel For statement.

Parameters
startThe minimum value of iteration.
stopThe maximum value of iteration.
annotationsThe optional annotations of the For statement.
Returns
The ForFrame.

◆ Prefetch()

void tvm::script::ir_builder::tir::Prefetch ( Buffer  buffer,
Array< Range bounds 
)

The prefetch hint for a buffer.

Parameters
bufferThe buffer to be prefetched.
boundsThe bounds to be prefetched.

◆ PrimFunc()

PrimFuncFrame tvm::script::ir_builder::tir::PrimFunc ( bool  is_private)

The primitive function statement.

Returns
The PrimFuncFrame.

◆ Reads()

void tvm::script::ir_builder::tir::Reads ( Array< ObjectRef buffer_slices)

The block buffer region reading statement.

Parameters
buffer_slicesThe array of buffer regions to read.

◆ Realize()

RealizeFrame tvm::script::ir_builder::tir::Realize ( tvm::tir::BufferRegion  buffer_slice,
String  storage_scope,
PrimExpr  condition 
)

The realization.

Parameters
buffer_sliceThe region of buffer access.
storage_scopeThe storage scope associated with this realization.
conditionThe condition expression.
Returns
The result RealizeFrame.

◆ Serial()

ForFrame tvm::script::ir_builder::tir::Serial ( PrimExpr  start,
PrimExpr  stop,
Optional< Map< String, ObjectRef >>  annotations = NullOpt 
)

The serial For statement.

Parameters
startThe minimum value of iteration.
stopThe maximum value of iteration.
annotationsThe optional annotations of the For statement.
Returns
The ForFrame.

◆ Then()

ThenFrame tvm::script::ir_builder::tir::Then ( )

Create a then.

Returns
The result ThenFrame.

◆ ThreadBinding()

ForFrame tvm::script::ir_builder::tir::ThreadBinding ( PrimExpr  start,
PrimExpr  stop,
String  thread,
Optional< Map< String, ObjectRef >>  annotations = NullOpt 
)

The thread-binding For statement.

Parameters
startThe minimum value of iteration.
stopThe maximum value of iteration.
threadThe thread for loop variable to bind.
annotationsThe optional annotations of the For statement.
Returns
The ForFrame.

◆ UInt16()

PrimExpr tvm::script::ir_builder::tir::UInt16 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt16x16()

PrimExpr tvm::script::ir_builder::tir::UInt16x16 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt16x32()

PrimExpr tvm::script::ir_builder::tir::UInt16x32 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt16x4()

PrimExpr tvm::script::ir_builder::tir::UInt16x4 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt16x64()

PrimExpr tvm::script::ir_builder::tir::UInt16x64 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt16x8()

PrimExpr tvm::script::ir_builder::tir::UInt16x8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt32()

PrimExpr tvm::script::ir_builder::tir::UInt32 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt32x16()

PrimExpr tvm::script::ir_builder::tir::UInt32x16 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt32x32()

PrimExpr tvm::script::ir_builder::tir::UInt32x32 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt32x4()

PrimExpr tvm::script::ir_builder::tir::UInt32x4 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt32x64()

PrimExpr tvm::script::ir_builder::tir::UInt32x64 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt32x8()

PrimExpr tvm::script::ir_builder::tir::UInt32x8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt64()

PrimExpr tvm::script::ir_builder::tir::UInt64 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt64x16()

PrimExpr tvm::script::ir_builder::tir::UInt64x16 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt64x32()

PrimExpr tvm::script::ir_builder::tir::UInt64x32 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt64x4()

PrimExpr tvm::script::ir_builder::tir::UInt64x4 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt64x64()

PrimExpr tvm::script::ir_builder::tir::UInt64x64 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt64x8()

PrimExpr tvm::script::ir_builder::tir::UInt64x8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt8()

PrimExpr tvm::script::ir_builder::tir::UInt8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt8x16()

PrimExpr tvm::script::ir_builder::tir::UInt8x16 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt8x32()

PrimExpr tvm::script::ir_builder::tir::UInt8x32 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt8x4()

PrimExpr tvm::script::ir_builder::tir::UInt8x4 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt8x64()

PrimExpr tvm::script::ir_builder::tir::UInt8x64 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ UInt8x8()

PrimExpr tvm::script::ir_builder::tir::UInt8x8 ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Unroll()

ForFrame tvm::script::ir_builder::tir::Unroll ( PrimExpr  start,
PrimExpr  stop,
Optional< Map< String, ObjectRef >>  annotations = NullOpt 
)

The unrolled For statement.

Parameters
startThe minimum value of iteration.
stopThe maximum value of iteration.
annotationsThe optional annotations of the For statement.
Returns
The ForFrame.

◆ Vectorized()

ForFrame tvm::script::ir_builder::tir::Vectorized ( PrimExpr  start,
PrimExpr  stop,
Optional< Map< String, ObjectRef >>  annotations = NullOpt 
)

The vectorized For statement.

Parameters
startThe minimum value of iteration.
stopThe maximum value of iteration.
annotationsThe optional annotations of the For statement.
Returns
The ForFrame.

◆ Void()

PrimExpr tvm::script::ir_builder::tir::Void ( Optional< PrimExpr expr = NullOpt,
bool  is_size_var = false 
)
inline

◆ Where()

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

The block predicate statement.

Parameters
predicateThe predicate condition.

◆ While()

WhileFrame tvm::script::ir_builder::tir::While ( PrimExpr  condition)

Create a while loop.

Parameters
conditionThe termination condition of the loop.
Returns
The result WhileFrame.

◆ Writes()

void tvm::script::ir_builder::tir::Writes ( Array< ObjectRef buffer_slices)

The block buffer region writing statement.

Parameters
buffer_slicesThe array of buffer regions to write.