This commit is contained in:
Alexander Alekhin 2015-07-27 17:04:19 +03:00
parent cd5c70691a
commit 9bcccb028b
2 changed files with 13 additions and 3 deletions

View File

@ -4516,7 +4516,14 @@ public:
} }
else else
{ {
// nothing with CL_MEM_USE_HOST_PTR // 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);
} }
} }
u->markHostCopyObsolete(false); u->markHostCopyObsolete(false);

View File

@ -897,8 +897,9 @@ TEST(UMat, ReadBufferRect)
EXPECT_MAT_NEAR(t, t2, 0); EXPECT_MAT_NEAR(t, t2, 0);
} }
// Use iGPU or OPENCV_OPENCL_DEVICE=:CPU: to catch problem // Use iGPU or OPENCV_OPENCL_DEVICE=:CPU: to catch problem
TEST(UMat, DISABLED_synchronization_map_unmap) TEST(UMat, synchronization_map_unmap)
{ {
class TestParallelLoopBody : public cv::ParallelLoopBody class TestParallelLoopBody : public cv::ParallelLoopBody
{ {
@ -935,6 +936,7 @@ TEST(UMat, DISABLED_synchronization_map_unmap)
} }
} }
TEST(UMat, async_unmap) TEST(UMat, async_unmap)
{ {
for (int i = 0; i < 20; i++) for (int i = 0; i < 20; i++)
@ -961,6 +963,7 @@ TEST(UMat, async_unmap)
} }
} }
TEST(UMat, unmap_in_class) TEST(UMat, unmap_in_class)
{ {
class Logic class Logic
@ -1024,7 +1027,7 @@ TEST(UMat, map_unmap_counting)
TEST(UMat, Test_same_behaviour_read_and_read) TEST(UMat, DISABLED_Test_same_behaviour_read_and_read)
{ {
bool exceptionDetected = false; bool exceptionDetected = false;
try try