mirror of
https://github.com/opencv/opencv.git
synced 2026-07-28 23:03:03 +04:00
Enable stateful kernels in G-API OCV Backend
This commit is contained in:
@@ -800,6 +800,7 @@ void cv::gimpl::GStreamingExecutor::setSource(GRunArgs &&ins)
|
||||
}
|
||||
}
|
||||
};
|
||||
bool islandsRecompiled = false;
|
||||
const auto new_meta = cv::descr_of(ins); // 0
|
||||
if (gm.metadata().contains<OriginalInputMeta>()) // (1)
|
||||
{
|
||||
@@ -821,6 +822,8 @@ void cv::gimpl::GStreamingExecutor::setSource(GRunArgs &&ins)
|
||||
}
|
||||
update_int_metas(); // (7)
|
||||
m_reshapable = util::make_optional(is_reshapable);
|
||||
|
||||
islandsRecompiled = true;
|
||||
}
|
||||
else // (8)
|
||||
{
|
||||
@@ -929,7 +932,15 @@ void cv::gimpl::GStreamingExecutor::setSource(GRunArgs &&ins)
|
||||
for (auto &&out_eh : op.nh->outNodes()) {
|
||||
out_queues.push_back(reader_queues(*m_island_graph, out_eh));
|
||||
}
|
||||
op.isl_exec->handleNewStream();
|
||||
|
||||
// If Island Executable is recompiled, all its stuff including internal kernel states
|
||||
// are recreated and re-initialized automatically.
|
||||
// But if not, we should notify Island Executable about new started stream to let it update
|
||||
// its internal variables.
|
||||
if (!islandsRecompiled)
|
||||
{
|
||||
op.isl_exec->handleNewStream();
|
||||
}
|
||||
|
||||
m_threads.emplace_back(islandActorThread,
|
||||
op.in_objects,
|
||||
|
||||
Reference in New Issue
Block a user