24 #ifndef TVM_TIR_FUNCTION_H_
25 #define TVM_TIR_FUNCTION_H_
103 v->Visit(
"params", &
params);
104 v->Visit(
"body", &
body);
107 v->Visit(
"attrs", &
attrs);
108 v->Visit(
"span", &
span);
137 static constexpr
const char*
_type_key =
"tir.PrimFunc";
184 v->Visit(
"desc", &
desc);
185 v->Visit(
"impl", &
impl);
188 static constexpr
const char*
_type_key =
"tir.TensorIntrin";
Symbolic n-dimensional array, to represent a memory buffer.
Visitor class to get the attributes of an AST/IR node. The content is going to be called for each fie...
Definition: reflection.h:52
Span span
Span that points to the original source code. Reserved debug information.
Definition: expr.h:56
Base node of all functions.
Definition: function.h:139
DictAttrs attrs
Additional attributes storing the meta-data.
Definition: function.h:142
Managed reference to BaseFuncNode.
Definition: function.h:230
Managed reference to DictAttrsNode.
Definition: attrs.h:227
Managed reference to FuncTypeNode.
Definition: type.h:481
Type checked_type_
Stores the result of type inference(type checking).
Definition: expr.h:370
A Reducer class to reduce the structural equality result of two objects.
Definition: structural_equal.h:137
A Reducer class to reduce the structural hash value.
Definition: structural_hash.h:121
void DefHash(const ObjectRef &key) const
Push hash of key to the current sequence of hash values.
Definition: structural_hash.h:198
Definition: source_map.h:120
Managed reference to TypeNode.
Definition: type.h:93
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Map container of NodeRef->NodeRef in DSL graph. Map implements copy on write semantics,...
Definition: map.h:1271
Base class of all object reference.
Definition: object.h:519
base class of all object containers.
Definition: object.h:171
Optional container that to represent to a Nullable variant of T.
Definition: optional.h:51
Reference to string objects.
Definition: string.h:98
Primitive functions that contains TIR statements.
Definition: function.h:46
static constexpr const char * _type_key
Definition: function.h:137
Array< tir::Var > params
Function parameters.
Definition: function.h:49
void SHashReduce(SHashReducer hash_reduce) const
Definition: function.h:119
TVM_DECLARE_FINAL_OBJECT_INFO(PrimFuncNode, BaseFuncNode)
bool SEqualReduce(const PrimFuncNode *other, SEqualReducer equal) const
Definition: function.h:112
TVM_OBJECT_ENABLE_SCRIPT_PRINTER()
FuncType func_type_annotation() const
Return the derived function annotation of this function.
tir::Stmt body
The body of the function.
Definition: function.h:51
Type ret_type
The return type of the function.
Definition: function.h:53
void VisitAttrs(tvm::AttrVisitor *v)
Definition: function.h:102
Map< tir::Var, Buffer > buffer_map
Maps some parameters to specific Buffer data structures.
Definition: function.h:100
Managed reference to PrimFuncNode.
Definition: function.h:145
TVM_DEFINE_OBJECT_REF_COW_METHOD(PrimFuncNode)
PrimFunc(Array< tir::Var > params, Stmt body, Type ret_type=VoidType(), Map< tir::Var, Buffer > buffer_map=Map< tir::Var, Buffer >(), DictAttrs attrs=DictAttrs(), Span span=Span())
Constructor.
TVM_DEFINE_OBJECT_REF_METHODS(PrimFunc, BaseFunc, PrimFuncNode)
Container of all statements.
Definition: stmt.h:59
Tensor intrinsics for tensorization.
Definition: function.h:176
TVM_DECLARE_FINAL_OBJECT_INFO(TensorIntrinNode, Object)
void VisitAttrs(AttrVisitor *v)
Definition: function.h:183
static constexpr const char * _type_key
Definition: function.h:188
PrimFunc impl
The function of the implementation for the execution.
Definition: function.h:181
PrimFunc desc
The function to describe the computation.
Definition: function.h:179
Managed reference to TensorIntrinNode.
Definition: function.h:195
static Optional< TensorIntrin > Get(String name, bool allow_missing=false)
Look up TensorIntrin by name. Raises an exception if not found.
static void Register(String name, TensorIntrin intrin, bool override=false)
Create and register a TensorIntrin. After registration, the TensorIntrin can be looked up with its na...
TensorIntrin(PrimFunc desc, PrimFunc impl)
Constructor.
a named variable in TIR
Definition: var.h:89
tvm::Span Span
Definition: base.h:65
constexpr const char * kIsGlobalFunc
Mark the function as the global function called from the host.
Definition: function.h:346
constexpr const char * kIsEntryFunc
Mark the function as the entry function of the final generated runtime module.
Definition: function.h:339
constexpr const char * kKernelLaunchParams
List of thread IterVar that a DeviceLaunch function corresponds to.
Definition: function.h:322
constexpr const char * kIsHostFunc
Mark the function as run on the host, mutually exclusive with kTarget.
Definition: function.h:353
constexpr const char * kNoAlias
Whether to set noalias rule on the function arguments.
Definition: function.h:329
constexpr const char * kIsScheduled
Mark the function as scheduled, so the default schedule will pass will skip it.
Definition: function.h:360
PrimFunc Specialize(PrimFunc func, const Map< Var, Variant< Buffer, PrimExpr >> ¶m_map)
Specialize parameters of PrimFunc.
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
PrimExpr equal(PrimExpr a, PrimExpr b, Span span=Span())
equal
Type VoidType()
Definition: type.h:397
A device-independent managed NDArray abstraction.
#define TVM_DEFINE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:758