mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-28 23:04:18 +08:00
Fix CUDA build breakage and incorrect result for absdiff on HIP with long double arguments.
This commit is contained in:
parent
f7b185a8b1
commit
ee714f79f7
@ -1199,17 +1199,15 @@ EIGEN_ALWAYS_INLINE double absdiff(const double& x, const double& y)
|
||||
{
|
||||
return fabs(x - y);
|
||||
}
|
||||
|
||||
#if !defined(EIGEN_GPUCC)
|
||||
// HIP and CUDA do not support long double.
|
||||
template<>
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_ALWAYS_INLINE long double absdiff(const long double& x, const long double& y)
|
||||
{
|
||||
#if defined(EIGEN_HIPCC)
|
||||
// no "fabsl" on HIP yet
|
||||
return (x > y) ? x : y;
|
||||
#else
|
||||
EIGEN_ALWAYS_INLINE long double absdiff(const long double& x, const long double& y) {
|
||||
return fabsl(x - y);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
template<typename Scalar>
|
||||
EIGEN_DEVICE_FUNC
|
||||
|
Loading…
x
Reference in New Issue
Block a user