diff options
author | Ilya Tokar <tokarip@google.com> | 2019-12-16 16:00:35 -0500 |
---|---|---|
committer | Ilya Tokar <tokarip@google.com> | 2020-01-07 21:22:44 +0000 |
commit | 19876ced76bd1730008e02fc4c43c2228faed38a (patch) | |
tree | 22f999134e79f84f6f9dc0d19bdfa6740db416f0 /unsupported/Eigen/CXX11/src | |
parent | d0ae052da4ce25a5b4306bfbb5bf8edcd010b663 (diff) |
Bug #1785: Introduce numext::rint.
This provides a new op that matches std::rint and previous behavior of
pround. Also adds corresponding unsupported/../Tensor op.
Performance is the same as e. g. floor (tested SSE/AVX).
Diffstat (limited to 'unsupported/Eigen/CXX11/src')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorBase.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h index 7aa98fac6..bb0969f49 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h @@ -423,6 +423,12 @@ class TensorBase<Derived, ReadOnlyAccessors> } EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_rint_op<Scalar>, const Derived> + rint() const { + return unaryExpr(internal::scalar_rint_op<Scalar>()); + } + + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorCwiseUnaryOp<internal::scalar_ceil_op<Scalar>, const Derived> ceil() const { return unaryExpr(internal::scalar_ceil_op<Scalar>()); |