diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-01-04 16:29:26 -0800 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-01-04 16:29:26 -0800 |
commit | 515dee0bafc69dd79cfbf9c2831e707d2214390f (patch) | |
tree | 763caa293f6dffb1f8f528bd56cb0c9fbc847406 /unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h | |
parent | 715f6f049fb449df57484a36711d9fde8a5d1be0 (diff) |
Added a 'divup' util to compute the floor of the quotient of two integers
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h index f28a9699d..d6ad65070 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h @@ -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; }; |