|
tvm
|
TVM runtime backend API. More...
#include <tvm/runtime/base.h>Go to the source code of this file.
Classes | |
| struct | TVMParallelGroupEnv |
| Environment for TVM parallel task. More... | |
Typedefs | |
| typedef int(* | FTVMParallelLambda) (int task_id, TVMParallelGroupEnv *penv, void *cdata) |
| The callback function to execute a parallel lambda. More... | |
Functions | |
| TVM_RUNTIME_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_RUNTIME_DLL int | TVMBackendFreeWorkspace (int device_type, int device_id, void *ptr) |
| Backend function to free temporal workspace. More... | |
| TVM_RUNTIME_DLL int | TVMBackendParallelLaunch (FTVMParallelLambda flambda, void *cdata, int num_task) |
| Backend function for running parallel jobs. More... | |
| TVM_RUNTIME_DLL int | TVMBackendParallelBarrier (int task_id, TVMParallelGroupEnv *penv) |
| BSP barrrier between parallel threads. More... | |
TVM runtime backend API.
The functions defined in this header are intended to be used by compiled tvm operators, usually user do not need to use these function directly.
| typedef int(* FTVMParallelLambda) (int task_id, TVMParallelGroupEnv *penv, void *cdata) |
The callback function to execute a parallel lambda.
| task_id | the task id of the function. |
| penv | The parallel environment backs the execution. |
| cdata | The supporting closure data. |
| TVM_RUNTIME_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.
| 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. |
| TVM_RUNTIME_DLL int TVMBackendFreeWorkspace | ( | int | device_type, |
| int | device_id, | ||
| void * | ptr | ||
| ) |
Backend function to free temporal workspace.
| 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. |
| TVM_RUNTIME_DLL int TVMBackendParallelBarrier | ( | int | task_id, |
| TVMParallelGroupEnv * | penv | ||
| ) |
BSP barrrier between parallel threads.
| task_id | the task id of the function. |
| penv | The parallel environment backs the execution. |
| TVM_RUNTIME_DLL int TVMBackendParallelLaunch | ( | FTVMParallelLambda | flambda, |
| void * | cdata, | ||
| int | num_task | ||
| ) |
Backend function for running parallel jobs.
| 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. |