diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2015-11-06 09:18:43 -0800 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2015-11-06 09:18:43 -0800 |
commit | ed1962b464119395d23fa7deeb9b7e77b0c05d18 (patch) | |
tree | 0158f732757345bff34044647592c4aae4383a72 /unsupported/Eigen/CXX11/src/Tensor/TensorBase.h | |
parent | bfd6ee64f39340b42a1ee21e4b04ff15433e829d (diff) |
Reimplement the tensor comparison operators by using the scalar_cmp_op functors. This makes them more cuda friendly.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorBase.h')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorBase.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h index ceced984b..906687436 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h @@ -257,12 +257,12 @@ class TensorBase<Derived, ReadOnlyAccessors> template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorCwiseBinaryOp<std::less<Scalar>, const Derived, const OtherDerived> operator<(const OtherDerived& other) const { - return binaryExpr(other.derived(), std::less<Scalar>()); + return binaryExpr(other.derived(), internal::scalar_cmp_op<Scalar, internal::cmp_LT>()); } template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorCwiseBinaryOp<std::less_equal<Scalar>, const Derived, const OtherDerived> operator<=(const OtherDerived& other) const { - return binaryExpr(other.derived(), std::less_equal<Scalar>()); + return binaryExpr(other.derived(), internal::scalar_cmp_op<Scalar, internal::cmp_LE>()); } template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorCwiseBinaryOp<std::greater<Scalar>, const Derived, const OtherDerived> @@ -278,12 +278,12 @@ class TensorBase<Derived, ReadOnlyAccessors> template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorCwiseBinaryOp<std::equal_to<Scalar>, const Derived, const OtherDerived> operator==(const OtherDerived& other) const { - return binaryExpr(other.derived(), std::equal_to<Scalar>()); + return binaryExpr(other.derived(), internal::scalar_cmp_op<Scalar, internal::cmp_EQ>()); } template<typename OtherDerived> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const TensorCwiseBinaryOp<std::not_equal_to<Scalar>, const Derived, const OtherDerived> operator!=(const OtherDerived& other) const { - return binaryExpr(other.derived(), std::not_equal_to<Scalar>()); + return binaryExpr(other.derived(), internal::scalar_cmp_op<Scalar, internal::cmp_NEQ>()); } // comparisons and tests for Scalars |