|
tvm
|
Dynamic dispatch functor based on AccessPath. More...
#include <ir_docsifier_functor.h>
Public Member Functions | |
| template<class TObjectRef > | |
| R | operator() (const ffi::String &token, TObjectRef obj, Args... args) const |
| Call the dispatch function. | |
| TSelf & | set_dispatch (ffi::String token, uint32_t type_index, ffi::Function f) |
| Set the dispatch function. | |
| TSelf & | set_fallback (ffi::Function f) |
| void | remove_fallback () |
| template<typename TObjectRef , typename TCallable , typename = std::enable_if_t<IsDispatchFunction<TObjectRef, TCallable>::value>> | |
| TSelf & | set_dispatch (ffi::String token, TCallable f) |
| Set the dispatch function. | |
| template<typename TCallable , typename = std::enable_if_t<IsDispatchFunction<ffi::ObjectRef, TCallable>::value>> | |
| TSelf & | set_fallback (TCallable f) |
| void | remove_dispatch (ffi::String token, uint32_t type_index) |
| Remove dispatch function. | |
Dynamic dispatch functor based on AccessPath.
This functor dispatches based on the type of object and the input dispatch token.
|
inline |
Call the dispatch function.
| token | The dispatch token. |
| obj | The object. |
| args | Other args. |
If the TObjectRef isn't registered with the token, it will try to find dispatch function for TObjectRef with the default dispatch token (empty string).
|
inline |
Remove dispatch function.
| token | The dispatch token. |
| type_index | The TVM object type index for the dispatch function to be removed. |
This is useful when dispatch function comes from other language's runtime, and those function should be removed before that language runtime shuts down.
|
inline |
|
inline |
Set the dispatch function.
| token | The dispatch token. |
| f | The dispatch function. |
|
inline |
Set the dispatch function.
| token | The dispatch token. |
| type_index | The TVM object type index for this dispatch function. |
| f | The dispatch function. |
This takes a type-erased packed function as input. It should be used through FFI boundary, for example, registering dispatch function from Python.
|
inline |
|
inline |