工具与软件:
您好、我们已经尝试使用 tiovx 来实现2D 位块传输模块。 为了实现这个目标、
我们已经在 GitHub 存储库上引用了 edgeai-tiovx-apps 软件包的 multi_graph_test.c。 源代码的特定路径如下所示。
https://github.com/TexasInstruments/edgeai-tiovx-apps/blob/develop/tests/app_tiovx_linux_multi_graph_test.c
我们成功地获得了由4个图组成的代码的结果。 (颜色转换-多尺度-马赛克-颜色转换)为精确。
问题是、在源代码内、
这里有几条线
/*
* Note that in below loop graph on and 2 are running sequentially
* to run them in parellel, you need to decuple them by creating
* seperate threads for enqueue/dequeue of each graph
*/
for (int i = 0; i < APP_NUM_ITERATIONS; i++) {
它们是明确的。 因此、在我看来、为了实现最佳性能、
我们需要以某种方式对 它们解耦、并调用下面每个图形的单独线程中的队列/出队部分。
/*
* Note that in below loop graph on and 2 are running sequentially
* to run them in parellel, you need to decuple them by creating
* seperate threads for enqueue/dequeue of each graph
*/
for (int i = 0; i < APP_NUM_ITERATIONS; i++) {
//Graph1 Execution
inbuf1 = v4l2_decode_dqueue_buf(v4l2_decode_handle);
outbuf1 = tiovx_modules_acquire_buf(out_buf_pool1);
tiovx_modules_enqueue_buf(inbuf1);
tiovx_modules_enqueue_buf(outbuf1);
inbuf1 = tiovx_modules_dequeue_buf(in_buf_pool1);
outbuf1 = tiovx_modules_dequeue_buf(out_buf_pool1);
v4l2_decode_enqueue_buf(v4l2_decode_handle, inbuf1);
//Graph2 Execution
inbuf2 = tiovx_modules_acquire_buf(in_buf_pool2);
outbuf2 = tiovx_modules_acquire_buf(out_buf_pool2);
//Swap input2 mem with output1 to feed graph1 out to graph2
tiovx_modules_buf_swap_mem(outbuf1, inbuf2);
tiovx_modules_release_buf(outbuf1);
tiovx_modules_enqueue_buf(inbuf2);
tiovx_modules_enqueue_buf(outbuf2);
inbuf2 = tiovx_modules_dequeue_buf(in_buf_pool2);
outbuf2 = tiovx_modules_dequeue_buf(out_buf_pool2);
kms_display_render_buf(kms_display_handle, outbuf2);
tiovx_modules_release_buf(inbuf2);
tiovx_modules_release_buf(outbuf2);
}
这是一个问题。
1、"创建独立线程"到底意味着什么?
API 是否与 pthread 或 std :: thread 兼容/线程安全?
2. openvx 图应该总是用 vx_context 操作,不是吗? 嗯、如果是的话
创建几个不同的线程、以使每个图形的数据进入队列/退出队列、如何设置
我为它管理环境?
3.是否有任何示例/教程/示例代码可以参考以实现多线程
使用 tiovx 运行多图形的设置?
