Merge pull request #5176 from vladimir-dudnik:master

pull/5212/head
Alexander Alekhin 10 years ago
commit 5ee00ec5c6
  1. 17
      modules/core/src/ocl.cpp

@ -4572,13 +4572,16 @@ public:
else
{
// CL_MEM_USE_HOST_PTR (nothing is required) and OTHER cases
cl_int retval = 0;
void* data = clEnqueueMapBuffer(q, (cl_mem)u->handle, CL_TRUE,
(CL_MAP_READ | CL_MAP_WRITE),
0, u->size, 0, 0, 0, &retval);
CV_OclDbgAssert(retval == CL_SUCCESS);
CV_OclDbgAssert(clEnqueueUnmapMemObject(q, (cl_mem)u->handle, data, 0, 0, 0) == CL_SUCCESS);
CV_OclDbgAssert(clFinish(q) == CL_SUCCESS);
if (u->flags & UMatData::USER_ALLOCATED)
{
cl_int retval = 0;
void* data = clEnqueueMapBuffer(q, (cl_mem)u->handle, CL_TRUE,
(CL_MAP_READ | CL_MAP_WRITE),
0, u->size, 0, 0, 0, &retval);
CV_OclDbgAssert(retval == CL_SUCCESS);
CV_OclDbgAssert(clEnqueueUnmapMemObject(q, (cl_mem)u->handle, data, 0, 0, 0) == CL_SUCCESS);
CV_OclDbgAssert(clFinish(q) == CL_SUCCESS);
}
}
}
u->markHostCopyObsolete(false);

Loading…
Cancel
Save