mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
Cuda compatibility: remove explicit call to std math functions
This commit is contained in:
parent
bc40eb745d
commit
1dd6a329e8
@ -99,7 +99,7 @@ EIGEN_STRONG_INLINE typename NumTraits<typename internal::traits<Derived>::Scala
|
|||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
inline typename NumTraits<typename internal::traits<Derived>::Scalar>::Real MatrixBase<Derived>::norm() const
|
inline typename NumTraits<typename internal::traits<Derived>::Scalar>::Real MatrixBase<Derived>::norm() const
|
||||||
{
|
{
|
||||||
using std::sqrt;
|
EIGEN_USING_STD_MATH(sqrt)
|
||||||
return sqrt(squaredNorm());
|
return sqrt(squaredNorm());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ struct lpNorm_selector
|
|||||||
EIGEN_DEVICE_FUNC
|
EIGEN_DEVICE_FUNC
|
||||||
static inline RealScalar run(const MatrixBase<Derived>& m)
|
static inline RealScalar run(const MatrixBase<Derived>& m)
|
||||||
{
|
{
|
||||||
using std::pow;
|
EIGEN_USING_STD_MATH(pow)
|
||||||
return pow(m.cwiseAbs().array().pow(p).sum(), RealScalar(1)/p);
|
return pow(m.cwiseAbs().array().pow(p).sum(), RealScalar(1)/p);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user