ocl: workaround for synchronization issue in ::map()

pull/2565/head
Alexander Alekhin 11 years ago committed by Andrey Pavlenko
parent 588658d1a3
commit 3578f0afe9
  1. 13
      modules/core/src/ocl.cpp

@ -3798,11 +3798,16 @@ public:
cl_command_queue q = (cl_command_queue)Queue::getDefault().ptr();
if( u->refcount == 0 )
// FIXIT Workaround for UMat synchronization issue
// if( u->refcount == 0 )
{
if( !u->copyOnMap() )
{
CV_Assert(u->data == 0);
if (u->data) // FIXIT Workaround for UMat synchronization issue
{
//CV_Assert(u->hostCopyObsolete() == false);
return;
}
// because there can be other map requests for the same UMat with different access flags,
// we use the universal (read-write) access mode.
cl_int retval = 0;
@ -3844,6 +3849,10 @@ public:
UMatDataAutoLock autolock(u);
// FIXIT Workaround for UMat synchronization issue
if(u->refcount > 0)
return;
cl_command_queue q = (cl_command_queue)Queue::getDefault().ptr();
cl_int retval = 0;
if( !u->copyOnMap() && u->data )

Loading…
Cancel
Save