fix2 for OpenCL on/off

This commit is contained in:
Ilya Lavrenov 2014-02-02 15:33:10 +04:00
parent 75dde49b64
commit 19f799ba1e

View File

@ -644,21 +644,23 @@ void UMat::copyTo(OutputArray _dst) const
srcofs[dims-1] *= esz;
_dst.create( dims, size.p, type() );
if( _dst.kind() == _InputArray::UMAT )
if( _dst.isUMat() )
{
UMat dst = _dst.getUMat();
if( u == dst.u && dst.offset == offset )
return;
dst.ndoffset(dstofs);
dstofs[dims-1] *= esz;
CV_Assert(u->currAllocator == dst.u->currAllocator);
u->currAllocator->copy(u, dst.u, dims, sz, srcofs, step.p, dstofs, dst.step.p, false);
}
else
{
Mat dst = _dst.getMat();
u->currAllocator->download(u, dst.data, dims, sz, srcofs, step.p, dst.step.p);
if (u->currAllocator == dst.u->currAllocator)
{
dst.ndoffset(dstofs);
dstofs[dims-1] *= esz;
u->currAllocator->copy(u, dst.u, dims, sz, srcofs, step.p, dstofs, dst.step.p, false);
return;
}
}
Mat dst = _dst.getMat();
u->currAllocator->download(u, dst.data, dims, sz, srcofs, step.p, dst.step.p);
}
void UMat::copyTo(OutputArray _dst, InputArray _mask) const