24 #ifndef TVM_IR_ENV_FUNC_H_
25 #define TVM_IR_ENV_FUNC_H_
84 template <
typename... Args>
88 return n->
func(std::forward<Args>(args)...);
104 template <
typename FType>
116 template <
typename R,
typename... Args>
129 ObjectRef::operator=(other);
141 ICHECK(n !=
nullptr);
142 return runtime::detail::typed_packed_call_dispatcher<R>::run(n->
func,
143 std::forward<Args>(args)...);
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
A serializable function backed by TVM's global environment.
Definition: env_func.h:42
String name
Unique name of the global function.
Definition: env_func.h:45
static constexpr const char * _type_key
Definition: env_func.h:63
TVM_DECLARE_FINAL_OBJECT_INFO(EnvFuncNode, Object)
EnvFuncNode()
constructor
Definition: env_func.h:49
runtime::PackedFunc func
The internal packed function.
Definition: env_func.h:47
static constexpr bool _type_has_method_sequal_reduce
Definition: env_func.h:64
bool SEqualReduce(const EnvFuncNode *other, SEqualReducer equal) const
Definition: env_func.h:53
void SHashReduce(SHashReducer hash_reduce) const
Definition: env_func.h:58
void VisitAttrs(AttrVisitor *v)
Definition: env_func.h:51
static constexpr bool _type_has_method_shash_reduce
Definition: env_func.h:65
Managed reference to EnvFuncNode.
Definition: env_func.h:73
EnvFunc(ObjectPtr< Object > n)
Definition: env_func.h:76
const EnvFuncNode * operator->() const
Definition: env_func.h:78
runtime::TVMRetValue operator()(Args &&... args) const
Invoke the function.
Definition: env_func.h:85
EnvFunc()
Definition: env_func.h:75
static EnvFunc Get(const String &name)
Get a global function based on the name.
A Reducer class to reduce the structural equality result of two objects.
Definition: structural_equal.h:135
A Reducer class to reduce the structural hash value.
Definition: structural_hash.h:121
A typed version of EnvFunc. It is backed by a GlobalFuncNode internally.
Definition: env_func.h:117
TypedEnvFunc(ObjectPtr< Object > n)
Definition: env_func.h:122
TypedEnvFunc()
Definition: env_func.h:121
TSelf & operator=(const EnvFunc &other)
Assign global function to a TypedEnvFunc.
Definition: env_func.h:128
const EnvFuncNode * operator->() const
Definition: env_func.h:133
R operator()(Args... args) const
Invoke the function.
Definition: env_func.h:139
Please refer to TypedEnvFunc<R(Args..)>.
Definition: env_func.h:105
A custom smart pointer for Object.
Definition: object.h:363
Base class of all object reference.
Definition: object.h:520
const Object * get() const
Definition: object.h:555
base class of all object containers.
Definition: object.h:172
Packed function is a type-erased function. The arguments are passed by packed format.
Definition: packed_func.h:141
Reference to string objects.
Definition: string.h:97
Return Value container, Unlike TVMArgValue, which only holds reference and do not delete the underlyi...
Definition: packed_func.h:946
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:36
PrimExpr equal(PrimExpr a, PrimExpr b, Span span=Span())
equal
Type-erased function used across TVM API.
Reflection and serialization of compiler IR/AST nodes.