19#ifndef TVM_RELAX_SCRIPT_IR_BUILDER_IR_H_
20#define TVM_RELAX_SCRIPT_IR_BUILDER_IR_H_
33TVM_DLL ffi::Optional<tvm::relax::VDevice>
LookupVDevice(ffi::String target_kind,
int device_index);
72TVM_DLL
void FuncAttrs(ffi::Map<ffi::String, Any> attrs);
115 const ffi::Optional<tvm::Type>& annotate_ty = std::nullopt);
134 const ffi::Optional<tvm::Type>& annotate_ty,
const Location& name_loc,
Managed reference to ExprNode.
Definition base_expr.h:359
Managed reference to IfNode.
Definition stmt.h:415
Non-nullable source-location metadata.
Definition location.h:91
Managed reference to TypeNode.
Definition base_expr.h:80
Reference to the shared immutable unknown location.
Definition location.h:105
Managed reference to VarNode.
Definition expr.h:714
Managed reference to ElseFrameObj.
Definition frame.h:336
Managed reference to IfFrameObj.
Definition frame.h:256
Managed reference to ThenFrameObj.
Definition frame.h:296
BindingBlockFrame BindingBlock()
Start a binding block frame.
tvm::Var Arg(const ffi::String &name, const tvm::Type &ty)
Add a parameter to the last function frame.
FunctionFrame LocalFunction(bool is_pure, const tvm::Var &reference)
Define a local function under its cached declaration identity.
ThenFrame Then()
Create a then.
ElseFrame Else()
Create an else.
tvm::Var EmitMatchCastWithLoc(const tvm::relax::Expr &value, const tvm::Type &ty, const Location &name_loc, const Location &loc=UnknownLoc())
Emit a match cast with separate statement and variable-name ranges.
FunctionFrame Function(bool is_pure, bool is_private)
Start a function frame.
tvm::Var ArgVar(const ffi::String &name, const tvm::Var &var)
Add a cached parameter without changing its identity.
BindingBlockFrame Dataflow()
Start a dataflow binding block frame.
void FuncRetType(const tvm::Type &ret_ty)
Specify the return type of the last function frame.
tvm::Var EmitMatchCast(const tvm::relax::Expr &value, const tvm::Type &ty)
Emit a match_cast binding to the last binding block frame.
void FuncName(const ffi::String &name)
Specify the name of the last function frame.
ffi::Optional< tvm::relax::VDevice > LookupVDevice(ffi::String target_kind, int device_index)
Find a module virtual device by target kind and index.
tvm::Var EmitVarBinding(const tvm::relax::VarBinding &binding)
Emit a binding to the last binding block frame.
tvm::Var EmitWithLoc(const tvm::relax::Expr &value, const ffi::Optional< tvm::Type > &annotate_ty, const Location &name_loc, const Location &loc=UnknownLoc())
Emit a binding with separate statement and variable-name ranges.
void FuncAttrs(ffi::Map< ffi::String, Any > attrs)
Specify the attrs of the last function frame.
tvm::Var Emit(const tvm::relax::Expr &value, const ffi::Optional< tvm::Type > &annotate_ty=std::nullopt)
Emit a binding to the last binding block frame.
void FuncRetValue(const tvm::relax::Expr &value)
Specify the return value of the last function frame.
FunctionFrame DeclFunction(bool is_pure, bool is_private, bool local)
Start a bodyless declaration using the normal signature operations.
void DataflowBlockOutput(const ffi::Array< tvm::Var > &vars)
Expose the dataflow block output variables as global ones.
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition attr.h:23
Relax types, including the richer dependent Relax type nodes.