mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Don't use std::equal_to inside cuda kernels since it's not supported.
This commit is contained in:
@@ -551,23 +551,27 @@ T div_ceil(const T &a, const T &b)
|
|||||||
|
|
||||||
// The aim of the following functions is to bypass -Wfloat-equal warnings
|
// The aim of the following functions is to bypass -Wfloat-equal warnings
|
||||||
// when we really want a strict equality comparison on floating points.
|
// when we really want a strict equality comparison on floating points.
|
||||||
template<typename X, typename Y> EIGEN_STRONG_INLINE
|
template<typename X, typename Y> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
|
||||||
bool equal_strict(const X& x,const Y& y) { return x == y; }
|
bool equal_strict(const X& x,const Y& y) { return x == y; }
|
||||||
|
|
||||||
template<> EIGEN_STRONG_INLINE
|
#if !defined(EIGEN_CUDA_ARCH)
|
||||||
|
template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
|
||||||
bool equal_strict(const float& x,const float& y) { return std::equal_to<float>()(x,y); }
|
bool equal_strict(const float& x,const float& y) { return std::equal_to<float>()(x,y); }
|
||||||
|
|
||||||
template<> EIGEN_STRONG_INLINE
|
template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
|
||||||
bool equal_strict(const double& x,const double& y) { return std::equal_to<double>()(x,y); }
|
bool equal_strict(const double& x,const double& y) { return std::equal_to<double>()(x,y); }
|
||||||
|
#endif
|
||||||
|
|
||||||
template<typename X, typename Y> EIGEN_STRONG_INLINE
|
template<typename X, typename Y> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
|
||||||
bool not_equal_strict(const X& x,const Y& y) { return x != y; }
|
bool not_equal_strict(const X& x,const Y& y) { return x != y; }
|
||||||
|
|
||||||
template<> EIGEN_STRONG_INLINE
|
#if !defined(EIGEN_CUDA_ARCH)
|
||||||
|
template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
|
||||||
bool not_equal_strict(const float& x,const float& y) { return std::not_equal_to<float>()(x,y); }
|
bool not_equal_strict(const float& x,const float& y) { return std::not_equal_to<float>()(x,y); }
|
||||||
|
|
||||||
template<> EIGEN_STRONG_INLINE
|
template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
|
||||||
bool not_equal_strict(const double& x,const double& y) { return std::not_equal_to<double>()(x,y); }
|
bool not_equal_strict(const double& x,const double& y) { return std::not_equal_to<double>()(x,y); }
|
||||||
|
#endif
|
||||||
|
|
||||||
} // end namespace numext
|
} // end namespace numext
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user