From 19876ced76bd1730008e02fc4c43c2228faed38a Mon Sep 17 00:00:00 2001 From: Ilya Tokar Date: Mon, 16 Dec 2019 16:00:35 -0500 Subject: 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). --- unsupported/Eigen/CXX11/src/Tensor/TensorBase.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'unsupported') 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 @@ -422,6 +422,12 @@ class TensorBase return unaryExpr(internal::scalar_round_op()); } + EIGEN_DEVICE_FUNC + EIGEN_STRONG_INLINE const TensorCwiseUnaryOp, const Derived> + rint() const { + return unaryExpr(internal::scalar_rint_op()); + } + EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorCwiseUnaryOp, const Derived> ceil() const { -- cgit v1.2.3