OpenCLAllocator::upload() unnecessary loop slow down the operation (Bug #3488)


Added by Hui Zhao about 11 years ago. Updated about 11 years ago.


Status:Done Start date:2014-01-15
Priority:Normal Due date:
Assignee:Ilya Lavrenov % Done:

100%

Category:ocl
Target version:3.0-alpha
Affected version:branch 'master' (3.0-dev) Operating System:Any
Difficulty:Easy HW Platform:Any
Pull request:https://github.com/Itseez/opencv/pull/2165

Description

Puzzled on the strange slowness for `Mat.copyTo(UMat)`. By checking out the code found

core\src\ocl.cpp, around line 3539 with unnecessary crc looping. Please fix it. It does slow down the operation significantly(x10 tested on 60x30MByte of data). Thank you.

        if( iscontinuous )
        {
            int crc = 0;
            for( size_t i = 0; i < total; i++ )
                crc ^= ((uchar*)srcptr)[i];
            CV_Assert( clEnqueueWriteBuffer(q, (cl_mem)u->handle,
                CL_TRUE, dstrawofs, total, srcptr, 0, 0, 0) >= 0 );
        }

Associated revisions

Revision 3481c1ca
Added by Vadim Pisarevsky over 10 years ago

Merge pull request #3488 from jeremyhu:PR-4048

History

Updated by Alexander Smorkalov about 11 years ago

  • Category set to ocl
  • Target version set to 3.0-alpha

Updated by Ilya Lavrenov about 11 years ago

Hi Hui, thanks for the bug report.
The problem you mentioned has been fixed in https://github.com/Itseez/opencv/pull/2165

  • Assignee set to Ilya Lavrenov
  • Status changed from New to Open
  • % Done changed from 0 to 100
  • Pull request set to https://github.com/Itseez/opencv/pull/2165

Updated by Andrew Senin about 11 years ago

Please reopen if you think the problem is not yet solved

  • Status changed from Open to Done

Also available in: Atom PDF