Ask Your Question
0

0 running time in GPU methods

asked 2017-10-16 13:27:32 -0600

Papercut gravatar image

Hi,

I am doing GPU performance test and measuring processing time of some general methods. Here's the measured processing time and performed task:

CUDA dev count: 1
D:\gpu test\images\5000x2750\01.bmp
16 load src1 in CPU
796 upload src1 CPU -> GPU
0 Resize
0 BGR2GRAY
16 BGR2HSV
47 BGR2YUV
0 Threshold

D:\gpu test\images\5000x2750\02.bmp
31 load src1 in CPU
0 upload src1 CPU -> GPU
16 Resize
0 BGR2GRAY
0 BGR2HSV
0 BGR2YUV
31 Threshold

My first question is that, In many times, I get 0 processing time. Why is that?

Second, 47ms BGR2YUV is slower than doing it on CPU. Why is it so slow?

Thanks in advance!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2017-10-16 18:14:55 -0600

Tetragramm gravatar image

Make sure you're calling waitForCompletion between each method call. CUDA methods are asynchronous and can return immediately, and the work goes on until you copy the memory back.

You can see information about how that works in the Optimization section of this tutorial.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-10-16 13:27:32 -0600

Seen: 204 times

Last updated: Oct 16 '17