24 #ifndef TVM_IR_ENV_FUNC_H_ 25 #define TVM_IR_ENV_FUNC_H_ 54 return name == other->
name;
83 template <
typename... Args>
87 return n->
func(std::forward<Args>(args)...);
103 template <
typename FType>
115 template <
typename R,
typename... Args>
128 ObjectRef::operator=(other);
140 ICHECK(n !=
nullptr);
141 return runtime::detail::typed_packed_call_dispatcher<R>::run(n->
func,
142 std::forward<Args>(args)...);
149 #endif // TVM_IR_ENV_FUNC_H_ Return Value container, Unlike TVMArgValue, which only holds reference and do not delete the underlyi...
Definition: packed_func.h:799
const EnvFuncNode * operator->() const
Definition: env_func.h:132
A custom smart pointer for Object.
Definition: object.h:358
A Reducer class to reduce the structural equality result of two objects.
Definition: structural_equal.h:124
Please refer to TypedEnvFunc<R(Args..)>.
Definition: env_func.h:104
A serializable function backed by TVM's global environment.
Definition: env_func.h:41
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
A Reducer class to reduce the structural hash value.
Definition: structural_hash.h:110
void SHashReduce(SHashReducer hash_reduce) const
Definition: env_func.h:57
PrimExpr equal(PrimExpr a, PrimExpr b, Span span=Span())
equal
Managed reference to EnvFuncNode.
Definition: env_func.h:72
TSelf & operator=(const EnvFunc &other)
Assign global function to a TypedEnvFunc.
Definition: env_func.h:127
base class of all object containers.
Definition: object.h:167
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
static constexpr const char * _type_key
Definition: env_func.h:62
static constexpr bool _type_has_method_shash_reduce
Definition: env_func.h:64
runtime::PackedFunc func
The internal packed function.
Definition: env_func.h:46
String name
Unique name of the global function.
Definition: env_func.h:44
Reference to string objects.
Definition: string.h:98
EnvFunc()
Definition: env_func.h:74
R operator()(Args... args) const
Invoke the function.
Definition: env_func.h:138
TypedEnvFunc()
Definition: env_func.h:120
Base class of all object reference.
Definition: object.h:511
const EnvFuncNode * operator->() const
Definition: env_func.h:77
TVM_DECLARE_FINAL_OBJECT_INFO(EnvFuncNode, Object)
EnvFuncNode()
constructor
Definition: env_func.h:48
TypedEnvFunc(ObjectPtr< Object > n)
Definition: env_func.h:121
bool SEqualReduce(const EnvFuncNode *other, SEqualReducer equal) const
Definition: env_func.h:52
Packed function is a type-erased function. The arguments are passed by packed format.
Definition: packed_func.h:138
EnvFunc(ObjectPtr< Object > n)
Definition: env_func.h:75
runtime::TVMRetValue operator()(Args &&... args) const
Invoke the function.
Definition: env_func.h:84
static constexpr bool _type_has_method_sequal_reduce
Definition: env_func.h:63
Reflection and serialization of compiler IR/AST nodes.
void VisitAttrs(AttrVisitor *v)
Definition: env_func.h:50
A typed version of EnvFunc. It is backed by a GlobalFuncNode internally.
Definition: env_func.h:116