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