|
|
|
@ -3738,6 +3738,7 @@ public: |
|
|
|
|
u->handle = clCreateBuffer(ctx_handle, CL_MEM_COPY_HOST_PTR|CL_MEM_READ_WRITE|createFlags, |
|
|
|
|
u->size, u->origdata, &retval); |
|
|
|
|
tempUMatFlags = UMatData::TEMP_COPIED_UMAT; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if(!u->handle || retval != CL_SUCCESS) |
|
|
|
|
return false; |
|
|
|
@ -3879,6 +3880,7 @@ public: |
|
|
|
|
if(u->data && retval == CL_SUCCESS) |
|
|
|
|
{ |
|
|
|
|
u->markHostCopyObsolete(false); |
|
|
|
|
u->markDeviceMemMapped(true); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -3907,6 +3909,7 @@ public: |
|
|
|
|
if(!u) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CV_Assert(u->handle != 0); |
|
|
|
|
|
|
|
|
|
UMatDataAutoLock autolock(u); |
|
|
|
@ -3917,8 +3920,10 @@ public: |
|
|
|
|
|
|
|
|
|
cl_command_queue q = (cl_command_queue)Queue::getDefault().ptr(); |
|
|
|
|
cl_int retval = 0; |
|
|
|
|
if( !u->copyOnMap() && u->data ) |
|
|
|
|
if( !u->copyOnMap() && u->deviceMemMapped() ) |
|
|
|
|
{ |
|
|
|
|
CV_Assert(u->data != NULL); |
|
|
|
|
u->markDeviceMemMapped(false); |
|
|
|
|
CV_Assert( (retval = clEnqueueUnmapMemObject(q, |
|
|
|
|
(cl_mem)u->handle, u->data, 0, 0, 0)) == CL_SUCCESS ); |
|
|
|
|
CV_OclDbgAssert(clFinish(q) == CL_SUCCESS); |
|
|
|
|