Go to the source code of this file.
|
TVM_DLL int | TVMBackendGetFuncFromEnv (void *mod_node, const char *func_name, TVMFunctionHandle *out) |
| Backend function for modules to get function from its environment mod_node (its imports and global function). The user do should not call TVMFuncFree on func. More...
|
|
TVM_DLL int | TVMBackendRegisterSystemLibSymbol (const char *name, void *ptr) |
| Backend function to register system-wide library symbol. More...
|
|
TVM_DLL void * | TVMBackendAllocWorkspace (int device_type, int device_id, uint64_t nbytes, int dtype_code_hint, int dtype_bits_hint) |
| Backend function to allocate temporal workspace. More...
|
|
TVM_DLL int | TVMBackendFreeWorkspace (int device_type, int device_id, void *ptr) |
| Backend function to free temporal workspace. More...
|
|
TVM_DLL int | TVMBackendParallelLaunch (FTVMParallelLambda flambda, void *cdata, int num_task) |
| Backend function for running parallel jobs. More...
|
|
TVM_DLL int | TVMBackendParallelBarrier (int task_id, TVMParallelGroupEnv *penv) |
| BSP barrrier between parallel threads. More...
|
|
TVM_DLL int | TVMBackendRunOnce (void **handle, int(*f)(void *), void *cdata, int nbytes) |
| Simple static initialization function. Run f once and set handle to be not null. This function is mainly used for test purpose. More...
|
|
◆ FTVMParallelLambda
The callback function to execute a parallel lambda.
- Parameters
-
task_id | the task id of the function. |
penv | The parallel environment backs the execution. |
cdata | The supporting closure data. |
Definition at line 112 of file c_backend_api.h.
◆ TVMBackendAllocWorkspace()
TVM_DLL void* TVMBackendAllocWorkspace |
( |
int |
device_type, |
|
|
int |
device_id, |
|
|
uint64_t |
nbytes, |
|
|
int |
dtype_code_hint, |
|
|
int |
dtype_bits_hint |
|
) |
| |
Backend function to allocate temporal workspace.
- Note
- The result allocate spaced is ensured to be aligned to kTempAllocaAlignment.
- Parameters
-
nbytes | The size of the space requested. |
device_type | The device type which the space will be allocated. |
device_id | The device id which the space will be allocated. |
dtype_code_hint | The type code of the array elements. Only used in certain backends such as OpenGL. |
dtype_bits_hint | The type bits of the array elements. Only used in certain backends such as OpenGL. |
- Returns
- nullptr when error is thrown, a valid ptr if success
Referenced by fused_nn_contrib_conv2d_NCHWc().
◆ TVMBackendFreeWorkspace()
TVM_DLL int TVMBackendFreeWorkspace |
( |
int |
device_type, |
|
|
int |
device_id, |
|
|
void * |
ptr |
|
) |
| |
Backend function to free temporal workspace.
- Parameters
-
ptr | The result allocated space pointer. |
device_type | The device type which the space will be allocated. |
device_id | The device id which the space will be allocated. |
- Returns
- 0 when no error is thrown, -1 when failure happens
- See also
- TVMBackendAllocWorkspace
Referenced by fused_nn_contrib_conv2d_NCHWc().
◆ TVMBackendGetFuncFromEnv()
Backend function for modules to get function from its environment mod_node (its imports and global function). The user do should not call TVMFuncFree on func.
- Parameters
-
mod_node | The module handle. |
func_name | The name of the function. |
out | The result function. |
- Returns
- 0 when no error is thrown, -1 when failure happens
◆ TVMBackendParallelBarrier()
BSP barrrier between parallel threads.
- Parameters
-
task_id | the task id of the function. |
penv | The parallel environment backs the execution. |
- Returns
- 0 when no error is thrown, -1 when failure happens
◆ TVMBackendParallelLaunch()
Backend function for running parallel jobs.
- Parameters
-
flambda | The parallel function to be launched. |
cdata | The closure data. |
num_task | Number of tasks to launch, can be 0, means launch with all available threads. |
- Returns
- 0 when no error is thrown, -1 when failure happens
◆ TVMBackendRegisterSystemLibSymbol()
TVM_DLL int TVMBackendRegisterSystemLibSymbol |
( |
const char * |
name, |
|
|
void * |
ptr |
|
) |
| |
Backend function to register system-wide library symbol.
- Parameters
-
name | The name of the symbol |
ptr | The symbol address. |
- Returns
- 0 when no error is thrown, -1 when failure happens
◆ TVMBackendRunOnce()
TVM_DLL int TVMBackendRunOnce |
( |
void ** |
handle, |
|
|
int(*)(void *) |
f, |
|
|
void * |
cdata, |
|
|
int |
nbytes |
|
) |
| |
Simple static initialization function. Run f once and set handle to be not null. This function is mainly used for test purpose.
- Parameters
-
handle | An global address to indicate f |
f | The function to be ran |
cdata | The closure data to pass to the function. |
nbytes | Number of bytes in the closure data. |
- Returns
- 0 when no error is thrown, -1 when failure happens