mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-07 18:27:40 +08:00
Use NumTraits::highest() and NumTraits::lowest() instead of the std::numeric_limits to make the tensor min and max functors more CUDA friendly.
This commit is contained in:
parent
769685e74e
commit
3b614a2358
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user