mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 11:49:02 +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 {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T initialize() const {
|
||||||
return -(std::numeric_limits<T>::max)();
|
return Eigen::NumTraits<T>::lowest();
|
||||||
}
|
}
|
||||||
template <typename Packet>
|
template <typename Packet>
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet initializePacket() const {
|
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 {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T finalize(const T accum) const {
|
||||||
return accum;
|
return accum;
|
||||||
@ -182,11 +182,11 @@ template <typename T> struct MinReducer
|
|||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T initialize() const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T initialize() const {
|
||||||
return (std::numeric_limits<T>::max)();
|
return Eigen::NumTraits<T>::highest();
|
||||||
}
|
}
|
||||||
template <typename Packet>
|
template <typename Packet>
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Packet initializePacket() const {
|
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 {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T finalize(const T accum) const {
|
||||||
return accum;
|
return accum;
|
||||||
@ -722,6 +722,7 @@ template <> class NormalRandomGenerator<std::complex<double> > {
|
|||||||
|
|
||||||
template <typename T> class NormalRandomGenerator {
|
template <typename T> class NormalRandomGenerator {
|
||||||
public:
|
public:
|
||||||
|
static const bool PacketAccess = false;
|
||||||
NormalRandomGenerator(bool deterministic = true) : m_deterministic(deterministic) {}
|
NormalRandomGenerator(bool deterministic = true) : m_deterministic(deterministic) {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user