Packed function is a type-erased function. The arguments are passed by packed format.
More...
|
| PackedFunc (std::nullptr_t null) |
| Constructor from null. More...
|
|
template<typename TCallable , typename = std::enable_if_t< std::is_convertible<TCallable, std::function<void(TVMArgs, TVMRetValue*)>>::value && !std::is_base_of<TCallable, PackedFunc>::value>> |
| PackedFunc (TCallable data) |
| Constructing a packed function from a callable type whose signature is consistent with PackedFunc More...
|
|
template<typename... Args> |
TVMRetValue | operator() (Args &&... args) const |
| Call packed function by directly passing in unpacked format. More...
|
|
TVM_ALWAYS_INLINE void | CallPacked (TVMArgs args, TVMRetValue *rv) const |
| Call the function in packed format. More...
|
|
bool | operator== (std::nullptr_t null) const |
|
bool | operator!= (std::nullptr_t null) const |
|
| TVM_DEFINE_OBJECT_REF_METHODS (PackedFunc, ObjectRef, PackedFuncObj) |
|
| ObjectRef ()=default |
| default constructor More...
|
|
| ObjectRef (ObjectPtr< Object > data) |
| Constructor from existing object ptr. More...
|
|
bool | same_as (const ObjectRef &other) const |
| Comparator. More...
|
|
bool | operator== (const ObjectRef &other) const |
| Comparator. More...
|
|
bool | operator!= (const ObjectRef &other) const |
| Comparator. More...
|
|
bool | operator< (const ObjectRef &other) const |
| Comparator. More...
|
|
bool | defined () const |
|
const Object * | get () const |
|
const Object * | operator-> () const |
|
bool | unique () const |
|
int | use_count () const |
|
template<typename ObjectType , typename = std::enable_if_t<std::is_base_of_v<Object, ObjectType>>> |
const ObjectType * | as () const |
| Try to downcast the internal Object to a raw pointer of a corresponding type. More...
|
|
template<typename ObjectRefType , typename = std::enable_if_t<std::is_base_of_v<ObjectRef, ObjectRefType>>> |
Optional< ObjectRefType > | as () const |
| Try to downcast the ObjectRef to a Optional<T> of the requested type. More...
|
|
Packed function is a type-erased function. The arguments are passed by packed format.
This is an useful unified interface to call generated functions, It is the unified function type of TVM. It corresponds to TVMFunctionHandle in C runtime API.
template<typename TCallable , typename = std::enable_if_t< std::is_convertible<TCallable, std::function<void(TVMArgs, TVMRetValue*)>>::value && !std::is_base_of<TCallable, PackedFunc>::value>>
tvm::runtime::PackedFunc::PackedFunc |
( |
TCallable |
data | ) |
|
|
inlineexplicit |
Constructing a packed function from a callable type whose signature is consistent with PackedFunc
- Parameters
-
data | the internal container of packed function. |