From 579a7fff6d557d6af4ab5816dc3a098707aa3c33 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 24 Oct 2014 14:29:38 +0400 Subject: [PATCH] ocl: restore clFinish() in unmap() for AMD devices This reverts commit 7d91b8efcd053304e5b0fb5afff06e151b2d4096. --- modules/core/src/ocl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/core/src/ocl.cpp b/modules/core/src/ocl.cpp index c333b08..79a5367 100644 --- a/modules/core/src/ocl.cpp +++ b/modules/core/src/ocl.cpp @@ -3979,6 +3979,11 @@ public: u->markDeviceMemMapped(false); CV_Assert( (retval = clEnqueueUnmapMemObject(q, (cl_mem)u->handle, u->data, 0, 0, 0)) == CL_SUCCESS ); + if (Device::getDefault().isAMD()) + { + // required for multithreaded applications (see stitching test) + CV_OclDbgAssert(clFinish(q) == CL_SUCCESS); + } u->data = 0; } else if( u->copyOnMap() && u->deviceCopyObsolete() ) -- 2.7.4