Merge pull request #20572 from TolyaTalamanov:at/check-adapter-in-executor

This commit is contained in:
Alexander Alekhin 2021-08-20 07:41:21 +00:00
commit bb5f33d13c

View File

@ -159,8 +159,8 @@ void writeBackExec(const Mag& mag, const RcDesc &rc, GRunArgP &g_arg)
// a real copy (add a pass to StreamingBackend?)
auto& out_mat = *util::get<cv::Mat*>(g_arg);
const auto& rmat = mag.template slot<cv::RMat>().at(rc.id);
auto mag_data = rmat.get<RMatAdapter>()->data();
if (out_mat.data != mag_data) {
auto* adapter = rmat.get<RMatAdapter>();
if (adapter != nullptr && out_mat.data != adapter->data()) {
auto view = rmat.access(RMat::Access::R);
asMat(view).copyTo(out_mat);
}