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: OpenVX node processing failed when using more than 32 input/output objects

Part Number: TDA4VM


Hi TI.

In tiovx in psdk 7.1, one node seems to be capable of up to 64 input/output parameters.

#ifndef TIVX_CONFIG_H_
#define TIVX_CONFIG_H_

#ifdef __cplusplus
extern "C" {
#endif

/*! \brief Max parameters in a kernel
 * \ingroup group_tivx_obj_desc_cfg
 */
#define TIVX_KERNEL_MAX_PARAMS      (64u)

However, if more than 32 inputs and outputs were used, a null value obj_desc was entered into the process function of vx_xx_target.c, and the node did not operate normally.

i found that the problem occurs in the part that handles the bit-flag (tivxFlagIsBitSet()) when "prm_id" is 32 or higher.

void tivxTargetNodeDescAcquireAllParameters(tivx_obj_desc_node_t *node_obj_desc,
            uint16_t prm_obj_desc_id[], vx_bool *is_node_blocked)
{
    uint32_t prm_id;
    vx_bool is_prm_data_ref_q_flag;

    *is_node_blocked = (vx_bool)vx_false_e;

    is_prm_data_ref_q_flag = (int32_t)node_obj_desc->is_prm_data_ref_q;

    for(prm_id=0; prm_id<node_obj_desc->num_params; prm_id++)
    {
        if(tivxFlagIsBitSet((uint32_t)is_prm_data_ref_q_flag, ((uint32_t)1U<<prm_id))==(vx_bool)vx_false_e)
        {
            prm_obj_desc_id[prm_id] = node_obj_desc->data_id[prm_id];
        }

I've been trying to find a solution in psdk 7.3. But I couldn't.

I temporarily modified it like this, but I'm not sure if it works well.

static inline vx_bool tivxFlagIsBitSetById(uint32_t flag_var, uint32_t bit_idx)
{
    vx_bool status = vx_false_e;
    if(bit_idx > 31) 
    {
        status = vx_false_e;
    }
    else 
    {
        uint32_t flag_val = 1U << bit_idx;
        status = ((flag_var & flag_val) == flag_val) ? vx_true_e : vx_false_e;
    }
    return status;
}

I hope you can check and fix this issue.

  • Hello,

    There are a few other config values in the include/TI/tivx_config.h file which will need to change in order to support this.  You would also need to increase the value of TIVX_GRAPH_MAX_NODES which is currently set at 32.  Also, based on your particular graph, you may need to update this to allow for different max values of other data objects, etc.

    Please try updating these values and see if there are further issues.

    Regards,

    Lucas

  • Hi Lucas.

    thanks for answer.

    but I don't understand how TIVX_GRAPH_MAX_NODES affects the number of I/O parameter objects on a node.
    The definition seems to only affect "Max possible nodes in graph" as mentioned in the header file.

    How does "TIVX_GRAPH_MAX_NODES" affect "number of I/O parameter objects on a node"?

    Regards,

  • Hello,

    Sorry, I misunderstood the question when reading it the first time.  Let me review the code in detail and provide an answer.

    Regards,

    Lucas

  • Hello,

    I have reviewed this further with our team and understand the issue.  In order to support greater than 32 items, it will require significant framework changes.  Since this is a rare occurrence from our perspective, we are not planning on immediately updating this.

    Therefore, in order to support this on your end, could you please provide information about the data objects that are used as the interface to your OpenVX node?  There could be potential for optimizing the number of data objects through use of the vx_user_data_object.

    Regards,

    Lucas

  • Hi Lucas.

    In this case, I tested my TIDL RT application with 30 outputs vx_tensor.

    The final application has at least 2 TIDL nodes connected to the post processing node. I expect there will be more than 50 vx_tensor objects in the post processing node.

    In my patch, I was wondering if the node works fine in pipeline mode.

    Regards.

  • Hello,

    Sorry for the delay here.  I am consulting with our team to determine our suggestion.

    Regards,

    Lucas

  • Hello Lucas,

    Is there any updates on this?

    Regards.

  • Hello,

    I have made some changes in the attached patch on top of 7.3 which should fix the issue.  However, I have not yet been able to validate this since we do not have an app with >32 kernel parameters.  Please let me know if this fixes your issue.

    Regards,

    Lucas

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/0001_2D00_FRAMEWORK_2D00_Support_2D00_for_2D00_up_2D00_to_2D00_64_2D00_kernel_2D00_parameters.patch

  • Hi Lucas

    thanks for patch.
    we will test with this.

    Regards.