From 9c73b891a57a6261167c297622d192f92355271a Mon Sep 17 00:00:00 2001 From: Paul Balanca Date: Thu, 12 Sep 2024 14:57:20 +0100 Subject: [PATCH] wip --- ml_dtypes/include/float8.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/ml_dtypes/include/float8.h b/ml_dtypes/include/float8.h index 9da0361b..92d79e92 100644 --- a/ml_dtypes/include/float8.h +++ b/ml_dtypes/include/float8.h @@ -1414,6 +1414,7 @@ struct ConvertImpl::digits << std::endl; std::cerr << "CONVERT IMPL Signed0: " << kToIsSigned << " / " << kFromIsSigned << std::endl; + std::cerr << "CONVERT IMPL Inf/Nan0: " << int(Eigen::numext::isinf(from)) << " / " << int(Eigen::numext::isnan(from)) << std::endl; @@ -1820,6 +1821,12 @@ EIGEN_DEVICE_FUNC inline bool isinf_impl( return ml_dtypes::float8_internal::isinf(x); } +template <> +EIGEN_DEVICE_FUNC inline bool isinf_impl( + const ml_dtypes::float8_e8m0fnu& x) { + return ml_dtypes::float8_internal::isinf(x); +} + template <> EIGEN_DEVICE_FUNC inline bool isnan_impl( const ml_dtypes::float8_e3m4& x) { @@ -1862,6 +1869,12 @@ EIGEN_DEVICE_FUNC inline bool isnan_impl( return ml_dtypes::float8_internal::isnan(x); } +template <> +EIGEN_DEVICE_FUNC inline bool isnan_impl( + const ml_dtypes::float8_e8m0fnu& x) { + return ml_dtypes::float8_internal::isnan(x); +} + template <> EIGEN_DEVICE_FUNC inline bool isfinite_impl( const ml_dtypes::float8_e3m4& x) { @@ -1904,6 +1917,12 @@ EIGEN_DEVICE_FUNC inline bool isfinite_impl( return ml_dtypes::float8_internal::isfinite(x); } +template <> +EIGEN_DEVICE_FUNC inline bool isfinite_impl( + const ml_dtypes::float8_e8m0fnu& x) { + return ml_dtypes::float8_internal::isfinite(x); +} + } // namespace internal } // namespace Eigen