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

The internal Kernel API. More...

Namespaces

namespace  coreflow
 The internal representation of a vx_array.
 

Classes

struct  vx_signature_t
 The internal representation of the attributes associated with a run-time parameter. More...
 
struct  vx_kernel_attr_t
 The kernel attributes structure. More...
 
struct  coreflow::Kernel::Param
 The parameter of the kernel. More...
 

Functions

 coreflow::Kernel::Kernel (vx_context context, vx_reference scope)
 Construct a new Kernel object.
 
 coreflow::Kernel::Kernel (vx_context context, vx_enum kenum, vx_kernel_f function, vx_char name[VX_MAX_KERNEL_NAME], vx_param_description_t *parameters, vx_uint32 numParams, vx_reference scope)
 Construct a new Kernel object.
 
 coreflow::Kernel::~Kernel ()=default
 Destroy the Kernel object.
 
static vx_kernel coreflow::Kernel::registerCustomKernel (vx_context context, std::string name, const std::vector< Kernel::Param > &params, vx_kernel_f function, vx_kernel_validate_f validate=nullptr, vx_kernel_initialize_f initialize=nullptr, vx_kernel_deinitialize_f deinitialize=nullptr)
 Register a custom kernel.
 
vx_uint32 coreflow::Kernel::numParameters () const
 Get the number of kernel parameters.
 
const vx_charcoreflow::Kernel::kernelName () const
 Get the kernel name.
 
vx_enum coreflow::Kernel::kernelEnum () const
 Get the kernel enuemration.
 
vx_size coreflow::Kernel::localDataSize () const
 Get the local data size.
 
vx_uint32 coreflow::Kernel::pipeupInputDepth () const
 Get the pipeup input depth.
 
vx_uint32 coreflow::Kernel::pipeupOutputDepth () const
 Get the pipeup output depth.
 
void coreflow::Kernel::setLocalDataSize (vx_size size)
 Set the local data size.
 
void coreflow::Kernel::setInputDepth (vx_uint32 depth)
 Set the pipeup input depth.
 
void coreflow::Kernel::setOutputDepth (vx_uint32 depth)
 Set the pipeup output depth.
 
static vx_bool coreflow::Kernel::isKernelUnique (vx_kernel kernel)
 Determines if a kernel is unique in the system.
 
vx_status coreflow::Kernel::initializeKernel (vx_enum kenum, vx_kernel_f function, vx_char name[VX_MAX_KERNEL_NAME], vx_param_description_t *parameters, vx_uint32 numParams, vx_kernel_validate_f validator, vx_kernel_input_validate_f input_validator, vx_kernel_output_validate_f output_validator, vx_kernel_initialize_f initialize, vx_kernel_deinitialize_f deinitialize)
 Used to initialize a kernel object in a target kernel list.
 
static vx_kernel coreflow::Kernel::addkernel (vx_context context, const vx_char name[VX_MAX_KERNEL_NAME], vx_enum enumeration, vx_kernel_f func_ptr, vx_uint32 numParams, 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, vx_bool valid_rect_reset)
 Add Kernel.
 
vx_status coreflow::Kernel::finalize ()
 This API is called after all parameters have been added to the kernel and the kernel is ready to be used. Notice that the reference to the kernel created by addKernel is still valid after the call to finalize. If an error occurs, the kernel is not available for usage by the clients of the framework. Typically this is due to a mismatch between the number of parameters requested and given.
 
vx_status coreflow::Kernel::addParameter (vx_uint32 index, vx_enum dir, vx_enum data_type, vx_enum state)
 Allows users to set the signatures of the custom kernel.
 
static vx_status coreflow::Kernel::removeKernel (vx_kernel kernel)
 Removes a custom kernel from its context and releases it.
 
static vx_status coreflow::Kernel::loadKernels (vx_context context, const vx_char *name)
 Loads a library of kernels, called module, into the context.
 
static vx_status coreflow::Kernel::unloadKernels (vx_context context, const vx_char *name)
 Unloads all kernels from the context that had been loaded from the module using the loadKernels function.
 
static vx_kernel coreflow::Kernel::getKernelByName (vx_context context, const vx_char string[VX_MAX_KERNEL_NAME])
 Get the Kernel By Name.
 
static vx_kernel coreflow::Kernel::getKernelByEnum (vx_context context, vx_enum kernelenum)
 Get the Kernel By Enum.
 
vx_status coreflow::Kernel::deinitializeKernel ()
 Used to deinitialize a kernel object in a target kernel list.
 
static void coreflow::Kernel::printKernel (vx_kernel kernel)
 Print kernel object.
 

Detailed Description

The internal Kernel API.

Function Documentation

◆ addkernel()

