CoreFlow 1.0.0
A modern orchestration and execution runtime
Loading...
Searching...
No Matches
Internal Target API

The Internal Target API. More...

Namespaces

namespace  coreflow
 The internal representation of a vx_array.
 

Classes

struct  vx_target_funcs_t
 The structure which holds all the target interface function pointers. More...
 

Macros

#define VX_INT_MAX_NUM_TARGETS   (VX_TARGET_PRIORITY_MAX)
 Defines the number of targets in the sample implementation.
 

Typedefs

typedef vx_status(* vx_target_init_f) (vx_target target)
 The function which initializes the target.
 
typedef vx_status(* vx_target_deinit_f) (vx_target target)
 The function which deinitializes the target.
 
typedef vx_status(* vx_target_supports_f) (vx_target target, vx_char targetName[VX_MAX_TARGET_NAME], vx_char kernelName[VX_MAX_TARGET_NAME], vx_uint32 *pIndex)
 Allows OpenVX to query a target to see if it supports an additional abstract target type like "khronos.automatic" or "khronos.low_power" on a specific kernel.
 
typedef vx_action(* vx_target_process_f) (vx_target target, vx_node nodes[], vx_size startIndex, vx_size numNodes)
 Processes the array of nodes supplied.
 
typedef vx_status(* vx_target_verify_f) (vx_target target, vx_node node)
 Verifies the array of nodes supplied for target specific information.
 
typedef vx_kernel(* vx_target_addkernel_f) (vx_target target, const vx_char name[VX_MAX_KERNEL_NAME], vx_enum enumeration, vx_kernel_f func_ptr, vx_uint32 num_parameters, vx_kernel_validate_f validate, vx_kernel_input_validate_f input, vx_kernel_output_validate_f output, vx_kernel_initialize_f initialize, vx_kernel_deinitialize_f deinitialize)
 Adds a kernel to a target.
 

Enumerations

enum  vx_target_priority_e {
  VX_TARGET_PRIORITY_C_MODEL ,
  VX_TARGET_PRIORITY_ORT ,
  VX_TARGET_PRIORITY_MAX = 10
}
 The priority list of targets. More...
 

Functions

vx_status coreflow::Context::loadTarget (const vx_char *targetName)
 This allows the implementation to load a target interface into OpenVX.
 
vx_status coreflow::Context::unloadTarget (const vx_char *targetName)
 This unloads a specific target in the targets list.
 
vx_status coreflow::Context::unloadTarget (vx_uint32 index, vx_bool unload_module)
 This unloads a specific target in the targets list.
 
 coreflow::Target::Target (vx_context context, vx_reference scope)
 Construct a new Target object.
 
 coreflow::Target::~Target ()=default
 Destroy the Target object.
 
static void coreflow::Target::printTarget (vx_target target, vx_uint32 index)
 Prints Target Information for Debugging.
 
static vx_bool coreflow::Target::matchTargetNameWithString (const vx_char *target_name, const vx_char *target_string)
 Match target name with specified target string.
 
static const vx_charcoreflow::Target::reverse_strstr (const vx_char *string, const vx_char *substr)
 Find the last occurrence of a substring in a string.
 
vx_status coreflow::Target::initializeTarget (vx_kernel_description_t *kernels[], vx_uint32 numkernels)
 Initializes a target's kernels list.
 
vx_status coreflow::Target::deinitializeTarget ()
 Deinitializes a target's kernels list.
 
vx_uint32 coreflow::Target::findTargetIndex ()
 Find target's index within context.
 
vx_kernel coreflow::Target::findKernelByEnum (vx_enum enumeration)
 Find kernel belonging to this target module by enum.
 

Detailed Description

The Internal Target API.

Macro Definition Documentation

◆ VX_INT_MAX_NUM_TARGETS

#define VX_INT_MAX_NUM_TARGETS   (VX_TARGET_PRIORITY_MAX)

#include <vx_internal.h>

Defines the number of targets in the sample implementation.

Typedef Documentation

◆ vx_target_addkernel_f

typedef vx_kernel(* vx_target_addkernel_f) (vx_target target, const vx_char name[VX_MAX_KERNEL_NAME], vx_enum enumeration, vx_kernel_f func_ptr, vx_uint32 num_parameters, vx_kernel_validate_f validate, vx_kernel_input_validate_f input, vx_kernel_output_validate_f output, vx_kernel_initialize_f initialize, vx_kernel_deinitialize_f deinitialize)

#include <vx_internal.h>

Adds a kernel to a target.

Parameters
[in]targetThe target object.
[in]name
[in]enumeration
[in]func_ptr
[in]num_parameters
[in]validate
[in]input
[in]output
[in]initialize
[in]deinitialize

◆ vx_target_deinit_f

typedef vx_status(* vx_target_deinit_f) (vx_target target)

#include <vx_internal.h>

The function which deinitializes the target.

Parameters
[in]targetThe pointer to the target context.
Note
The target interface function must be exported as "vxTargetDeinit"

◆ vx_target_init_f

typedef vx_status(* vx_target_init_f) (vx_target target)

#include <vx_internal.h>

The function which initializes the target.

Parameters
[in]targetThe pointer to the target context.
Note
The target interface function must be exported as "vxTargetInit"

