mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 04:35:57 +08:00
Fixed the isnan, isfinite and isinf operations on GPU
This commit is contained in:
parent
b50d8f8c4a
commit
9506343349
@ -544,4 +544,31 @@ EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half __ldg(const Eigen::half* ptr)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(__CUDA_ARCH__)
|
||||||
|
namespace Eigen {
|
||||||
|
namespace numext {
|
||||||
|
|
||||||
|
template<>
|
||||||
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
|
||||||
|
bool (isnan)(const Eigen::half& h) {
|
||||||
|
return (half_impl::isnan)(h);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
|
||||||
|
bool (isinf)(const Eigen::half& h) {
|
||||||
|
return (half_impl::isinf)(h);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
|
||||||
|
bool (isfinite)(const Eigen::half& h) {
|
||||||
|
return (half_impl::isfinite)(h);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace Eigen
|
||||||
|
} // namespace numext
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // EIGEN_HALF_CUDA_H
|
#endif // EIGEN_HALF_CUDA_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user