From 9eb07f37dbce2c52843000d71a2d2a583494a26b Mon Sep 17 00:00:00 2001 From: AngryLoki Date: Wed, 14 Aug 2024 03:31:15 +0800 Subject: [PATCH] Fix compilation errors with libc++ (#1461) This fixes 2 issues when compiled with libc++. First issue is attempt to call std::numeric_limits>::min(). _Float16 is extension of libstdc++, it does not exist in C++ standard[2]. Luckily, there is NumericLimits class in composable_kernel, which does everything needed. Second issue with call to 'check_err' is ambiguous: there are 2 candidates. It happens because composable_kernel relies on idea that f8_t (defined as _BitInt(8)) does not pass is_integral trait. However, libc++ treats _BitInt(N) as integral (per standard "any implementation-defined extended integer types" can be integral). Closes: #1460 Signed-off-by: Sv. Lockal [ROCm/composable_kernel commit: 50c423481b9eaeaa95ea8c99d77c1aca2257fdc1] --- library/include/ck/library/utility/check_err.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/include/ck/library/utility/check_err.hpp b/library/include/ck/library/utility/check_err.hpp index a3df884eee..9f4212ebd4 100644 --- a/library/include/ck/library/utility/check_err.hpp +++ b/library/include/ck/library/utility/check_err.hpp @@ -146,7 +146,7 @@ check_err(const Range& out, bool res{true}; int err_count = 0; double err = 0; - double max_err = std::numeric_limits>::min(); + double max_err = NumericLimits>::Min(); for(std::size_t i = 0; i < ref.size(); ++i) { const double o = type_convert(*std::next(std::begin(out), i)); @@ -178,7 +178,9 @@ check_err(const Range& out, template std::enable_if_t<(std::is_same_v, ranges::range_value_t> && std::is_integral_v> && - !std::is_same_v, bhalf_t>) + !std::is_same_v, bhalf_t> && + !std::is_same_v, f8_t> && + !std::is_same_v, bf8_t>) #ifdef CK_EXPERIMENTAL_BIT_INT_EXTENSION_INT4 || std::is_same_v, int4_t> #endif