diff options
author | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-05-18 14:52:49 -0700 |
---|---|---|
committer | Benoit Steiner <benoit.steiner.goog@gmail.com> | 2016-05-18 14:52:49 -0700 |
commit | bb3ff8e9d91bbab7165add8c6d2a991e7b9be02f (patch) | |
tree | 3f2970dc96c7e3d51181ac991f6eef7f8a525735 | |
parent | 84df9142e71d5f2ada5c318e03ce2aa6bbcdff6f (diff) |
Advertize the packet api of the tensor reducers iff the corresponding packet primitives are available.
-rw-r--r-- | unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h b/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h index c674fcfe1..3dd32e9d1 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h @@ -87,7 +87,7 @@ struct functor_traits<scalar_sigmoid_op<T> > { // Standard reduction functors template <typename T> struct SumReducer { - static const bool PacketAccess = true; + static const bool PacketAccess = packet_traits<T>::HasAdd; static const bool IsStateful = false; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const T t, T* accum) const { @@ -121,7 +121,7 @@ template <typename T> struct SumReducer template <typename T> struct MeanReducer { - static const bool PacketAccess = !NumTraits<T>::IsInteger; + static const bool PacketAccess = packet_traits<T>::HasAdd && !NumTraits<T>::IsInteger; static const bool IsStateful = true; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE @@ -164,7 +164,7 @@ template <typename T> struct MeanReducer template <typename T> struct MaxReducer { - static const bool PacketAccess = true; + static const bool PacketAccess = packet_traits<T>::HasMax; static const bool IsStateful = false; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const T t, T* accum) const { @@ -197,7 +197,7 @@ template <typename T> struct MaxReducer template <typename T> struct MinReducer { - static const bool PacketAccess = true; + static const bool PacketAccess = packet_traits<T>::HasMin; static const bool IsStateful = false; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const T t, T* accum) const { @@ -231,7 +231,7 @@ template <typename T> struct MinReducer template <typename T> struct ProdReducer { - static const bool PacketAccess = true; + static const bool PacketAccess = packet_traits<T>::HasMul; static const bool IsStateful = false; EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void reduce(const T t, T* accum) const { |