24#ifndef TVM_IR_FUNCTION_H_
25#define TVM_IR_FUNCTION_H_
27#include <tvm/ffi/container/array.h>
28#include <tvm/ffi/container/map.h>
29#include <tvm/ffi/string.h>
116 template <
typename TObjectRef>
118 ffi::Optional<TObjectRef> default_value = std::nullopt)
const {
122 template <
typename TObjectRef>
169 namespace refl = tvm::ffi::reflection;
183 explicit BaseFunc(ffi::ObjectPtr<BaseFuncNode> node) :
Expr(std::move(node)) {}
241constexpr const char*
kSTir =
"s_tir";
Helpers for attribute objects.
Base node of all functions.
Definition function.h:92
static constexpr const uint32_t _type_child_slots
Definition function.h:173
bool HasNonzeroAttr(const std::string &attr_key) const
Check whether the function has an non-zero integer attr.
Definition function.h:146
LinkageType GetLinkageType() const
Get the type of the linkage.
Definition function.h:261
ffi::Optional< TObjectRef > GetAttr(const std::string &attr_key, TObjectRef default_value) const
Definition function.h:123
DictAttrs attrs
Additional attributes storing the meta-data.
Definition function.h:95
ffi::Optional< TObjectRef > GetAttr(const std::string &attr_key, ffi::Optional< TObjectRef > default_value=std::nullopt) const
Get a function attribute.
Definition function.h:117
static void RegisterReflection()
Definition function.h:168
TVM_FFI_DECLARE_OBJECT_INFO("ir.BaseFunc", BaseFuncNode, ExprNode)
Managed reference to BaseFuncNode.
Definition function.h:181
BaseFunc(ffi::ObjectPtr< BaseFuncNode > node)
Definition function.h:183
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(BaseFunc, Expr, BaseFuncNode)
Managed reference to DictAttrsNode.
Definition attrs.h:108
ffi::Optional< TObjectRef > GetAttr(const std::string &attr_key, ffi::Optional< TObjectRef > default_value=ffi::Optional< TObjectRef >(std::nullopt)) const
Get a function attribute.
Definition attrs.h:171
bool HasNonzeroAttr(const std::string &attr_key) const
Check whether the function has an non-zero integer attr.
Definition attrs.h:206
Base type of all the expressions.
Definition base_expr.h:324
Managed reference to ExprNode.
Definition base_expr.h:359
constexpr const char * kScriptNamespace
Script construction namespace used to select the function decorator. Absent metadata selects the func...
Definition function.h:250
constexpr const char * kCallingConv
Indicates the special calling convention.
Definition function.h:201
constexpr const char * kSTir
The function uses s_tir (apache-derived TIR) semantics: parser fills layout=None, ScriptComplete wrap...
Definition function.h:241
constexpr const char * kNumInputs
Number of inputs of the Function.
Definition function.h:257
constexpr const char * kTarget
Compilation target of the function.
Definition function.h:210
constexpr const char * kGlobalSymbol
Global linker symbol of the function in generated code.
Definition function.h:231
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition attr.h:23
CallingConv
Possible Calling conventions.
Definition function.h:44
@ kDefault
Default calling convention.
@ kCPackedFunc
ffi::Function that exposes a Cffi::Function signature.
@ kDeviceKernelLaunch
Device kernel launch.
LinkageType
Supported linkage types.
Definition function.h:71
@ kExternal
External linkage.
@ kInternal
Internal linkage.