1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge pull request #19112 from rgarnov:rg/generic_copy_kernel

Generic copy kernel

* Moved RMat wrapping of cv::Mats to StreamingInput

* Generalized GCopy kernel

* Generic GCopy kernel: applied review comments
This commit is contained in:
Ruslan Garnov
2020-12-16 14:18:08 +03:00
committed by GitHub
parent 50baf76cc2
commit f7cab121fe
19 changed files with 161 additions and 180 deletions
+6 -2
View File
@@ -36,6 +36,7 @@
#include "executor/gstreamingexecutor.hpp"
#include "backends/common/gbackend.hpp"
#include "backends/common/gmetabackend.hpp"
#include "backends/streaming/gstreamingbackend.hpp"
// <FIXME:>
#if !defined(GAPI_STANDALONE)
@@ -60,8 +61,11 @@ namespace
for (const auto &b : pkg.backends()) {
aux_pkg = combine(aux_pkg, b.priv().auxiliaryKernels());
}
// Always include built-in meta<> implementation
return combine(pkg, aux_pkg, cv::gimpl::meta::kernels());
// Always include built-in meta<> and copy implementation
return combine(pkg,
aux_pkg,
cv::gimpl::meta::kernels(),
cv::gimpl::streaming::kernels());
};
auto has_use_only = cv::gapi::getCompileArg<cv::gapi::use_only>(args);
+1 -17
View File
@@ -18,7 +18,6 @@
#include "compiler/gmodel.hpp"
#include "compiler/gislandmodel.hpp"
#include "compiler/gmodel.hpp"
#include "backends/common/gbackend.hpp" // RMatAdapter
#include "logger.hpp" // GAPI_LOG
@@ -357,22 +356,7 @@ void GIslandExecutable::run(GIslandExecutable::IInput &in, GIslandExecutable::IO
for (auto &&it: ade::util::zip(ade::util::toRange(in_desc),
ade::util::toRange(in_vector)))
{
const cv::GRunArg& in_data_orig = std::get<1>(it);
cv::GRunArg in_data;
switch (in_data_orig.index())
{
case cv::GRunArg::index_of<cv::Mat>():
// FIXME: This whole construct is ugly, from
// its writing to a need in this in general
in_data = cv::GRunArg{ cv::make_rmat<cv::gimpl::RMatAdapter>(cv::util::get<cv::Mat>(in_data_orig))
, in_data_orig.meta
};
break;
default:
in_data = in_data_orig;
break;
}
in_objs.emplace_back(std::get<0>(it), std::move(in_data));
in_objs.emplace_back(std::get<0>(it), std::get<1>(it));
}
for (auto &&it: ade::util::indexed(ade::util::toRange(out_desc)))
{