Faster integer division when denominator is known?
Posted
by aaa
on Stack Overflow
See other posts from Stack Overflow
or by aaa
Published on 2010-04-11T04:42:41Z
Indexed on
2010/04/11
4:53 UTC
Read the original article
Hit count: 357
hi
I am working on GPU device which has very high division integer latency, several hundred cycles. I am looking to optimize divisions.
All divisions by denominator which is in a set { 1,3,6,10 }, however numerator is a runtime positive value, roughly 32000 or less. due to memory constraints, lookup table is not option.
Can you think of alternatives? I have thought of computing float point inverses, and using those to multiply numerator.
Thanks
© Stack Overflow or respective owner