Added a 'divup' util to compute the floor of the quotient of two integers

This commit is contained in:
Benoit Steiner 2016-01-04 16:29:26 -08:00
parent 715f6f049f
commit 515dee0baf

View File

@ -24,6 +24,11 @@ const T2& choose(Cond<false>, const T1&, const T2& second) {
return second;
}
template <typename T> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
T divup(const T x, const T y) {
return (x + y - 1) / y;
}
template <size_t n> struct max_n_1 {
static const size_t size = n;
};