trying to guess and fix strange failure in core test

This commit is contained in:
Vadim Pisarevsky 2013-12-01 22:14:15 +04:00
parent d7f4a223cf
commit f263fe145a

View File

@ -2719,17 +2719,17 @@ public:
cl_command_queue q = (cl_command_queue)Queue::getDefault().ptr();
clFinish(q);
UMatDataAutoLock lock(u);
if( u->hostCopyObsolete() && u->handle &&
u->tempCopiedUMat() && u->refcount > 0 && u->origdata)
{
UMatDataAutoLock lock(u);
clEnqueueReadBuffer(q, (cl_mem)u->handle, CL_TRUE, 0,
u->size, u->origdata, 0, 0, 0);
u->markHostCopyObsolete(false);
}
else if( u->copyOnMap() && u->deviceCopyObsolete() && u->data )
{
UMatDataAutoLock lock(u);
clEnqueueWriteBuffer(q, (cl_mem)u->handle, CL_TRUE, 0,
u->size, u->data, 0, 0, 0);
}