mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
Merge pull request #20705 from TolyaTalamanov:at/handle-reshape-in-gexecutor
G-API: Handle reshape for generic case in GExecutor * Handle reshape for generic case for GExecutor * Add initResources * Add tests * Refactor reshape method
This commit is contained in:
committed by
GitHub
parent
54386c82fd
commit
499d8adb75
@@ -7,8 +7,6 @@
|
||||
|
||||
#include "precomp.hpp"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <ade/util/zip_range.hpp>
|
||||
|
||||
#include <opencv2/gapi/opencv_includes.hpp>
|
||||
@@ -411,7 +409,8 @@ bool cv::gimpl::GExecutor::canReshape() const
|
||||
{
|
||||
// FIXME: Introduce proper reshaping support on GExecutor level
|
||||
// for all cases!
|
||||
return (m_ops.size() == 1) && m_ops[0].isl_exec->canReshape();
|
||||
return std::all_of(m_ops.begin(), m_ops.end(),
|
||||
[](const OpDesc& op) { return op.isl_exec->canReshape(); });
|
||||
}
|
||||
|
||||
void cv::gimpl::GExecutor::reshape(const GMetaArgs& inMetas, const GCompileArgs& args)
|
||||
@@ -421,7 +420,17 @@ void cv::gimpl::GExecutor::reshape(const GMetaArgs& inMetas, const GCompileArgs&
|
||||
ade::passes::PassContext ctx{g};
|
||||
passes::initMeta(ctx, inMetas);
|
||||
passes::inferMeta(ctx, true);
|
||||
m_ops[0].isl_exec->reshape(g, args);
|
||||
|
||||
// NB: Before reshape islands need to re-init resources for every slot.
|
||||
for (auto slot : m_slots)
|
||||
{
|
||||
initResource(slot.slot_nh, slot.data_nh);
|
||||
}
|
||||
|
||||
for (auto& op : m_ops)
|
||||
{
|
||||
op.isl_exec->reshape(g, args);
|
||||
}
|
||||
}
|
||||
|
||||
void cv::gimpl::GExecutor::prepareForNewStream()
|
||||
|
||||
Reference in New Issue
Block a user