mirror of
https://github.com/opencv/opencv.git
synced 2024-11-28 05:06:29 +08:00
Fix GExecutor WriteBackExec
This commit is contained in:
parent
bb5f33d13c
commit
aa5c4945d6
@ -157,10 +157,14 @@ 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
|
||||
// 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>();
|
||||
if (adapter != nullptr && out_mat.data != adapter->data()) {
|
||||
if ((adapter != nullptr && out_mat.data != adapter->data()) ||
|
||||
(adapter == nullptr)) {
|
||||
auto view = rmat.access(RMat::Access::R);
|
||||
asMat(view).copyTo(out_mat);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user