Merge pull request #2257 from ilya-lavrenov:tapi_opencl_game2

This commit is contained in:
Andrey Pavlenko 2014-02-03 14:26:05 +04:00 committed by OpenCV Buildbot
commit 13875b5fbc

View File

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