![]() |
TI Deep Learning Product User Guide
|
This file defines the public interface for TIDL Runtime API.
This same API supports a client on a different CPU, out-of-process on the same CPU, or in-process.
This interface is targeted for users developing inference application
with imported TIDL models and users developing offload APIs for Open source
runtime engines like TFlite (Delegate) and ONNX runtime (Execution provider) etc.
Go to the source code of this file.
Data Structures | |
struct | sTIDLRT_Tensor_t |
struct | sTIDLRT_PerfStats_t |
struct | sTIDLRT_Params_t |
Macros | |
#define | TIDLRT_STRING_SIZE ((int32_t) 512) |
#define | TIDLRT_PAD_DIM_MAX ((uint32_t) 4) |
TIDL Element Type | |
#define | TIDLRT_Uint8 ((int32_t) 0) |
#define | TIDLRT_Int8 ((int32_t) 1) |
#define | TIDLRT_Uint16 ((int32_t) 2) |
#define | TIDLRT_Int16 ((int32_t) 3) |
#define | TIDLRT_Uint32 ((int32_t) 4) |
#define | TIDLRT_Int32 ((int32_t) 5) |
#define | TIDLRT_Float32 ((int32_t) 6) |
#define | TIDLRT_Uint64 ((int32_t) 7) |
#define | TIDLRT_Int64 ((int32_t) 8) |
TIDL Data Dimension Index | |
#define | TIDLRT_DIM_BATCH ((int32_t) 0) |
#define | TIDLRT_DIM_NUMCH ((int32_t) 1) |
#define | TIDLRT_DIM_HEIGHT ((int32_t) 2) |
#define | TIDLRT_DIM_WIDTH ((int32_t) 3) |
#define | TIDLRT_DIM_MAX (TIDLRT_DIM_WIDTH+1) |
TIDL Pitch Dimension Index | |
#define | TIDLRT_ROI_PITCH ((uint32_t) 0) |
#define | TIDLRT_CHANNEL_PITCH ((uint32_t) 1) |
#define | TIDLRT_LINE_PITCH ((uint32_t) 2) |
#define | TIDLRT_PITCH_MAX ((uint32_t) (TIDLRT_DIM_MAX - 1)) |
Memory types in TIDL RT | |
#define | TIDLRT_MEM_USER_SPACE ((uint32_t) 0) |
#define | TIDLRT_MEM_SHARED ((uint32_t) 1) |
#define | TIDLRT_MEM_NATIVE ((uint32_t) 2) |
#define | TIDLRT_MEM_MAX (TIDLRT_MEM_NATIVE+1) |
Tensor Layout Type | |
#define | TIDLRT_LT_NCHW ((uint32_t) 0) |
#define | TIDLRT_LT_NHWC ((uint32_t) 1) |
#define | TIDLRT_LT_MAX (TIDLRT_LT_NHWC+1) |
Functions | |
int32_t | TIDLRT_create (sTIDLRT_Params_t *prms, void **handle) |
Function to create an instance of TIDL runtime. More... | |
int32_t | TIDLRT_delete (void *handle) |
Function to delete an instance of TIDL runtime. More... | |
int32_t | TIDLRT_invoke (void *handle, sTIDLRT_Tensor_t *in[], sTIDLRT_Tensor_t *out[]) |
Function to run inference on input using a TIDL RT instance handle. More... | |
int32_t | TIDLRT_deactivate (void *handle) |
Function to deactivate a instance of TIDL runtime. Activate will be done by the invoke if the handle is not active. More... | |
int32_t | TIDLRT_setParamsDefault (sTIDLRT_Params_t *prms) |
Function to set default values for parameters defined in sTIDLRT_Params_t. More... | |
int32_t | TIDLRT_setTensorDefault (sTIDLRT_Tensor_t *tensor) |
Function to set default values of parameters defined in sTIDLRT_Tensor_t. More... | |
int32_t | TIDLRT_getDdrStats (uint64_t *read_bytes, uint64_t *write_bytes) |
Function to get the number of bytes read and written during the last inference call TIDLRT_invoke. More... | |
void * | TIDLRT_allocSharedMem (int32_t alignment, int32_t size) |
Function to allocate memory in the shared heap memory section between the Host core and DL accelerator. Allocating memory here would help in avoiding buffer copy between the cores. More... | |
void | TIDLRT_freeSharedMem (void *ptr) |
Function to free the memory allocated using TIDLRT_allocSharedMem. More... | |
int32_t | TIDLRT_isSharedMem (void *ptr) |
Function to check whether The memory pointed by input pointer is part of shared heap section or NOT. More... | |
#define TIDLRT_STRING_SIZE ((int32_t) 512) |
#define TIDLRT_PAD_DIM_MAX ((uint32_t) 4) |
#define TIDLRT_Uint8 ((int32_t) 0) |
#define TIDLRT_Int8 ((int32_t) 1) |
#define TIDLRT_Uint16 ((int32_t) 2) |
#define TIDLRT_Int16 ((int32_t) 3) |
#define TIDLRT_Uint32 ((int32_t) 4) |
#define TIDLRT_Int32 ((int32_t) 5) |
#define TIDLRT_Float32 ((int32_t) 6) |
#define TIDLRT_Uint64 ((int32_t) 7) |
#define TIDLRT_Int64 ((int32_t) 8) |
#define TIDLRT_DIM_BATCH ((int32_t) 0) |
#define TIDLRT_DIM_NUMCH ((int32_t) 1) |
#define TIDLRT_DIM_HEIGHT ((int32_t) 2) |
#define TIDLRT_DIM_WIDTH ((int32_t) 3) |
#define TIDLRT_DIM_MAX (TIDLRT_DIM_WIDTH+1) |
#define TIDLRT_ROI_PITCH ((uint32_t) 0) |
#define TIDLRT_CHANNEL_PITCH ((uint32_t) 1) |
#define TIDLRT_LINE_PITCH ((uint32_t) 2) |
#define TIDLRT_PITCH_MAX ((uint32_t) (TIDLRT_DIM_MAX - 1)) |
#define TIDLRT_MEM_USER_SPACE ((uint32_t) 0) |
#define TIDLRT_MEM_SHARED ((uint32_t) 1) |
#define TIDLRT_MEM_NATIVE ((uint32_t) 2) |
#define TIDLRT_MEM_MAX (TIDLRT_MEM_NATIVE+1) |
#define TIDLRT_LT_NCHW ((uint32_t) 0) |
#define TIDLRT_LT_NHWC ((uint32_t) 1) |
#define TIDLRT_LT_MAX (TIDLRT_LT_NHWC+1) |
int32_t TIDLRT_create | ( | sTIDLRT_Params_t * | prms, |
void ** | handle | ||
) |
Function to create an instance of TIDL runtime.
prms | : Pointer to user configuration as defined in sTIDLRT_Params_t |
handle | : Pointer to the Successfully created instance is returned with this |
int32_t TIDLRT_delete | ( | void * | handle | ) |
Function to delete an instance of TIDL runtime.
handle | : Pointer to the Successfully created TIDL RT instance |
int32_t TIDLRT_invoke | ( | void * | handle, |
sTIDLRT_Tensor_t * | in[], | ||
sTIDLRT_Tensor_t * | out[] | ||
) |
Function to run inference on input using a TIDL RT instance handle.
handle | : Pointer to the Successfully created TIDL RT instance |
in | : Pointer to list of input tensors as defined in sTIDLRT_Tensor_t |
out | : Pointer to list of output tensors as defined in sTIDLRT_Tensor_t |
int32_t TIDLRT_deactivate | ( | void * | handle | ) |
Function to deactivate a instance of TIDL runtime. Activate will be done by the invoke if the handle is not active.
handle | : Pointer to the Successfully created TIDL RT instance |
int32_t TIDLRT_setParamsDefault | ( | sTIDLRT_Params_t * | prms | ) |
Function to set default values for parameters defined in sTIDLRT_Params_t.
prms | : Pointer to a instance of sTIDLRT_Params_t |
int32_t TIDLRT_setTensorDefault | ( | sTIDLRT_Tensor_t * | tensor | ) |
Function to set default values of parameters defined in sTIDLRT_Tensor_t.
tensor | : Pointer to a instance of sTIDLRT_Tensor_t |
int32_t TIDLRT_getDdrStats | ( | uint64_t * | read_bytes, |
uint64_t * | write_bytes | ||
) |
Function to get the number of bytes read and written during the last inference call TIDLRT_invoke.
read_bytes | : Number of bytes read from DDR memory |
write_bytes | : Number of bytes written to DDR memory |
void* TIDLRT_allocSharedMem | ( | int32_t | alignment, |
int32_t | size | ||
) |
Function to allocate memory in the shared heap memory section between the Host core and DL accelerator. Allocating memory here would help in avoiding buffer copy between the cores.
alignment | : Bases address alignment required in number of bytes |
size | : Number of bytes to be allocated |
void TIDLRT_freeSharedMem | ( | void * | ptr | ) |
Function to free the memory allocated using TIDLRT_allocSharedMem.
ptr | : Pointer to allocated memory |
int32_t TIDLRT_isSharedMem | ( | void * | ptr | ) |
Function to check whether The memory pointed by input pointer is part of shared heap section or NOT.
ptr | : Pointer to the memory |