This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: c7x_kernel implementation

Part Number: TDA4VM


Hi Team,

Can you please help with the inquiry below?

A customer would like to know how to run a simple C7x code (ie array addition) using vision apps. How to change the files for executing a new c7x project using vision apps. What files were need to change & which portion of the code needs to be edited to execute a new c7x code in the same vision apps. Here I am attaching a small snippet of code for your reference.

 #include "c7x.h"

void addArrays(int16_t *pInA, int16_t *pInB, int16_t *pOutC, int32_t arraySize)
{
    int32_t ctr;
   
    for(ctr = 0; ctr < arraySize; ctr+=32)
    {

        short32 vInA = *stov_ptr(short32, (int16_t *)(pInA + ctr));        
   
        short32 vInB = *stov_ptr(short32, (int16_t *)(pInB + ctr));        

        short32 vOutC = vInA + vInB;                                      
   
        *stov_ptr(short32, (int16_t *)(pOutC + ctr)) = vOutC;            
    }
}

The customer is able to run the basic C7x sample codes provided and got the expected result as well. But would want to know what the changes need to do to run a simple code like array addition 

Let me know if you need more information.

Regards,

Marvin

  • Hello Marvin,

    We have a similar demo of adding two images on C7x in vision_apps in the current SDK.

    For this we are using a custom node "app_c7x_kernel_img_add_kernel_node".

    Please refer the implementation of this node in the folder vision_apps/apps/basic_demos/app_c7x_kernel and repeat the same for your usecase. (i.e., create a node around your add implementation)

    You could refer the below documentation for creation of a custom kernel.

    TIOVX User Guide: User Kernels and User Target Kernels

    Regards,
    Nikhil