24 #ifndef TVM_TIR_FUNCTION_H_
25 #define TVM_TIR_FUNCTION_H_
27 #include <tvm/ffi/container/map.h>
28 #include <tvm/ffi/container/variant.h>
106 namespace refl = tvm::ffi::reflection;
107 refl::ObjectDef<PrimFuncNode>()
152 ffi::Map<tirx::Var, Buffer> buffer_map = ffi::Map<tirx::Var, Buffer>(),
170 namespace refl = tvm::ffi::reflection;
171 refl::ObjectDef<TensorIntrinNode>()
210 TVM_DLL
static ffi::Optional<TensorIntrin>
Get(ffi::String name,
bool allow_missing =
false);
Symbolic n-dimensional array, to represent a memory buffer.
Base node of all functions.
Definition: function.h:156
Managed reference to BaseFuncNode.
Definition: function.h:250
Managed reference to DictAttrsNode.
Definition: attrs.h:162
Managed reference to FuncTypeNode.
Definition: type.h:270
Definition: source_map.h:111
Managed reference to TypeNode.
Definition: type.h:99
Primitive functions that contains TIR statements.
Definition: function.h:50
ffi::Array< tirx::Var > params
Function parameters.
Definition: function.h:53
ffi::Map< tirx::Var, Buffer > buffer_map
Maps some parameters to specific Buffer data structures.
Definition: function.h:101
static void RegisterReflection()
Definition: function.h:105
FuncType func_type_annotation() const
Return the derived function annotation of this function.
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.PrimFunc", PrimFuncNode, BaseFuncNode)
TVM_OBJECT_ENABLE_SCRIPT_PRINTER()
tirx::Stmt body
The body of the function.
Definition: function.h:103
Type ret_type
The return type of the function.
Definition: function.h:55
Managed reference to PrimFuncNode.
Definition: function.h:131
PrimFunc(ffi::Array< tirx::Var > params, Stmt body, Type ret_type=VoidType(), ffi::Map< tirx::Var, Buffer > buffer_map=ffi::Map< tirx::Var, Buffer >(), DictAttrs attrs=DictAttrs(), Span span=Span())
Constructor.
TVM_DEFINE_OBJECT_REF_COW_METHOD(PrimFuncNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(PrimFunc, BaseFunc, PrimFuncNode)
Container of all statements.
Definition: stmt.h:67
Tensor intrinsics for tensorization.
Definition: function.h:162
PrimFunc desc
The function to describe the computation.
Definition: function.h:165
PrimFunc impl
The function of the implementation for the execution.
Definition: function.h:167
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("tirx.TensorIntrin", TensorIntrinNode, ffi::Object)
static void RegisterReflection()
Definition: function.h:169
Managed reference to TensorIntrinNode.
Definition: function.h:181
static void Register(ffi::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.
static ffi::Optional< TensorIntrin > Get(ffi::String name, bool allow_missing=false)
Look up TensorIntrin by name. Raises an exception if not found.
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(TensorIntrin, ffi::ObjectRef, TensorIntrinNode)
a named variable in TIR
Definition: var.h:77
Printer class to print repr string of each AST/IR nodes.
Copy-on-write helper macro for IR ffi::ObjectRef types.
constexpr const char * kIsHostFunc
Mark the function as run on the host, mutually exclusive with kTarget.
Definition: function.h:339
constexpr const char * kIsEntryFunc
Mark the function as the entry function of the final generated runtime module.
Definition: function.h:325
constexpr const char * kIsGlobalFunc
Mark the function as the global function called from the host.
Definition: function.h:332
constexpr const char * kIsScheduled
Mark the function as scheduled, so the default schedule will pass will skip it.
Definition: function.h:346
constexpr const char * kNoAlias
Whether to set noalias rule on the function arguments.
Definition: function.h:315
constexpr const char * kKernelLaunchParams
List of thread IterVar that a DeviceLaunch function corresponds to.
Definition: function.h:308
PrimFunc Specialize(PrimFunc func, const ffi::Map< Var, ffi::Variant< Buffer, PrimExpr >> ¶m_map)
Specialize parameters of PrimFunc.
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition: analyzer.h:37
Type VoidType()
Definition: type.h:231
A device-independent managed Tensor abstraction.