Revert "Avoid integer overflow in EigenMetaKernel indexing"

This reverts commit 100d7caf92
This commit is contained in:
Antonio Sánchez
2021-10-27 14:55:25 +00:00
parent 68e0d023c0
commit 185ad0e610
3 changed files with 7 additions and 86 deletions

View File

@@ -30,15 +30,13 @@ const T2& choose(Cond<false>, const T1&, const T2& second) {
template <typename T, typename X, typename Y>
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
T divup(const X x, const Y y) {
// Note: This form is used because it cannot overflow.
return static_cast<T>(x == 0 ? 0 : (x - 1) / y + 1);
return static_cast<T>((x + y - 1) / y);
}
template <typename T>
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
T divup(const T x, const T y) {
// Note: This form is used because it cannot overflow.
return static_cast<T>(x == 0 ? 0 : (x - 1) / y + 1);
return static_cast<T>((x + y - 1) / y);
}
template <size_t n> struct max_n_1 {