24 #ifndef TVM_RUNTIME_CRT_FUNC_REGISTRY_H_ 25 #define TVM_RUNTIME_CRT_FUNC_REGISTRY_H_ 64 tvm_function_index_t* function_index);
90 #define TVM_AVERAGE_FUNCTION_NAME_STRLEN_BYTES 10 104 static const size_t kTvmAverageFuncEntrySizeBytes =
117 size_t buffer_size_bytes);
137 #endif // TVM_RUNTIME_CRT_FUNC_REGISTRY_H_ TVMFuncRegistry registry
Definition: func_registry.h:83
#define TVM_AVERAGE_FUNCTION_NAME_STRLEN_BYTES
Definition: func_registry.h:90
const TVMBackendPackedCFunc * funcs
Function pointers, in the same order as their names in names.
Definition: func_registry.h:50
A data structure that facilitates function lookup by C-string name.
Definition: func_registry.h:41
struct TVMMutableFuncRegistry TVMMutableFuncRegistry
A TVMFuncRegistry that supports adding and changing the functions.
tvm_crt_error_t TVMFuncRegistry_Lookup(const TVMFuncRegistry *reg, const char *name, tvm_function_index_t *function_index)
Get packed function from registry by name.
tvm_crt_error_t TVMFuncRegistry_GetByIndex(const TVMFuncRegistry *reg, tvm_function_index_t index, TVMBackendPackedCFunc *out_func)
Fetch TVMBackendPackedCFunc given a function index.
Defines integral error codes returned by the CRT.
tvm_crt_error_t
Definition: error_codes.h:50
uint16_t tvm_function_index_t
Definition: func_registry.h:34
uint16_t tvm_module_index_t
Definition: func_registry.h:36
tvm_crt_error_t TVMMutableFuncRegistry_Set(TVMMutableFuncRegistry *reg, const char *name, TVMBackendPackedCFunc func, int override)
Add or set a function in the registry.
A TVMFuncRegistry that supports adding and changing the functions.
Definition: func_registry.h:82
size_t max_functions
maximum number of functions in this registry.
Definition: func_registry.h:86
int(* TVMBackendPackedCFunc)(TVMValue *args, int *type_codes, int num_args, TVMValue *out_ret_value, int *out_ret_tcode, void *resource_handle)
Signature for backend functions exported as DLL.
Definition: c_backend_api.h:49
tvm_crt_error_t TVMMutableFuncRegistry_Create(TVMMutableFuncRegistry *reg, uint8_t *buffer, size_t buffer_size_bytes)
Create a new mutable function registry from a block of memory.
const char * names
Names of registered functions, concatenated together and separated by \0. An additional \0 is present...
Definition: func_registry.h:47
struct TVMFuncRegistry TVMFuncRegistry
A data structure that facilitates function lookup by C-string name.