diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-03-07 17:53:28 -0800 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-03-07 17:53:28 -0800 |
commit | 3b614a235823322fd2ad9e367e36384bd353f9f8 (patch) | |
tree | 7d2d7b34b233a247bbf8b47c933605523d8684c4 /unsupported/Eigen/CXX11/src/Tensor | |
parent | 769685e74e92a66badc599b72d7034cea907a798 (diff) |
Use NumTraits::highest() and NumTraits::lowest() instead of the std::numeric_limits to make the tensor min and max functors more CUDA friendly.
Diffstat (limited to 'unsupported/Eigen/CXX11/src/Tensor')
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h b/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h index 528909688..b24f06df8 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h @@ -149,11 +149,11 @@ template <typename T> struct MaxReducer } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T initialize() const { - return -(std::numeric_limits<T>::max)(); + return Eigen::NumTraits<T>::lowest(); } template <typename Packet> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet initializePacket() const { - return pset1<Packet>(-(std::numeric_limits<T>::max)()); + return pset1<Packet>(initialize()); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T finalize(const T accum) const { return accum; @@ -182,11 +182,11 @@ template <typename T> struct MinReducer } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T initialize() const { - return (std::numeric_limits<T>::max)(); + return Eigen::NumTraits<T>::highest(); } template <typename Packet> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet initializePacket() const { - return pset1<Packet>((std::numeric_limits<T>::max)()); + return pset1<Packet>(initialize()); } EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T finalize(const T accum) const { return accum; @@ -722,6 +722,7 @@ template <> class NormalRandomGenerator<std::complex<double> > { template <typename T> class NormalRandomGenerator { public: + static const bool PacketAccess = false; NormalRandomGenerator(bool deterministic = true) : m_deterministic(deterministic) {} private: |