| 25 | // @param divisor must be greater than zero |
| 26 | template <typename T, typename N> |
| 27 | T IntegralDivideRoundUp(T n, N divisor) { |
| 28 | const T div = static_cast<T>(divisor); |
| 29 | const T q = n / div; |
| 30 | return n % div == 0 ? q : q + 1; |
| 31 | } |
| 32 | |
| 33 | template <> |
| 34 | inline uint3 IntegralDivideRoundUp(uint3 n, uint3 divisor) { |
no outgoing calls