• OpenVX 源码分析-- 图的执行(TI / Sample)


    TI openVX

    Graph的执行

    Created with Raphaël 2.3.0 开始 ownGraphScheduleGraphWrapper()vx_graph.c ownGraphScheduleGraph()vx_graph_pipeline.c 循环放叶子任务:ownNodeKernelSchedule()->tivxObjDescSend() ->tivxTargetQueueObjDesc() 循环取任务:tivxTargetTaskMain->tivxTargetDequeueObjDesc->tivxQueueGet() vx_target.c 执行任务:tivxTargetTaskMain->tivxTargetNodeDescNodeExecute() 结束

    关键源代码:
    vx_graph_pipeline.c

    ownGraphScheduleGraph()
    
                /* trigger graph execution by scheduling the head nodes
                 * Head nodes will trigger further nodes execution after
                 * their completion
                 * This will continue until leaf nodes executes
                 * After a leaf node executes, it will send a completion
                 * event.
                 * After all completion events are received, a graph is
                 * considered to have
                 * executed
                 */
                for(node_id=0; node_idnum_head_nodes; node_id++)
                {
                    ownNodeKernelSchedule(graph->head_nodes[node_id], graph_obj_desc->pipeline_id);
                }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16

    vx_target.c

        while(target->targetExitRequest == (vx_bool)vx_false_e)
       {
               status = tivxTargetDequeueObjDesc(target,
                       &obj_desc_id, TIVX_EVENT_TIMEOUT_WAIT_FOREVER);
                   switch(obj_desc->type)
                   {
                       case (vx_enum)TIVX_OBJ_DESC_CMD:
                           if( tivxObjDescIsValidType( obj_desc, TIVX_OBJ_DESC_CMD) != 0)
                           {
                               tivxTargetCmdDescHandler((tivx_obj_desc_cmd_t*)obj_desc);
                           }
                           break;
                       case (vx_enum)TIVX_OBJ_DESC_NODE:
                           if( tivxObjDescIsValidType( obj_desc, TIVX_OBJ_DESC_NODE) != 0)
                           {
                               tivxTargetNodeDescNodeExecute(target, (tivx_obj_desc_node_t*)obj_desc);
                           }
                           break;
                       default:
                           /* unsupported obj_desc received at target */
                           break;
                   }
       }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23

    Node 的执行 ownNodeUserKernelExecute

    Created with Raphaël 2.3.0 开始 tivxTargetTaskMain tivxTargetNodeDescNodeExecute tivxTargetNodeDescNodeExecuteUserKernel ownNodeUserKernelExecute node->kernel->function 结束

    Node Exe源代码

    ownNodeUserKernelExecute()
    
    vx_reference params[TIVX_KERNEL_MAX_PARAMS];	//TIVX_KERNEL_MAX_PARAMS:64
    vx_reference parent_ref[TIVX_KERNEL_MAX_PARAMS];
    status = node->kernel->function(node, prm_ref, num_params);
    
    • 1
    • 2
    • 3
    • 4
    • 5

    解读:
    Node 的执行参数是 最大64个,必须是固定格式的(vx_type_e中的一个)。

  • 相关阅读:
    因为axios请求后端,接收不到token的问引出的问题
    单元测试中如何Mock HttpContext
    uni-app小程序开发使用uView,u-model传入富文本内容过长,真机上无法滚动
    介绍下官网Redis编程模式
    人群聚集逻辑
    异步时钟无毛刺切换的波形演示
    【电路笔记】-串联RLC电路分析
    vsto word属性信息 并读取
    自己动手从零写桌面操作系统GrapeOS系列教程——24.加载并运行loader
    Springboot微服务之zookeeper注册中心
  • 原文地址:https://blog.csdn.net/zengyubao1/article/details/126695854