|
|
|
@ -100,7 +100,7 @@ void bindInArgExec(Mag& mag, const RcDesc &rc, const GRunArg &arg) |
|
|
|
|
switch (arg.index()) |
|
|
|
|
{ |
|
|
|
|
case GRunArg::index_of<Mat>() : |
|
|
|
|
mag_rmat = make_rmat<RMatAdapter>(util::get<Mat>(arg)); break; |
|
|
|
|
mag_rmat = make_rmat<RMatOnMat>(util::get<Mat>(arg)); break; |
|
|
|
|
case GRunArg::index_of<cv::RMat>() : |
|
|
|
|
mag_rmat = util::get<cv::RMat>(arg); break; |
|
|
|
|
default: util::throw_error(std::logic_error("content type of the runtime argument does not match to resource description ?")); |
|
|
|
@ -121,7 +121,7 @@ void bindOutArgExec(Mag& mag, const RcDesc &rc, const GRunArgP &arg) |
|
|
|
|
switch (arg.index()) |
|
|
|
|
{ |
|
|
|
|
case GRunArgP::index_of<Mat*>() : |
|
|
|
|
mag_rmat = make_rmat<RMatAdapter>(*util::get<Mat*>(arg)); break; |
|
|
|
|
mag_rmat = make_rmat<RMatOnMat>(*util::get<Mat*>(arg)); break; |
|
|
|
|
case GRunArgP::index_of<cv::RMat*>() : |
|
|
|
|
mag_rmat = *util::get<cv::RMat*>(arg); break; |
|
|
|
|
default: util::throw_error(std::logic_error("content type of the runtime argument does not match to resource description ?")); |
|
|
|
@ -155,12 +155,11 @@ void writeBackExec(const Mag& mag, const RcDesc &rc, GRunArgP &g_arg) |
|
|
|
|
// FIXME:
|
|
|
|
|
// Rework, find a better way to check if there should be
|
|
|
|
|
// a real copy (add a pass to StreamingBackend?)
|
|
|
|
|
// NB: In case RMat adapter not equal to "RMatAdapter" need to
|
|
|
|
|
// NB: In case RMat adapter not equal to "RMatOnMat" need to
|
|
|
|
|
// copy data back to the host as well.
|
|
|
|
|
// FIXME: Rename "RMatAdapter" to "OpenCVAdapter".
|
|
|
|
|
auto& out_mat = *util::get<cv::Mat*>(g_arg); |
|
|
|
|
const auto& rmat = mag.template slot<cv::RMat>().at(rc.id); |
|
|
|
|
auto* adapter = rmat.get<RMatAdapter>(); |
|
|
|
|
auto* adapter = rmat.get<RMatOnMat>(); |
|
|
|
|
if ((adapter != nullptr && out_mat.data != adapter->data()) || |
|
|
|
|
(adapter == nullptr)) { |
|
|
|
|
auto view = rmat.access(RMat::Access::R); |
|
|
|
@ -221,7 +220,7 @@ void cv::gimpl::GExecutor::initResource(const ade::NodeHandle & nh, const ade::N |
|
|
|
|
} else { |
|
|
|
|
Mat mat; |
|
|
|
|
createMat(desc, mat); |
|
|
|
|
rmat = make_rmat<RMatAdapter>(mat); |
|
|
|
|
rmat = make_rmat<RMatOnMat>(mat); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|