TIOVX User Guide
c: Application Interface APIs

Detailed Description

APIs for application interface accessible only on host.

Modules

 Super Node Framework Type APIs
 APIs creating and using super node framework type.
 
 Kernel Helper APIs
 Helper APIs used used for host side kernel validation.
 
 Utility APIs
 Utility APIs available for the application running on the host.
 
 Platform OSAL APIs
 Platform operating system abstraction layer on the host.
 
 Debug APIs
 APIs for debug operations on the host.
 
 Real-time Trace APIs
 APIs for real-time event trace operations on the host.
 
 Tensor Data Type APIs
 APIs creating and using tensor data type (note: this is not included in OpenVX 1.1 and thus added to TI extensions)
 
 Raw Image Data Type APIs
 APIs creating and using raw image data type.
 
 Node APIs
 TIOVX APIs for node operations in the processing graph.
 
 Reference APIs
 APIs for handling references, handles, and data pointers.
 
 Graph APIs
 APIs for querying and manipulating the OpenVX graph.
 
 Kernel APIs
 APIs for working with compute kernels, target selection, and execution control.
 
 Attribute Extension APIs
 TI attribute extensions for OpenVX objects.
 

Defines

#define TIVX_TARGET_MAX_NAME   (64u)
 Max possible name of a target.
 
#define TIVX_TARGET_HOST   "HOST"
 String to name a OpenVX Host. More...
 
#define TIVX_CONFIG_PATH_LENGTH   (512u)
 Max size of config file path.
 
#define dimof(x)   (sizeof(x)/sizeof(x[0]))
 Macro to find size of array.
 

Enumerations

enum  tivx_df_image_e {
  TIVX_DF_IMAGE_P12 = VX_DF_IMAGE('P','0','1','2'),
  TIVX_DF_IMAGE_NV12_P12 = VX_DF_IMAGE('N','1','2','P'),
  TIVX_DF_IMAGE_RGB565 = VX_DF_IMAGE('R','5','6','5'),
  TIVX_DF_IMAGE_BGRX = VX_DF_IMAGE('B','G','R','A')
}
 Based on the VX_DF_IMAGE definition. More...
 
enum  tivx_status_e { TIVX_STATUS_BASE = -(vx_int32)100 }
 The enumeration of all TIVX operational error codes. More...
 
enum  tivx_cpu_id_e {
  TIVX_CPU_ID_DSP1 = 0,
  TIVX_CPU_ID_DSP2 = 1,
  TIVX_CPU_ID_DSP_C7_1 = 2,
  TIVX_CPU_ID_MCU2_0 = 3,
  TIVX_CPU_ID_VPAC1 = TIVX_CPU_ID_MCU2_0,
  TIVX_CPU_ID_VIDEO_IO = TIVX_CPU_ID_MCU2_0,
  TIVX_CPU_ID_MCU2_1 = 4,
  TIVX_CPU_ID_DMPAC = TIVX_CPU_ID_MCU2_1,
  TIVX_CPU_ID_MPU_0 = 5,
  TIVX_CPU_ID_MCU3_0 = 6,
  TIVX_CPU_ID_MCU3_1 = 7,
  TIVX_CPU_ID_MAX = 8,
  TIVX_CPU_ID_INVALID = 0xFF
}
 CPU ID for supported CPUs. More...
 

Functions

void tivxInit (void)
 Function to initialize OpenVX framework. More...
 
void tivxDeInit (void)
 Function to de-initialize OpenVX framework. More...
 
void tivxHostInit (void)
 Function to initialize OpenVX HOST side functionality. More...
 
void tivxHostDeInit (void)
 Function to de-initialize OpenVX HOST side functionality. More...
 
VX_API_ENTRY vx_status VX_API_CALL tivxRegisterModule (const char *name, vx_publish_kernels_f publish, vx_unpublish_kernels_f unpublish)
 Register publish and unpublish functions against a module name. More...
 
VX_API_ENTRY vx_status VX_API_CALL tivxUnRegisterModule (const char *name)
 UnRegister publish and unpublish functions if previously registered. More...
 
vx_enum tivxGetSelfCpuId (void)
 Return CPU ID of the CPU on which this API is called. More...
 
vx_bool tivxIsTargetEnabled (const char target_name[])
 Utility function to know if target is enabled or not. More...
 
uint64_t tivxPlatformGetTimeInUsecs (void)
 Get the time in micro seconds. More...
 

Macro Definition Documentation

◆ TIVX_TARGET_HOST

#define TIVX_TARGET_HOST   "HOST"

String to name a OpenVX Host.

Host is not a unique target on its own. At system config "HOST" will map to one of available targets

Definition at line 105 of file tivx.h.

Enumeration Type Documentation

◆ tivx_df_image_e

Based on the VX_DF_IMAGE definition.

Note
Use vx_df_image to contain these values.
Enumerator
TIVX_DF_IMAGE_P12 

A single plane of packed 12-bit data.

The stride_x for this data format must be set to 0

TIVX_DF_IMAGE_NV12_P12 

a NV12 frame of packed 12-bit data.

