performance_gpu test timing is wrong (Patch #1846)


Added by Tim Zaman almost 13 years ago. Updated almost 13 years ago.


Status:Done Start date:2012-04-25
Priority:Normal Due date:
Assignee:Vladislav Vinogradov % Done:

0%

Category:gpu (cuda)
Target version:2.4.1
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

In the opencv/samples/gpu/performance/ there is a program that relates gpu performance versus cpu performance. This is a very neat and handy tool, but, it has a shortcoming which i expected. A thing that is commonly stated is the problem of the uploading of the GPU image to the GPU memory. This is for the GPU an extra step, and should in my opinion therefore be taken in to account in the computation time.

Proposition

tests.cpp (current)

   d_templ.upload(templ);
   GPU_ON;
   gpu::matchTemplate(d_src, d_templ, d_dst, CV_TM_CCORR);
   GPU_OFF;

test.cpp (including uploading to mem)

   GPU_ON;
   d_templ.upload(templ);
   gpu::matchTemplate(d_src, d_templ, d_dst, CV_TM_CCORR);
   GPU_OFF;

Argumentation

I think this should be done, because you are comparing CPU and GPU with the consideration to switch from CPU to GPU, this does mean that you have to take the memcpy in account.
The difference is obviously significant for small files/functions, but small for large computations that take >>100ms. In this way, you can immediatelly see that small functions are way less efficient for the gpu than large functions+files. This fact is ignored by the tests.

Example:

Current method

minMaxLoc:
    14.5524   0.432069  *x33.7*         2000x2000, 32F

New proposition

minMaxLoc:
    14.7356   0.530901  *x27.8*         2000x2000, 32F


Associated revisions

Revision ef478840
Added by Vladislav Vinogradov almost 13 years ago

added message that timings doesn't include data transfer to gpu performance sample (Issue #1846)

History

Updated by Tim Zaman almost 13 years ago

Ho stop, I suddenly find myself in GSOC!? Can you switch this to the general bug repo?

Updated by Alexander Shishkov almost 13 years ago

Switched to the OpenCV issue tracker.

  • Category deleted ()

Updated by Vladislav Vinogradov almost 13 years ago

  • Category set to gpu (cuda)

Updated by Anatoly Baksheev almost 13 years ago

That's right. We say everywhere (in our posters, presentations, etc.) that the numbers are without data coping. Clear numbers are also useful for users who upload once and try to process on GPU as much as possible. So no intention to change this.

Vlad, could you add printing to console a message that timings doesn't include data transfer?

  • Assignee set to Vladislav Vinogradov

Updated by Vladislav Vinogradov almost 13 years ago

  • Status changed from Open to Done

Updated by Andrey Kamaev almost 13 years ago

  • Target version set to 2.4.1

Also available in: Atom PDF