tvm
|
Tiny AoT executor. More...
#include <dlpack/dlpack.h>
#include <tvm/runtime/c_runtime_api.h>
#include <tvm/runtime/crt/packed_func.h>
Go to the source code of this file.
Classes | |
struct | TVMOpParam |
operator attributes about tvm op More... | |
struct | TVMGraphExecutorGraphAttr |
Typedefs | |
typedef struct TVMOpParam | TVMOpParam |
operator attributes about tvm op More... | |
typedef struct TVMGraphExecutorGraphAttr | TVMGraphExecutorGraphAttr |
typedef struct TVMGraphExecutor | TVMGraphExecutor |
Functions | |
int | TVMGraphExecutor_Create (const char *sym_json, TVMModuleHandle module_handle, const DLDevice *devices, TVMGraphExecutor **executor) |
Allocate a new GraphExecutor with TVMPlatformMemoryAllocate and initialize it. More... | |
int | TVMGraphExecutor_GetInputIndex (TVMGraphExecutor *executor, const char *name) |
int | TVMGraphExecutor_GetNumInputs () |
get number of input tensors allocated. More... | |
void | TVMGraphExecutor_SetInput (TVMGraphExecutor *executor, const char *name, DLTensor *data_in) |
set input to the graph based on name. More... | |
int | TVMGraphExecutor_GetNumOutputs () |
get number of output tensors allocated. More... | |
int | TVMGraphExecutor_GetOutput (TVMGraphExecutor *executor, const int32_t index, DLTensor *out) |
Return NDArray for given output index. More... | |
int | TVMGraphExecutor_LoadParams (TVMGraphExecutor *executor, const char *param_blob, const uint32_t param_size) |
Load parameters from parameter blob. More... | |
void | TVMGraphExecutor_Run (TVMGraphExecutor *executor) |
Execute the graph. More... | |
int | TVMGraphExecutor_Release (TVMGraphExecutor **executor) |
Release memory associated with the graph executor. More... | |
Tiny AoT executor.
Tiny graph executor that can run graph containing only tvm PackedFunc.
typedef struct TVMGraphExecutor TVMGraphExecutor |
typedef struct TVMGraphExecutorGraphAttr TVMGraphExecutorGraphAttr |
typedef struct TVMOpParam TVMOpParam |
operator attributes about tvm op
int TVMGraphExecutor_Create | ( | const char * | sym_json, |
TVMModuleHandle | module_handle, | ||
const DLDevice * | devices, | ||
TVMGraphExecutor ** | executor | ||
) |
Allocate a new GraphExecutor with TVMPlatformMemoryAllocate and initialize it.
sym_json | JSON-encoded graph. |
module_handle | TVM Module that exposes the functions to call. |
devices | runtime execution device. |
executor | Pointer which receives a pointer to the newly-created instance. |
int TVMGraphExecutor_GetInputIndex | ( | TVMGraphExecutor * | executor, |
const char * | name | ||
) |
int TVMGraphExecutor_GetNumInputs | ( | ) |
get number of input tensors allocated.
int TVMGraphExecutor_GetNumOutputs | ( | ) |
get number of output tensors allocated.
int TVMGraphExecutor_GetOutput | ( | TVMGraphExecutor * | executor, |
const int32_t | index, | ||
DLTensor * | out | ||
) |
Return NDArray for given output index.
executor | The graph executor. |
index | The output index. |
out | The DLTensor corresponding to given output node index. |
int TVMGraphExecutor_LoadParams | ( | TVMGraphExecutor * | executor, |
const char * | param_blob, | ||
const uint32_t | param_size | ||
) |
Load parameters from parameter blob.
executor | The graph executor. |
param_blob | A binary blob of parameter. |
param_size | The parameter size. |
int TVMGraphExecutor_Release | ( | TVMGraphExecutor ** | executor | ) |
Release memory associated with the graph executor.
executor | Pointer to graph executor. |
void TVMGraphExecutor_Run | ( | TVMGraphExecutor * | executor | ) |
Execute the graph.
executor | The graph executor. |
void TVMGraphExecutor_SetInput | ( | TVMGraphExecutor * | executor, |
const char * | name, | ||
DLTensor * | data_in | ||
) |
set input to the graph based on name.
executor | The graph executor. |
name | The name of the input. |
data_in | The input data. |