96 static void print_performance(
vx_perf_t performance, uint32_t numPixels,
const char* testName)
98 printf(
"[ %c%c ] Execution time for %9d pixels (avg = %4.6f ms, min = %4.6f ms, max = %4.6f ms)\n",
99 testName[0], testName[1],
101 performance.
avg/1000000.0,
102 performance.
min/1000000.0,
103 performance.
max/1000000.0
107 static void print_graph_pipeline_performance(
vx_graph graph,
108 vx_node nodes[], uint32_t num_nodes,
109 uint64_t exe_time, uint32_t loop_cnt, uint32_t numPixels)
114 uint64_t avg_exe_time;
116 avg_exe_time = exe_time / loop_cnt;
118 for(i=0; i<num_nodes; i++)
121 snprintf(ref_name, 8,
"N%d ", i);
122 print_performance(perf_ref, numPixels, ref_name);
125 printf(
"[ SYS ] Execution time (avg = %4d.%03d ms, sum = %4d.%03d ms, num = %d)\n",
126 (uint32_t)(avg_exe_time/1000u), (uint32_t)(avg_exe_time%1000u),
127 (uint32_t)(exe_time/1000u), (uint32_t)(exe_time%1000u),
138 #define MAX_NUM_BUF (2u) 152 vx_image in_img[MAX_NUM_BUF], tmp, out_img[MAX_NUM_BUF];
156 uint32_t width, height, num_buf, pipeline_depth, buf_id, loop_id, loop_cnt, exe_time;
159 printf(
" vx_tutorial_graph_pipeline_two_nodes: Tutorial Started !!! \n");
173 num_buf = MAX_NUM_BUF;
174 pipeline_depth = MAX_NUM_BUF;
175 loop_cnt = 10 - num_buf;
186 for(buf_id=0; buf_id<num_buf; buf_id++)
203 #if defined(SOC_AM62A) 217 add_graph_parameter_by_node_index(graph, n0, 0);
219 add_graph_parameter_by_node_index(graph, n1, 1);
247 graph_parameters_queue_params_list
285 for(buf_id=0; buf_id<num_buf; buf_id++)
301 for(loop_id=0; loop_id<(loop_cnt+num_buf); loop_id++)
317 buf_id = (buf_id+1)%num_buf;
336 print_graph_pipeline_performance(graph, nodes, 2, exe_time, loop_cnt+num_buf, width*height);
345 for(buf_id=0; buf_id<num_buf; buf_id++)
355 printf(
" vx_tutorial_graph_pipeline_two_nodes: Tutorial Done !!! \n");
struct _vx_image * vx_image
Schedule graph in queueing mode with auto scheduling.
vx_uint32 refs_list_size
Number of elements in array 'refs_list'.
vx_status VX_API_CALL vxAddParameterToGraph(vx_graph graph, vx_parameter parameter)
uint64_t tivxPlatformGetTimeInUsecs(void)
Get the time in micro seconds.
Interface to TI extension APIs.
vx_status VX_API_CALL tivxSetNodeParameterNumBufByIndex(vx_node node, vx_uint32 index, vx_uint32 num_buf)
Set number of buffers to allocate at output of a node parameter.
VX_API_ENTRY vx_status VX_API_CALL vxSetGraphScheduleConfig(vx_graph graph, vx_enum graph_schedule_mode, vx_uint32 graph_parameters_list_size, const vx_graph_parameter_queue_params_t graph_parameters_queue_params_list[])
Sets the graph scheduler config.
struct _vx_parameter * vx_parameter
vx_status VX_API_CALL vxReleaseContext(vx_context *context)
struct _vx_context * vx_context
VX_API_ENTRY vx_status VX_API_CALL vxGraphParameterDequeueDoneRef(vx_graph graph, vx_uint32 graph_parameter_index, vx_reference *refs, vx_uint32 max_refs, vx_uint32 *num_refs)
Dequeues 'consumed' references from a graph parameter.
VX_API_ENTRY vx_status VX_API_CALL vxGraphParameterEnqueueReadyRef(vx_graph graph, vx_uint32 graph_parameter_index, vx_reference *refs, vx_uint32 num_refs)
Enqueues new references into a graph parameter for processing.
vx_status VX_API_CALL vxSetNodeTarget(vx_node node, vx_enum target_enum, const char *target_string)
struct _vx_reference * vx_reference
The OpenVX Pipelining, Streaming and Batch Processing extension API.
#define TIVX_TARGET_DSP2
Name for DSP target class, instance 2.
vx_status VX_API_CALL tivxSetGraphPipelineDepth(vx_graph graph, vx_uint32 pipeline_depth)
Indicates to the implementation the depth of the graph pipeline.
vx_reference * refs_list
Array of references that could be enqueued at a later point of time at this graph parameter...
vx_image VX_API_CALL vxCreateImage(vx_context context, vx_uint32 width, vx_uint32 height, vx_df_image color)
vx_status VX_API_CALL vxWaitGraph(vx_graph graph)
#define TIVX_TARGET_DSP1
Name for DSP target class, instance 1.
vx_status VX_API_CALL vxReleaseGraph(vx_graph *graph)
vx_node VX_API_CALL vxNotNode(vx_graph graph, vx_image input, vx_image output)
vx_parameter VX_API_CALL vxGetParameterByIndex(vx_node node, vx_uint32 index)
vx_status VX_API_CALL vxQueryNode(vx_node node, vx_enum attribute, void *ptr, vx_size size)
Queueing parameters for a specific graph parameter.
vx_graph VX_API_CALL vxCreateGraph(vx_context context)
vx_status VX_API_CALL vxVerifyGraph(vx_graph graph)
vx_context VX_API_CALL vxCreateContext()
uint32_t graph_parameter_index
Index of graph parameter to which these properties apply.
vx_status VX_API_CALL vxReleaseParameter(vx_parameter *param)
struct _vx_graph * vx_graph
vx_status VX_API_CALL tivxExportGraphToDot(vx_graph graph, const char *output_file_path, const char *output_file_prefix)
Export graph representation as DOT graph file.
vx_status VX_API_CALL vxReleaseNode(vx_node *node)
struct _vx_node * vx_node
vx_status VX_API_CALL vxReleaseImage(vx_image *image)
void vx_tutorial_graph_pipeline_two_nodes()
Tutorial Entry Point.