TIOVX User Guide

Detailed Description

APIs for kernel operations on the target.

Typedefs

typedef struct _tivx_target_kernel * tivx_target_kernel
 Handle to kernel on a target.
 
typedef struct _tivx_target_kernel_instance * tivx_target_kernel_instance
 Handle to instance of kernel on a target.
 
typedef vx_status(VX_CALLBACKtivx_target_kernel_f) (tivx_target_kernel_instance kernel, tivx_obj_desc_t *obj_desc[], uint16_t num_params, void *priv_arg)
 The target kernel callback. More...
 
typedef vx_status(VX_CALLBACKtivx_target_kernel_control_f) (tivx_target_kernel_instance kernel, uint32_t node_cmd_id, tivx_obj_desc_t *obj_desc[], uint16_t num_params, void *priv_arg)
 The target kernel callback for control command. More...
 

Functions

VX_API_ENTRY tivx_target_kernel VX_API_CALL tivxAddTargetKernel (vx_enum kernel_id, const char *target_name, tivx_target_kernel_f process_func, tivx_target_kernel_f create_func, tivx_target_kernel_f delete_func, tivx_target_kernel_control_f control_func, void *priv_arg)
 Allows users to add native kernels implementation to specific targets. More...
 
VX_API_ENTRY tivx_target_kernel VX_API_CALL tivxAddTargetKernelByName (const char *kernel_name, const char *target_name, tivx_target_kernel_f process_func, tivx_target_kernel_f create_func, tivx_target_kernel_f delete_func, tivx_target_kernel_control_f control_func, void *priv_arg)
 Allows users to add native kernels implementation to specific targets. More...
 
VX_API_ENTRY vx_status VX_API_CALL tivxRemoveTargetKernel (tivx_target_kernel target_kernel)
 Allows users to remove native kernels implementation to specific targets.
 
VX_API_ENTRY vx_status VX_API_CALL tivxRemoveTargetKernelByName (const char *kernel_name, const char *target_name)
 Allows users to remove native kernels implementation to specific targets by providing a kernel name and target name.
 
VX_API_ENTRY vx_status VX_API_CALL tivxQueryNumTargetKernel (vx_uint32 *ptr)
 Queries the framework to determine the number of target kernels on the target from which it is called. More...
 
VX_API_ENTRY vx_status VX_API_CALL tivxSetTargetKernelInstanceContext (tivx_target_kernel_instance target_kernel_instance, void *kernel_context, uint32_t kernel_context_size)
 Associate a kernel function context or handle with a target kernel instance. More...
 
VX_API_ENTRY vx_status VX_API_CALL tivxGetTargetKernelInstanceContext (tivx_target_kernel_instance target_kernel_instance, void **kernel_context, uint32_t *kernel_context_size)
 Get a kernel function context or handle with a target kernel instance. More...
 
VX_API_ENTRY vx_status VX_API_CALL tivxGetTargetKernelInstanceState (tivx_target_kernel_instance target_kernel_instance, vx_enum *state)
 Get a kernel state with a target kernel instance. More...
 
VX_API_ENTRY vx_status VX_API_CALL tivxGetTargetKernelTargetId (tivx_target_kernel_instance target_kernel_instance, uint32_t *targetId)
 Get a kernel target id with a target kernel instance. More...
 
VX_API_ENTRY void tivxGetTargetKernelInstanceBorderMode (tivx_target_kernel_instance target_kernel_instance, vx_border_t *border_mode)
 Get the border mode for the target kernel instance. More...
 
VX_API_ENTRY vx_bool tivxIsTargetKernelInstanceReplicated (tivx_target_kernel_instance kernel_instance)
 Checks if supplied node is replicated. Returns vx_true if the given node is replicated and vx_false if not.
 

Typedef Documentation

◆ tivx_target_kernel_f

typedef vx_status(VX_CALLBACK * tivx_target_kernel_f) (tivx_target_kernel_instance kernel, tivx_obj_desc_t *obj_desc[], uint16_t num_params, void *priv_arg)

The target kernel callback.

For create_func, delete_func and process_func callbacks 'obj_desc' points to array of data object descriptor parameters

For control_func, 'obj_desc' points to array of objects descriptors where obj_desc[0] points to the node object descriptors obj_desc[1..num_params-1] points to target kernel defined parameters

Parameters
[in]kernelThe kernel for which the callback is called
[in]obj_descObject descriptor passed as input to this callback

