From a11a56e54c79672c93573300fc90fdcb0949b63b Mon Sep 17 00:00:00 2001 From: Po Yen Chen Date: Tue, 9 Apr 2024 14:58:25 +0000 Subject: [PATCH] Rename check_err() parameter --- example/ck_tile/01_fmha/fmha_fwd.cpp | 8 ++++---- include/ck_tile/host/check_err.hpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/example/ck_tile/01_fmha/fmha_fwd.cpp b/example/ck_tile/01_fmha/fmha_fwd.cpp index fe849ecce1..5f8611ea30 100644 --- a/example/ck_tile/01_fmha/fmha_fwd.cpp +++ b/example/ck_tile/01_fmha/fmha_fwd.cpp @@ -117,15 +117,15 @@ auto get_elimit(int init_method) { if(init_method == 0) { - unsigned max_rounding_error_distance = 0; + unsigned max_rounding_point_distance = 0; double atol = 2e-3; - return ck_tile::make_tuple(max_rounding_error_distance, atol); + return ck_tile::make_tuple(max_rounding_point_distance, atol); } else { - unsigned max_rounding_error_distance = 1; + unsigned max_rounding_point_distance = 1; double atol = 0.0625; - return ck_tile::make_tuple(max_rounding_error_distance, atol); + return ck_tile::make_tuple(max_rounding_point_distance, atol); } } diff --git a/include/ck_tile/host/check_err.hpp b/include/ck_tile/host/check_err.hpp index 2a92e34cc8..1ef9b24138 100644 --- a/include/ck_tile/host/check_err.hpp +++ b/include/ck_tile/host/check_err.hpp @@ -273,7 +273,7 @@ std::enable_if_t<(std::is_same_v, ranges::range_val CK_TILE_HOST check_err(const Range& out, const RefRange& ref, const std::string& msg = "Error: Incorrect results!", - unsigned max_rounding_error_distance = 1, + unsigned max_rounding_point_distance = 1, double atol = 1e-1, bool allow_infinity_ref = false) { @@ -291,7 +291,7 @@ std::enable_if_t<(std::is_same_v, ranges::range_val return either_not_finite && !(allow_infinity_ref && both_infinite_and_same); }; - static const auto get_rounding_error_distance = [](fp8_t o, fp8_t r) -> unsigned { + static const auto get_rounding_point_distance = [](fp8_t o, fp8_t r) -> unsigned { static const auto get_sign_bit = [](fp8_t v) -> bool { return 0x80 & bit_cast(v); }; @@ -318,7 +318,7 @@ std::enable_if_t<(std::is_same_v, ranges::range_val const double r_fp64 = type_convert(r_fp8); err = std::abs(o_fp64 - r_fp64); if(!(less_equal{}(err, atol) || - get_rounding_error_distance(o_fp8, r_fp8) <= max_rounding_error_distance) || + get_rounding_point_distance(o_fp8, r_fp8) <= max_rounding_point_distance) || is_infinity_error(o_fp64, r_fp64)) { max_err = err > max_err ? err : max_err;