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>
136constexpr const char*
kSTir =
"s_tir";
180 template <
typename TObjectRef>
181 ffi::Optional<TObjectRef>
GetAttr(
const std::string& attr_key,
182 ffi::Optional<TObjectRef> default_value = std::nullopt)
const {
186 template <
typename TObjectRef>
187 ffi::Optional<TObjectRef>
GetAttr(
const std::string& attr_key,
TObjectRef default_value)
const {
238 namespace refl = tvm::ffi::reflection;
Helpers for attribute objects.
Base node of all functions.
Definition function.h:156
static constexpr const uint32_t _type_child_slots
Definition function.h:242
bool HasNonzeroAttr(const std::string &attr_key) const
Check whether the function has an non-zero integer attr.
Definition function.h:210
LinkageType GetLinkageType() const
Get the type of the linkage.
Definition function.h:230
ffi::Optional< TObjectRef > GetAttr(const std::string &attr_key, TObjectRef default_value) const
Definition function.h:187
DictAttrs attrs
Additional attributes storing the meta-data.
Definition function.h:159
ffi::Optional< TObjectRef > GetAttr(const std::string &attr_key, ffi::Optional< TObjectRef > default_value=std::nullopt) const
Get a function attribute.
Definition function.h:181
static void RegisterReflection()
Definition function.h:237
TVM_FFI_DECLARE_OBJECT_INFO("ir.BaseFunc", BaseFuncNode, ExprNode)
Managed reference to BaseFuncNode.
Definition function.h:250
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(BaseFunc, Expr, BaseFuncNode)
Managed reference to DictAttrsNode.
Definition attrs.h:102
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:165
bool HasNonzeroAttr(const std::string &attr_key) const
Check whether the function has an non-zero integer attr.
Definition attrs.h:200
Base type of all the expressions.
Definition base_expr.h:300
Managed reference to ExprNode.
Definition base_expr.h:335
RAII wrapper function to enter and exit a context object similar to python's with syntax.
Definition with_context.h:59
constexpr const char * kCallingConv
Indicates the special calling convention.
Definition function.h:96
constexpr const char * kSTir
The function uses s_tir (apache-derived TIR) semantics: parser fills layout=None, ScriptComplete wrap...
Definition function.h:136
constexpr const char * kNumInputs
Number of inputs of the Primfunc.
Definition function.h:143
constexpr const char * kTarget
Compilation target of the function.
Definition function.h:105
constexpr const char * kGlobalSymbol
Global linker symbol of the function in generated code.
Definition function.h:126
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition analyzer.h:40
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.