19#ifndef TVM_S_TIR_SCRIPT_IR_BUILDER_IR_H_
20#define TVM_S_TIR_SCRIPT_IR_BUILDER_IR_H_
36 bool is_declaration =
false);
53 int align = -1, ffi::Optional<Layout> layout = std::nullopt,
54 ffi::Array<PrimExpr> allocated_addr = {});
62SBlockFrame Block(ffi::String name,
bool no_realize =
false, ffi::String exec_scope =
"");
80void Reads(ffi::Array<ffi::ObjectRef> tensor_slices);
86void Writes(ffi::Array<ffi::ObjectRef> tensor_slices);
106 ffi::Optional<Expr> data = std::nullopt,
108 int align = -1, ffi::Optional<Layout> layout = std::nullopt,
109 ffi::Array<PrimExpr> allocated_addr = {});
160ffi::Array<Var>
Remap(ffi::String kinds, ffi::Array<PrimExpr> bindings,
IRBuilder APIs for TIRx functions and statements.
Typed reference/view over any Expr whose ExprObj::ty is PrimType.
Definition expr.h:187
static TVM_TIRX_DLL PrimType Int(int bits, int lanes=1)
Construct a signed integer type with fixed lanes.
static TVM_TIRX_DLL PrimType Float(int bits, int lanes=1)
Construct a floating-point type with fixed lanes.
Range container
Definition expr.h:883
Managed reference to VarObj.
Definition expr.h:571
A registered memory space, independent of backend allocation policy.
Definition memory_scope.h:65
static TVM_RUNTIME_DLL const MemoryScope & Global()
Return the canonical global singleton.
Managed reference to BlockInitFrameObj.
Definition frame.h:169
Managed reference to SBlockFrameObj.
Definition frame.h:128
Managed reference to a tensor-program coordinate layout.
Definition layout.h:57
Checked zero-state view over an ordinary VarObj with TensorType.
Definition expr.h:48
Memory scopes and allocation properties for runtime storage.
Var Reduce(Range dom, ffi::Optional< PrimExpr > binding=std::nullopt, PrimType dtype=PrimType::Int(32))
The reduced block axis defining function.
Var Spatial(Range dom, ffi::Optional< PrimExpr > binding=std::nullopt, PrimType dtype=PrimType::Int(32))
The spatial block axis defining function.
Var Opaque(Range dom, ffi::Optional< PrimExpr > binding=std::nullopt, PrimType dtype=PrimType::Int(32))
The opaque block axis defining function.
Var Scan(Range dom, ffi::Optional< PrimExpr > binding=std::nullopt, PrimType dtype=PrimType::Int(32))
The scanning block axis defining function.
ffi::Array< Var > Remap(ffi::String kinds, ffi::Array< PrimExpr > bindings, PrimType dtype=PrimType::Int(32))
The block axis remapping function.
void BlockAttrs(ffi::Map< ffi::String, ffi::Any > attrs)
The block annotation statement.
void Reads(ffi::Array< ffi::ObjectRef > tensor_slices)
The block tensor region reading statement.
TensorVar MatchTensor(ffi::ObjectRef param, ffi::Array< PrimExpr > shape, PrimType dtype=PrimType::Float(32), ffi::Optional< Expr > data=std::nullopt, runtime::MemoryScope storage_scope=runtime::MemoryScope::Global(), int align=-1, ffi::Optional< Layout > layout=std::nullopt, ffi::Array< PrimExpr > allocated_addr={})
Bind a tensor subregion in an S-TIR block.
void Where(PrimExpr predicate)
The block predicate statement.
FunctionFrame Function(bool is_private=false, bool persistent=false, bool is_declaration=false)
SBlockFrame Block(ffi::String name, bool no_realize=false, ffi::String exec_scope="")
The block declaration statement.
BlockInitFrame Init()
The block initialization statement.
void Writes(ffi::Array< ffi::ObjectRef > tensor_slices)
The block tensor region writing statement.
TensorVar SBlockAllocTensor(ffi::Array< PrimExpr > shape, PrimType dtype=PrimType::Float(32), ffi::Optional< Expr > data=std::nullopt, runtime::MemoryScope storage_scope=runtime::MemoryScope::Global(), int align=-1, ffi::Optional< Layout > layout=std::nullopt, ffi::Array< PrimExpr > allocated_addr={})
The tensor allocation function.
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition analysis.h:41