The stride_x for this data format must be set to 0

TIVX_DF_IMAGE_RGB565 

A single plane of packed 16-bit RGB565 data.

The stride_x for this data format must be set to 2

TIVX_DF_IMAGE_BGRX 

A single plane of 32-bit pixel as 4 interleaved 8-bit units of B then G then R data, then a don't care byte. This uses the BT709 full range by default.

Definition at line 340 of file tivx.h.

◆ tivx_status_e

The enumeration of all TIVX operational error codes.

Enumerator
TIVX_STATUS_BASE 

Indicates the base for the TIVX error codes. Used for bounds checks only.

Definition at line 367 of file tivx.h.

◆ tivx_cpu_id_e

CPU ID for supported CPUs.

CPU ID is defined in platform module since depending on platform the CPUs could be different

Current CPU IDs are defined assuming J721E SoC

Caution: This enum is used as index into the array #g_ipc_cpu_id_map, so change in this enum will require change in this array as well.

Enumerator
TIVX_CPU_ID_DSP1 

CPU ID for DSP1.

TIVX_CPU_ID_DSP2 

CPU ID for DSP2.

TIVX_CPU_ID_DSP_C7_1 

CPU ID for C7_1.

TIVX_CPU_ID_MCU2_0 

CPU ID for MCU2_0.

TIVX_CPU_ID_VPAC1 

CPU ID alias for which CPU VPAC1 is used from.

TIVX_CPU_ID_VIDEO_IO 

CPU ID alias for which CPU Video IO kernels are used from.

TIVX_CPU_ID_MCU2_1 

CPU ID for MCU2_1.

TIVX_CPU_ID_DMPAC 

CPU ID alias for which CPU DMPAC is used from.

TIVX_CPU_ID_MPU_0 

CPU ID for MPU-0.

TIVX_CPU_ID_MCU3_0 

CPU ID for MCU3_0.

TIVX_CPU_ID_MCU3_1 

CPU ID for MCU3_1.

TIVX_CPU_ID_MAX 

Max value of CPU ID.

TIVX_CPU_ID_INVALID 

Invalid CPU ID.

Definition at line 343 of file tivx_soc_j721e.h.

Function Documentation

◆ tivxInit()

void tivxInit ( void  )

Function to initialize OpenVX framework.

Should be called during system init on all OpenVX HOST as well as OpenVX target CPUs

NOTE: In Vision SDK, this function is called during VIsion SDK system init so user need not call this explicitly

◆ tivxDeInit()

void tivxDeInit ( void  )

Function to de-initialize OpenVX framework.

Should be called during system init on all OpenVX HOST as well as OpenVX target CPUs

NOTE: In Vision SDK, this function is called during VIsion SDK system init so user need not call this explicitly

◆ tivxHostInit()

void tivxHostInit ( void  )

Function to initialize OpenVX HOST side functionality.

Should be called during system init after tivxInit() on HOST CPUs only

NOTE: In Vision SDK, this function is called during VIsion SDK system init so user need not call this explicitly

◆ tivxHostDeInit()

void tivxHostDeInit ( void  )

Function to de-initialize OpenVX HOST side functionality.

Should be called during system init before tivxDeInit() on HOST CPUs only

NOTE: In Vision SDK, this function is called during VIsion SDK system init so user need not call this explicitly

◆ tivxRegisterModule()

VX_API_ENTRY vx_status VX_API_CALL tivxRegisterModule ( const char *  name,
vx_publish_kernels_f  publish,
vx_unpublish_kernels_f  unpublish 
)

Register publish and unpublish functions against a module name.

These functions are invoked when vxLoadKernels is called with the registered name.

This is alternative instead of dynamically loading kernels during vxLoadKernels

Duplicate module names not checked by this API.

API is not reentrant, user is recommended to call all tivxRegisterModule during system init before vxCreateContext() from a single thread.

Modules registered against TIVX_MODULE_NAME are called during vxCreateContext so user MUST ensure tivxRegisterModule() is called for TIVX_MODULE_NAME module

◆ tivxUnRegisterModule()

VX_API_ENTRY vx_status VX_API_CALL tivxUnRegisterModule ( const char *  name)

UnRegister publish and unpublish functions if previously registered.

Parameters
[in]nameModule name to unregister
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors.
VX_FAILUREUnable to find module "name" in list of registered modules

◆ tivxGetSelfCpuId()

vx_enum tivxGetSelfCpuId ( void  )

Return CPU ID of the CPU on which this API is called.

Returns
A vx_emum enumeration of the CPU_ID.

◆ tivxIsTargetEnabled()

vx_bool tivxIsTargetEnabled ( const char  target_name[])

Utility function to know if target is enabled or not.

Parameters
[in]target_nameString specifying the target name
Returns
A vx_bool value.
Return values
vx_true_eThe target is enabled
vx_false_eThe target is not enabled

◆ tivxPlatformGetTimeInUsecs()

uint64_t tivxPlatformGetTimeInUsecs ( void  )

Get the time in micro seconds.

Returns
Time in micro seconds.