From 515dee0bafc69dd79cfbf9c2831e707d2214390f Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Mon, 4 Jan 2016 16:29:26 -0800 Subject: Added a 'divup' util to compute the floor of the quotient of two integers --- unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h') 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, const T1&, const T2& second) { return second; } +template EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T divup(const T x, const T y) { + return (x + y - 1) / y; +} + template struct max_n_1 { static const size_t size = n; }; -- cgit v1.2.3