tvm
Namespaces | Macros | Functions
ir.h File Reference
#include <tvm/script/ir_builder/base.h>
#include <tvm/script/ir_builder/tir/frame.h>
#include <tvm/tir/op.h>
Include dependency graph for ir.h:

Go to the source code of this file.

Namespaces

 tvm
 runtime implementation for LibTorch/TorchScript.
 
 tvm::script
 
 tvm::script::ir_builder
 
 tvm::script::ir_builder::tir
 
 tvm::script::ir_builder::tir::axis
 

Macros

#define TVM_TIR_IR_BUILDER_DEF_DTYPE_CAST(FuncName, DType)
 

Functions

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. More...
 
PrimFuncFrame tvm::script::ir_builder::tir::PrimFunc ()
 The primitive function statement. More...
 
Var tvm::script::ir_builder::tir::Arg (String name, Var var)
 The PrimFunc variable arguments adding function. More...
 
Buffer tvm::script::ir_builder::tir::Arg (String name, Buffer buffer)
 The PrimFunc buffer arguments adding function. More...
 
void tvm::script::ir_builder::tir::FuncName (String name)
 The PrimFunc naming statement. More...
 
void tvm::script::ir_builder::tir::FuncAttrs (Map< String, ObjectRef > attrs)
 The PrimFunc annotation statement. More...
 
Type tvm::script::ir_builder::tir::FuncRet (Type ret_type)
 The PrimFunc return type statement. More...
 
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. More...
 
