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: How to create OpenVX UserKernel out of a custom function

Part Number: TDA4VM

Hi all,

I'm very new to OpenVX and I've been trying to figure out how to create a User Kernel out of my function with very little success. It gets a pointer to an inout struct as a parameter, it does some pixel-wise multiplication on 4 images and accumulates them into a final image at the end. This is supposed to be the preprocess in a pipeline, running on a selected processing element, right before NN execution.

My current understanding is that I would need to create a graph node, and in order for that node I would need to create a User Kernel out of this function somehow. What I'm missing is that where and how exactly should I pass my function to the User Kernel that I create, to ensure that it gets executed.

The examples I've looked at are very similar to this one:

kernel = vxAddUserKernel(
                                        context,
                                        TIVX_KERNEL_IMG_MOSAIC_NAME,
                                        kernel_id,
                                        NULL,
                                        num_params,
                                        tivxAddKernelImgMosaicValidate,
                                        NULL,
                                        NULL);

Part of my confusion is that the 4th param is supposed to be the function_ptr, which is set to NULL. I've been trying to figure out how this is supposed to work with no luck so far. Is there anyone who could enlighten me?

Kind regards,
Bence