SDAA422 June   2026 TDA4VE-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Understanding OpenVX Kernel Architecture
    1. 2.1 OpenVX Node Execution Flow
    2. 2.2 Host and Target Kernels
    3. 2.3 A72 Target Execution Model
  6. 3Creating a Custom Kernel Package
    1. 3.1 Package Structure
    2. 3.2 Defining the Kernel Interface
  7. 4Developing a Custom OpenVX Node for the A72 Core: A Threshold Example
    1. 4.1 Implementing the Host Kernel
    2. 4.2 Implementing the A72 Target Kernel
    3. 4.3 Accessing Image Buffers on the A72 Core
    4. 4.4 Implementing the Threshold Algorithm
    5. 4.5 Registering the Kernel Package
  8. 5Integrating the Custom Node into vision_apps
    1. 5.1 Implementing the app_custom_threshold Example
    2. 5.2 Example Execution Log
  9. 6Summary
  10. 7References

Implementing the A72 Target Kernel

While the Host Kernel defines the kernel interface, the Target Kernel implements the actual execution of the custom operation on the target core. For this example, the Target Kernel runs on the Arm Cortex-A72 core and is responsible for receiving the input and output object descriptors, accessing the image buffers, executing the threshold operation, and returning the processed result to the OpenVX framework.

The Target Kernel implementation is located in the following source file.

vision_apps/kernels/custom_threshold/a72/vx_custom_threshold_target.c

The Target Kernel consists of four primary callback functions.

• Register the Target Kernel with the TIOVX framework.

• Create any resources required before graph execution.

• Process each node execution.

• Delete resources when the graph is released.

The Target Kernel is registered by calling tivxAddTargetKernel(), which associates the custom kernel with its callback functions.

/* Register the Target Kernel on the A72 core */
vxAddTargetKernel( kernel_id, TIVX_TARGET_MPU_0,
        /* Create callback */
        tivxCustomThresholdCreate,
        /* Process callback */
        tivxCustomThresholdProcess,
        /* Delete callback */
        tivxCustomThresholdDelete,
        NULL, NULL);

The registration associates the custom kernel with the A72 execution target (TIVX_TARGET_MPU_0) and specifies the callback functions that will be invoked during the node lifecycle.

The Create callback is executed once after the graph has been successfully verified. It is typically used to allocate resources, initialize internal data structures, or prepare hardware resources required by the kernel. Since the threshold example performs only simple CPU-based image processing, no additional resources are required, and the callback performs minimal initialization.

The Process callback contains the application-specific image processing algorithm. During each graph execution, the OpenVX framework invokes this callback with the object descriptors corresponding to the node parameters. The callback converts the shared-memory addresses into CPU-accessible pointers, maps the image buffers into the A72 address space, performs the image processing, and finally unmaps the buffers before returning control to the framework.

The Delete callback is called when the graph is released. It is responsible for releasing any resources allocated by the Create callback. As no persistent resources are allocated in this example, the callback simply returns successfully.

The Process callback is the core of the Target Kernel implementation. The following sections describe how image buffers are accessed on the A72 core and how the threshold operation is implemented.