mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
ocl: CL_MEM_USE_HOST_PTR workaround test
This commit is contained in:
parent
7ea5029ae5
commit
d76b41b50e
@ -4666,7 +4666,9 @@ public:
|
||||
#endif
|
||||
{
|
||||
tempUMatFlags = UMatData::TEMP_UMAT;
|
||||
if (u->origdata == cv::alignPtr(u->origdata, 4)) // There are OpenCL runtime issues for less aligned data
|
||||
if (u->origdata == cv::alignPtr(u->origdata, 4) // There are OpenCL runtime issues for less aligned data
|
||||
&& !(u->originalUMatData && u->originalUMatData->handle) // Avoid sharing of host memory between OpenCL buffers
|
||||
)
|
||||
{
|
||||
handle = clCreateBuffer(ctx_handle, CL_MEM_USE_HOST_PTR|createFlags,
|
||||
u->size, u->origdata, &retval);
|
||||
|
@ -381,6 +381,7 @@ UMat Mat::getUMat(int accessFlags, UMatUsageFlags usageFlags) const
|
||||
if(!a)
|
||||
a = a0;
|
||||
new_u = a->allocate(dims, size.p, type(), data, step.p, accessFlags, usageFlags);
|
||||
new_u->originalUMatData = u;
|
||||
}
|
||||
bool allocated = false;
|
||||
CV_TRY
|
||||
@ -404,7 +405,6 @@ UMat Mat::getUMat(int accessFlags, UMatUsageFlags usageFlags) const
|
||||
CV_Assert(new_u->tempUMat());
|
||||
}
|
||||
#endif
|
||||
new_u->originalUMatData = u;
|
||||
CV_XADD(&(u->refcount), 1);
|
||||
CV_XADD(&(u->urefcount), 1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user