void tvm::script::ir_builder::tir::PreflattenedBuffer (Buffer postflattened_buffer, 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 pre-flattened buffer statement. More...
 
BlockFrame tvm::script::ir_builder::tir::Block (String name, bool no_realize=false)
 The block declaration statement. More...
 
BlockInitFrame tvm::script::ir_builder::tir::Init ()
 The block initialization statement. More...
 
void tvm::script::ir_builder::tir::Where (PrimExpr predicate)
 The block predicate statement. More...
 
void tvm::script::ir_builder::tir::Reads (Array< ObjectRef > buffer_slices)
 The block buffer region reading statement. More...
 
void tvm::script::ir_builder::tir::Writes (Array< ObjectRef > buffer_slices)
 The block buffer region writing statement. More...
 
void tvm::script::ir_builder::tir::BlockAttrs (Map< String, ObjectRef > attrs)
 The block annotation statement. More...
 
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. More...
 
Var tvm::script::ir_builder::tir::axis::Spatial (Range dom, PrimExpr binding, DataType dtype=DataType::Int(32))
 The spatial block axis defining function. More...
 
Var tvm::script::ir_builder::tir::axis::Reduce (Range dom, PrimExpr binding, DataType dtype=DataType::Int(32))
 The reduced block axis defining function. More...
 
Var tvm::script::ir_builder::tir::axis::Scan (Range dom, PrimExpr binding, DataType dtype=DataType::Int(32))
 The scanning block axis defining function. More...
 
Var tvm::script::ir_builder::tir::axis::Opaque (Range dom, PrimExpr binding, DataType dtype=DataType::Int(32))
 The opaque block axis defining function. More...
 
Array< Var > tvm::script::ir_builder::tir::axis::Remap (String kinds, Array< PrimExpr > bindings, DataType dtype=DataType::Int(32))
 The block axis remapping function. More...
 
ForFrame tvm::script::ir_builder::tir::Serial (PrimExpr start, PrimExpr stop, Optional< Map< String, ObjectRef >> annotations=NullOpt)
 The serial For statement. More...
 
ForFrame tvm::script::ir_builder::tir::Parallel (PrimExpr start, PrimExpr stop, Optional< Map< String, ObjectRef >> annotations=NullOpt)
 The parallel For statement. More...
 
ForFrame tvm::script::ir_builder::tir::Vectorized (PrimExpr start, PrimExpr stop, Optional< Map< String, ObjectRef >> annotations=NullOpt)
 The vectorized For statement. More...
 
ForFrame tvm::script::ir_builder::tir::Unroll (PrimExpr start, PrimExpr stop, Optional< Map< String, ObjectRef >> annotations=NullOpt)
 The unrolled For statement. More...
 
ForFrame tvm::script::ir_builder::tir::ThreadBinding (PrimExpr start, PrimExpr stop, String thread, Optional< Map< String, ObjectRef >> annotations=NullOpt)
 The thread-binding For statement. More...
 
ForFrame tvm::script::ir_builder::tir::Grid (Array< PrimExpr > extents)
 The grid For statement. More...
 
AssertFrame tvm::script::ir_builder::tir::Assert (PrimExpr condition, String message)
 The assertion statement. More...
 
LetFrame tvm::script::ir_builder::tir::Let (Var var, PrimExpr value)
 The let binding. More...
 
RealizeFrame tvm::script::ir_builder::tir::Realize (tvm::tir::BufferRegion buffer_slice, String storage_scope, PrimExpr condition)
 The realization. More...
 
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. More...
 
AllocateConstFrame tvm::script::ir_builder::tir::AllocateConst (NDArray data, DataType dtype, Array< PrimExpr > extents, Map< String, ObjectRef > annotations=NullValue< Map< String, ObjectRef >>())
 The allocate constant node. More...
 
AttrFrame tvm::script::ir_builder::tir::Attr (ObjectRef node, String attr_key, PrimExpr value)
 Create an attribute. More...
 
WhileFrame tvm::script::ir_builder::tir::While (PrimExpr condition)
 Create a while loop. More...
 
IfFrame tvm::script::ir_builder::tir::If (PrimExpr condition)
 Create an if statement. More...
 
ThenFrame tvm::script::ir_builder::tir::Then ()
 Create a then. More...
 
ElseFrame tvm::script::ir_builder::tir::Else ()
 Create an else. More...
 
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. More...
 
LaunchThreadFrame tvm::script::ir_builder::tir::LaunchThread (Var var, PrimExpr extent)
 Launch a thread. More...
 
Var tvm::script::ir_builder::tir::EnvThread (String thread_tag)
 Bind a var to thread env. More...
 
void tvm::script::ir_builder::tir::BufferStore (Buffer buffer, PrimExpr value, Array< PrimExpr > indices)
 Store data in a buffer. More...
 
void tvm::script::ir_builder::tir::Prefetch (Buffer buffer, Array< Range > bounds)
 The prefetch hint for a buffer. More...
 
void tvm::script::ir_builder::tir::Evaluate (PrimExpr value)
 Evaluate the input expression. More...
 
PrimExpr tvm::script::ir_builder::tir::Int8 (Optional< PrimExpr > expr=NullOpt)
 
PrimExpr tvm::script::ir_builder::tir::Int16 (Optional< PrimExpr > expr=NullOpt)
 
PrimExpr tvm::script::ir_builder::tir::Int32 (Optional< PrimExpr > expr=NullOpt)
 
PrimExpr tvm::script::ir_builder::tir::Int64 (Optional< PrimExpr > expr=NullOpt)
 
PrimExpr tvm::script::ir_builder::tir::UInt8 (Optional< PrimExpr > expr=NullOpt)
 
PrimExpr tvm::script::ir_builder::tir::UInt16 (Optional< PrimExpr > expr=NullOpt)
 
PrimExpr tvm::script::ir_builder::tir::UInt32 (Optional< PrimExpr > expr=NullOpt)
 
PrimExpr tvm::script::ir_builder::tir::UInt64 (Optional< PrimExpr > expr=NullOpt)
 
PrimExpr tvm::script::ir_builder::tir::Float8 (Optional< PrimExpr > expr=NullOpt)
 
PrimExpr tvm::script::ir_builder::tir::Float16 (Optional< PrimExpr > expr=NullOpt)
 
PrimExpr tvm::script::ir_builder::tir::Float32 (Optional< PrimExpr > expr=NullOpt)
 
PrimExpr tvm::script::ir_builder::tir::Float64 (Optional< PrimExpr > expr=NullOpt)
 
PrimExpr tvm::script::ir_builder::tir::Int32x4 (Optional< PrimExpr > expr=NullOpt)
 
PrimExpr tvm::script::ir_builder::tir::Int32x8 (Optional< PrimExpr > expr=NullOpt)
 
PrimExpr tvm::script::ir_builder::tir::Int32x16 (Optional< PrimExpr > expr=NullOpt)
 
PrimExpr tvm::script::ir_builder::tir::Boolean (Optional< PrimExpr > expr=NullOpt)
 
PrimExpr tvm::script::ir_builder::tir::Handle (Optional< PrimExpr > expr=NullOpt)
 
PrimExpr tvm::script::ir_builder::tir::Void (Optional< PrimExpr > expr=NullOpt)
 

Macro Definition Documentation

◆ TVM_TIR_IR_BUILDER_DEF_DTYPE_CAST

#define TVM_TIR_IR_BUILDER_DEF_DTYPE_CAST (   FuncName,
  DType 
)
Value:
inline PrimExpr FuncName(Optional<PrimExpr> expr = NullOpt) { \
DataType dtype = DType; \
return expr.defined() ? tvm::cast(dtype, expr.value()) : tvm::tir::Var("", dtype); \
}
a named variable in TIR
Definition: var.h:88
PrimExpr cast(const DataType &t, PrimExpr value, Span span=Span())
cast value to type.
constexpr runtime::NullOptType NullOpt
Definition: optional.h:160
void FuncName(String name)
The PrimFunc naming statement.