static vx_kernel coreflow::Kernel::addkernel ( vx_context context,
const vx_char name[VX_MAX_KERNEL_NAME],
vx_enum enumeration,
vx_kernel_f func_ptr,
vx_uint32 numParams,
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,
vx_bool valid_rect_reset )
static

#include <vx_kernel.h>

Add Kernel.

Parameters
contextThe global context
nameThe kernel name value.
enumerationThe kernel enumeration value.
func_ptrThe pointer to the function of the kernel.
numParamsThe number of parameters in the kernel.
validateThe function pointer to the params validator.
inputThe function pointer to the input validator.
outputThe function pointer to the output validator.
initializeThe function to call to initialize the kernel.
deinitializeThe function to call to deinitialize the kernel.
valid_rect_resetThe bool to reset the valid rect or not.
Returns
vx_kernel

◆ addParameter()

vx_status coreflow::Kernel::addParameter ( vx_uint32 index,
vx_enum dir,
vx_enum data_type,
vx_enum state )

#include <vx_kernel.h>

Allows users to set the signatures of the custom kernel.

Parameters
[in]indexThe index of the parameter to add.
[in]dirThe direction of the parameter. This must be either VX_INPUT or VX_OUTPUT.
[in]data_typeThe type of parameter. This must be a value from vx_type_e.
[in]stateThe state of the parameter (required or not). This must be a value from vx_parameter_state_e.
Returns
vx_status VX_SUCCESS if successful, any other value indicates failure.

◆ deinitializeKernel()

vx_status coreflow::Kernel::deinitializeKernel ( )

#include <vx_kernel.h>

Used to deinitialize a kernel object in a target kernel list.

Returns
vx_status VX_SUCCESS if successful, any other value indicates failure.

◆ finalize()

vx_status coreflow::Kernel::finalize ( )

#include <vx_kernel.h>

This API is called after all parameters have been added to the kernel and the kernel is ready to be used. Notice that the reference to the kernel created by addKernel is still valid after the call to finalize. If an error occurs, the kernel is not available for usage by the clients of the framework. Typically this is due to a mismatch between the number of parameters requested and given.

Returns
vx_status VX_SUCCESS if successful, any other value indicates failure.

◆ getKernelByEnum()

static vx_kernel coreflow::Kernel::getKernelByEnum ( vx_context context,
vx_enum kernelenum )
static

#include <vx_kernel.h>

Get the Kernel By Enum.

Parameters
contextThe reference to the implementation context.
kernelenumA value from a vendor or client-defined value.
Returns
vx_kernel A vx_kernel reference. Any possible errors preventing a successful completion of the function should be checked using Error::getStatus.

◆ getKernelByName()

static vx_kernel coreflow::Kernel::getKernelByName ( vx_context context,
const vx_char string[VX_MAX_KERNEL_NAME] )
static

#include <vx_kernel.h>

Get the Kernel By Name.

Parameters
[in]contextThe reference to the implementation context.
[in]stringThe string of the name of the kernel to get.
Returns
vx_kernel A vx_kernel reference. Any possible errors preventing a successful completion of the function should be checked using Error::getStatus.

◆ initializeKernel()

vx_status coreflow::Kernel::initializeKernel ( vx_enum kenum,
vx_kernel_f function,
vx_char name[VX_MAX_KERNEL_NAME],
vx_param_description_t * parameters,
vx_uint32 numParams,
vx_kernel_validate_f validator,
vx_kernel_input_validate_f input_validator,
vx_kernel_output_validate_f output_validator,
vx_kernel_initialize_f initialize,
vx_kernel_deinitialize_f deinitialize )

#include <vx_kernel.h>

Used to initialize a kernel object in a target kernel list.

Parameters
[in]kenumThe kernel enumeration value.
[in]functionThe pointer to the function of the kernel.
[in]nameThe name of the kernel in dotted notation.
[in]parametersThe list of parameters for each kernel.
[in]numParamsThe number of parameters in the list.
[in]validatorThe function pointer to the params validator.
[in]input_validatorThe function pointer to the input validator.
[in]output_validatorThe function pointer to the output validator.
[in]initializeThe function to call to initialize the kernel.
[in]deinitializeThe function to call to deinitialize the kernel.

◆ isKernelUnique()

static vx_bool coreflow::Kernel::isKernelUnique ( vx_kernel kernel)
static

#include <vx_kernel.h>

Determines if a kernel is unique in the system.

Parameters
kernelThe handle to the kernel.

◆ Kernel() [1/2]

coreflow::Kernel::Kernel ( vx_context context,
vx_enum kenum,
vx_kernel_f function,
vx_char name[VX_MAX_KERNEL_NAME],
vx_param_description_t * parameters,
vx_uint32 numParams,
vx_reference scope )

#include <vx_kernel.h>

Construct a new Kernel object.

Parameters
context
kenum
function
name
parameters
numParams
scope

