Ask Your Question
0

0 running time in GPU methods

asked Oct 16 '17

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!

Preview: (hide)

1 answer

Sort by » oldest newest most voted
2

answered Oct 17 '17

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.

Preview: (hide)

Question Tools

1 follower

Stats

Asked: Oct 16 '17

Seen: 215 times

Last updated: Oct 16 '17