◆ vx_target_process_f

typedef vx_action(* vx_target_process_f) (vx_target target, vx_node nodes[], vx_size startIndex, vx_size numNodes)

#include <vx_internal.h>

Processes the array of nodes supplied.

Parameters
[in]targetThe pointer to the target context.
[in]nodesThe array of nodes pointers.
[in]startIndexThe beginning index to process
[in]numNodesThe number of nodes to process from startIndex.
Note
The target interface function must be exported as "vxTargetProcess"

◆ vx_target_supports_f

typedef vx_status(* vx_target_supports_f) (vx_target target, vx_char targetName[VX_MAX_TARGET_NAME], vx_char kernelName[VX_MAX_TARGET_NAME], vx_uint32 *pIndex)

#include <vx_internal.h>

Allows OpenVX to query a target to see if it supports an additional abstract target type like "khronos.automatic" or "khronos.low_power" on a specific kernel.

Parameters
[in]targetThe pointer to the target context.
[in]targetNameThe name of the abstract target.
[in]kernelNameThe name of the kernel.
[out]pIndexThe pointer to the index of the kernel in the target's list if the kernel is supported (the function will return VX_SUCCESS).
Note
The target interface function must be exported as "vxTargetSupports"
Returns
A vx_status_e enumeration
Return values
VX_SUCCESSThe kernel is supported and the pIndex has been set.
VX_ERROR_NOT_SUPPORTEDthe kernel is not supported as stated.

◆ vx_target_verify_f

typedef vx_status(* vx_target_verify_f) (vx_target target, vx_node node)

#include <vx_internal.h>

Verifies the array of nodes supplied for target specific information.

Parameters
[in]targetThe pointer to the target context.
[in]nodeThe node to verify.
Note
The target interface function must be exported as "vxTargetVerify"

Enumeration Type Documentation

◆ vx_target_priority_e

#include <vx_internal.h>

The priority list of targets.

Enumerator
VX_TARGET_PRIORITY_C_MODEL 

Defines the priority of the VENUM targets.

Defines the priority of the C model target

VX_TARGET_PRIORITY_ORT 

Defines the priority of the ORT target.

VX_TARGET_PRIORITY_MAX 

Defines the maximum priority.

Function Documentation

◆ deinitializeTarget()

vx_status coreflow::Target::deinitializeTarget ( )

#include <vx_target.h>

Deinitializes a target's kernels list.

◆ findKernelByEnum()

vx_kernel coreflow::Target::findKernelByEnum ( vx_enum enumeration)

#include <vx_target.h>

Find kernel belonging to this target module by enum.

Parameters
enumerationenum of kernel to search for
Returns
vx_kernel kernel found or nullptr

◆ findTargetIndex()

vx_uint32 coreflow::Target::findTargetIndex ( )

#include <vx_target.h>

Find target's index within context.

Returns
vx_uint32 index of target

◆ initializeTarget()

vx_status coreflow::Target::initializeTarget ( vx_kernel_description_t * kernels[],
vx_uint32 numkernels )

#include <vx_target.h>

Initializes a target's kernels list.

Parameters
[in]kernelsThe array of kernels that the target supports.
[in]numkernelsThe length of the kernels list.

◆ loadTarget()

vx_status coreflow::Context::loadTarget ( const vx_char * targetName)

#include <vx_context.h>

This allows the implementation to load a target interface into OpenVX.

Parameters
[in]targetNameThe shortened name of the target module.

◆ matchTargetNameWithString()

static vx_bool coreflow::Target::matchTargetNameWithString ( const vx_char * target_name,
const vx_char * target_string )
static

#include <vx_target.h>

Match target name with specified target string.

Parameters
[in]target_nameThe target name string.
[in]target_stringThe target string.
Return values
vx_true_eIf string matches, vx_false_e if not.

◆ printTarget()

static void coreflow::Target::printTarget ( vx_target target,
vx_uint32 index )
static

#include <vx_target.h>

Prints Target Information for Debugging.

◆ reverse_strstr()

static const vx_char * coreflow::Target::reverse_strstr ( const vx_char * string,
const vx_char * substr )
static

#include <vx_target.h>

Find the last occurrence of a substring in a string.

Parameters
stringThe string to search in.
substrThe substring to search for.
Returns
const char* Pointer to the last occurrence of the substring, or nullptr if not found.

◆ Target()

coreflow::Target::Target ( vx_context context,
vx_reference scope )

#include <vx_target.h>

Construct a new Target object.

Parameters
contextThe context associated with this obj
scopeThe parent ref of this obj

◆ unloadTarget() [1/2]

vx_status coreflow::Context::unloadTarget ( const vx_char * targetName)

#include <vx_context.h>

This unloads a specific target in the targets list.

Parameters
[in]targetNameThe string name of the target module.

◆ unloadTarget() [2/2]

vx_status coreflow::Context::unloadTarget ( vx_uint32 index,
vx_bool unload_module )

#include <vx_context.h>

This unloads a specific target in the targets list.

Parameters
[in]indexThe index into the context's target array.
[in]unload_moduleIf true, the module will be unloaded.

◆ ~Target()

coreflow::Target::~Target ( )
default

#include <vx_target.h>

Destroy the Target object.