◆ Kernel() [2/2]

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

#include <vx_kernel.h>

Construct a new Kernel object.

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

◆ kernelEnum()

vx_enum coreflow::Kernel::kernelEnum ( ) const

#include <vx_kernel.h>

Get the kernel enuemration.

Returns
vx_enum The kernel enuemration.

◆ kernelName()

const vx_char * coreflow::Kernel::kernelName ( ) const

#include <vx_kernel.h>

Get the kernel name.

Returns
const vx_char* The kernel name.

◆ loadKernels()

static vx_status coreflow::Kernel::loadKernels ( vx_context context,
const vx_char * name )
static

#include <vx_kernel.h>

Loads a library of kernels, called module, into the context.

Note
When all references to loaded kernels are released, the module may be automatically unloaded.
Parameters
[in]contextThe reference to the context the kernels must be added to.
[in]nameThe short name of the module to load. On systems where there are specific naming conventions for modules, the name passed should ignore such conventions. For example: libxyz.so should be passed as just xyz and the implementation will do the right thing that the platform requires.
Returns
vx_status VX_SUCCESS if successful, any other value indicates failure.

◆ localDataSize()

vx_size coreflow::Kernel::localDataSize ( ) const

#include <vx_kernel.h>

Get the local data size.

Returns
vx_size The local data size.

◆ numParameters()

vx_uint32 coreflow::Kernel::numParameters ( ) const

#include <vx_kernel.h>

Get the number of kernel parameters.

Returns
vx_uint32 The number of kernel parameters.

◆ pipeupInputDepth()

vx_uint32 coreflow::Kernel::pipeupInputDepth ( ) const

#include <vx_kernel.h>

Get the pipeup input depth.

Returns
vx_uint32 The pipeup input depth.

◆ pipeupOutputDepth()

vx_uint32 coreflow::Kernel::pipeupOutputDepth ( ) const

#include <vx_kernel.h>

Get the pipeup output depth.

Returns
vx_uint32 The pipeup output depth.

◆ printKernel()

static void coreflow::Kernel::printKernel ( vx_kernel kernel)
static

#include <vx_kernel.h>

Print kernel object.

Parameters
kernel

◆ registerCustomKernel()

static vx_kernel coreflow::Kernel::registerCustomKernel ( vx_context context,
std::string name,
const std::vector< Kernel::Param > & params,
vx_kernel_f function,
vx_kernel_validate_f validate = nullptr,
vx_kernel_initialize_f initialize = nullptr,
vx_kernel_deinitialize_f deinitialize = nullptr )
static

#include <vx_kernel.h>

Register a custom kernel.

Parameters
contextThe context
nameThe name of the kernel
paramsThe parameters of the kernel
functionThe function of the kernel
validateThe validate function of the kernel
initializeThe initialize function of the kernel
deinitializeThe deinitialize function of the kernel
Returns
vx_kernel The kernel

◆ removeKernel()

static vx_status coreflow::Kernel::removeKernel ( vx_kernel kernel)
static

#include <vx_kernel.h>

Removes a custom kernel from its context and releases it.

Parameters
[in]kernelThe reference to the kernel to remove. Returned from addkernel.
Note
Any kernel enumerated in the base standard cannot be removed; only kernels added through vxAddUserKernel can be removed.
Returns
vx_status VX_SUCCESS if successful, any other value indicates failure.

◆ setInputDepth()

void coreflow::Kernel::setInputDepth ( vx_uint32 depth)

#include <vx_kernel.h>

Set the pipeup input depth.

Parameters
depthThe pipeup input depth.

◆ setLocalDataSize()

void coreflow::Kernel::setLocalDataSize ( vx_size size)

#include <vx_kernel.h>

Set the local data size.

Parameters
sizeThe local data size.

◆ setOutputDepth()

void coreflow::Kernel::setOutputDepth ( vx_uint32 depth)

#include <vx_kernel.h>

Set the pipeup output depth.

Parameters
depthThe pipeup output depth.

◆ unloadKernels()

static vx_status coreflow::Kernel::unloadKernels ( vx_context context,
const vx_char * name )
static

#include <vx_kernel.h>

Unloads all kernels from the context that had been loaded from the module using the loadKernels function.

Parameters
[in]contextThe reference to the context the kernels must be removed from.
[in]nameThe short name of the module to unload. On systems where there are specific naming conventions for modules, the name passed should ignore such conventions. For example: libxyz.so should be passed as just xyz and the implementation will do the right thing that the platform requires.
Note
This API uses the system pre-defined paths for modules.
Returns
vx_status VX_SUCCESS if successful, any other value indicates failure.

◆ ~Kernel()

coreflow::Kernel::~Kernel ( )
default

#include <vx_kernel.h>

Destroy the Kernel object.