Definition at line 107 of file tivx_target_kernel.h.

◆ tivx_target_kernel_control_f

typedef vx_status(VX_CALLBACK * tivx_target_kernel_control_f) (tivx_target_kernel_instance kernel, uint32_t node_cmd_id, tivx_obj_desc_t *obj_desc[], uint16_t num_params, void *priv_arg)

The target kernel callback for control command.

For create_func, delete_func and process_func callbacks 'obj_desc' points to array of data object descriptor parameters

For control_func, 'obj_desc' points to array of objects descriptors for control parameter. It could be any vx_(object)

Parameters
[in]kernelThe kernel for which the callback is called
[in]CommandID to be processed in the given node
[in]obj_descObject descriptor passed as input to this callback
[in]num_paramsvalid entries in object descriptor (obj_desc) array

Definition at line 127 of file tivx_target_kernel.h.

Function Documentation

◆ tivxAddTargetKernel()

VX_API_ENTRY tivx_target_kernel VX_API_CALL tivxAddTargetKernel ( vx_enum  kernel_id,
const char *  target_name,
tivx_target_kernel_f  process_func,
tivx_target_kernel_f  create_func,
tivx_target_kernel_f  delete_func,
tivx_target_kernel_control_f  control_func,
void *  priv_arg 
)

Allows users to add native kernels implementation to specific targets.

This is different from vxAddUserKernel() in that this is called on the target CPU. This is a TI proprietary API and not part of OpenVX or TI OpenVX extention.

This allows users to implement and plugin specific target optimized kernels on TI platforms

A equivalent vxAddUserKernel is typically called to pair the target kernel with OpenVX user kernel.

◆ tivxAddTargetKernelByName()

VX_API_ENTRY tivx_target_kernel VX_API_CALL tivxAddTargetKernelByName ( const char *  kernel_name,
const char *  target_name,
tivx_target_kernel_f  process_func,
tivx_target_kernel_f  create_func,
tivx_target_kernel_f  delete_func,
tivx_target_kernel_control_f  control_func,
void *  priv_arg 
)

Allows users to add native kernels implementation to specific targets.

Same as tivxAddTargetKernel except that it take a string name as input instead of kernel_id

Important Note: the kernel table which is populated when calling this API does not throw an error if duplicate names are entered. Therefore, the user must ensure all kernel names are unique on a given core.

◆ tivxQueryNumTargetKernel()

VX_API_ENTRY vx_status VX_API_CALL tivxQueryNumTargetKernel ( vx_uint32 ptr)

Queries the framework to determine the number of target kernels on the target from which it is called.

Parameters
[out]ptrThe location at which to store the resulting value.

◆ tivxSetTargetKernelInstanceContext()

VX_API_ENTRY vx_status VX_API_CALL tivxSetTargetKernelInstanceContext ( tivx_target_kernel_instance  target_kernel_instance,
void *  kernel_context,
uint32_t  kernel_context_size 
)

Associate a kernel function context or handle with a target kernel instance.

Typically set by the kernel function during create phase

◆ tivxGetTargetKernelInstanceContext()

VX_API_ENTRY vx_status VX_API_CALL tivxGetTargetKernelInstanceContext ( tivx_target_kernel_instance  target_kernel_instance,
void **  kernel_context,
uint32_t *  kernel_context_size 
)

Get a kernel function context or handle with a target kernel instance.

Typically used by the kernel function during run, control, delete phase

◆ tivxGetTargetKernelInstanceState()

VX_API_ENTRY vx_status VX_API_CALL tivxGetTargetKernelInstanceState ( tivx_target_kernel_instance  target_kernel_instance,
vx_enum state 
)

Get a kernel state with a target kernel instance.

Typically used by a capture kernel function during process to track state

◆ tivxGetTargetKernelTargetId()

VX_API_ENTRY vx_status VX_API_CALL tivxGetTargetKernelTargetId ( tivx_target_kernel_instance  target_kernel_instance,
uint32_t *  targetId 
)

Get a kernel target id with a target kernel instance.

Typically used by nodes having multi priority implementation

◆ tivxGetTargetKernelInstanceBorderMode()

VX_API_ENTRY void tivxGetTargetKernelInstanceBorderMode ( tivx_target_kernel_instance  target_kernel_instance,
vx_border_t border_mode 
)

Get the border mode for the target kernel instance.

Used by the kernel implementation to get border mode