Skip to content

Commit 7809c41

Browse files
committed
core(ocl): workaround CL_OUT_OF_RESOURCES error
Flush deallocation queue before calling map/unmap
1 parent fd1eb63 commit 7809c41

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/core/src/ocl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3613,11 +3613,12 @@ class OpenCLAllocator : public MatAllocator
36133613
if (u->tempUMat())
36143614
{
36153615
CV_Assert(u->mapcount == 0);
3616+
flushCleanupQueue(); // workaround for CL_OUT_OF_RESOURCES problem (#9960)
36163617
void* data = clEnqueueMapBuffer(q, (cl_mem)u->handle, CL_TRUE,
36173618
(CL_MAP_READ | CL_MAP_WRITE),
36183619
0, u->size, 0, 0, 0, &retval);
3620+
CV_Assert(retval == CL_SUCCESS);
36193621
CV_Assert(u->origdata == data);
3620-
CV_OclDbgAssert(retval == CL_SUCCESS);
36213622
if (u->originalUMatData)
36223623
{
36233624
CV_Assert(u->originalUMatData->data == data);

0 commit comments

Comments
 (0)