mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
Use numext::abs instead of std::abs in scalar_fuzzy_default_impl to make it usable inside GPU kernels.
This commit is contained in:
parent
01bd577288
commit
5da90fc8dd
@ -1128,14 +1128,12 @@ struct scalar_fuzzy_default_impl<Scalar, false, false>
|
|||||||
template<typename OtherScalar> EIGEN_DEVICE_FUNC
|
template<typename OtherScalar> EIGEN_DEVICE_FUNC
|
||||||
static inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y, const RealScalar& prec)
|
static inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y, const RealScalar& prec)
|
||||||
{
|
{
|
||||||
EIGEN_USING_STD_MATH(abs);
|
return numext::abs(x) <= numext::abs(y) * prec;
|
||||||
return abs(x) <= abs(y) * prec;
|
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC
|
EIGEN_DEVICE_FUNC
|
||||||
static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar& prec)
|
static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar& prec)
|
||||||
{
|
{
|
||||||
EIGEN_USING_STD_MATH(abs);
|
return numext::abs(x - y) <= numext::mini(numext::abs(x), numext::abs(y)) * prec;
|
||||||
return abs(x - y) <= numext::mini(abs(x), abs(y)) * prec;
|
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC
|
EIGEN_DEVICE_FUNC
|
||||||
static inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, const RealScalar& prec)
|
static inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, const RealScalar& prec)
|
||||||
|
Loading…
Reference in New Issue
Block a user