Commit 7809c415 authored by Alexander Alekhin's avatar Alexander Alekhin

core(ocl): workaround CL_OUT_OF_RESOURCES error

Flush deallocation queue before calling map/unmap
parent fd1eb63f
...@@ -3613,11 +3613,12 @@ public: ...@@ -3613,11 +3613,12 @@ public:
if (u->tempUMat()) if (u->tempUMat())
{ {
CV_Assert(u->mapcount == 0); CV_Assert(u->mapcount == 0);
flushCleanupQueue(); // workaround for CL_OUT_OF_RESOURCES problem (#9960)
void* data = clEnqueueMapBuffer(q, (cl_mem)u->handle, CL_TRUE, void* data = clEnqueueMapBuffer(q, (cl_mem)u->handle, CL_TRUE,
(CL_MAP_READ | CL_MAP_WRITE), (CL_MAP_READ | CL_MAP_WRITE),
0, u->size, 0, 0, 0, &retval); 0, u->size, 0, 0, 0, &retval);
CV_Assert(retval == CL_SUCCESS);
CV_Assert(u->origdata == data); CV_Assert(u->origdata == data);
CV_OclDbgAssert(retval == CL_SUCCESS);
if (u->originalUMatData) if (u->originalUMatData)
{ {
CV_Assert(u->originalUMatData->data == data); CV_Assert(u->originalUMatData->data == data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment