Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCL, float vs uint, expected performance gain?

What would be the expected performance gain with using (u)int16 over float in an OpenCL kernel ? If any ? I expect the memory transfer to be roughly divided by two but what of the device load ?

Strangely I can hardly find any benchs or documentations on the subject. (or maybe my google fu is just failing me...)

I'm working on image processing (filtering mostly). The precision is not that critical, indeed the result of several kernels operations is cast into a char. We narrowed several operations where using shorter data types is acceptable. So I was wondering if those operations can be speed up by using shorter data where the precision is not critical.

thanks for your help.

like image 254
jnbd Avatar asked Aug 06 '26 09:08

jnbd


1 Answers

GPUs tend to do floating-point operations better than integral. For example, some will have extra pipelines for floating-point ops, and making everything integral just reduces the GPU's throughput. Data copy may not be your bottleneck and halving the amount by using 16-bit integers may not help. Moreover, on integrated GPU's like Intel or AMD's you can get zero-copy behavior. So the effect on image or buffer size is minimal (to a point).

Also, you might look into 16-bit floating point number support. That gets you the best part of both worlds (half the data w/ floating point numbers).

like image 165
Tim Avatar answered Aug 08 '26 23:08

Tim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!