From 93f608123d28b1a2d1d7f59e23640d4159ff485a Mon Sep 17 00:00:00 2001 From: Po Yen Chen Date: Tue, 9 Apr 2024 14:02:13 +0000 Subject: [PATCH] Rename check_err() parameter --- example/ck_tile/01_fmha/fmha_fwd.cpp | 12 ++++++------ include/ck_tile/host/check_err.hpp | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/example/ck_tile/01_fmha/fmha_fwd.cpp b/example/ck_tile/01_fmha/fmha_fwd.cpp index 508d38a43d..fe849ecce1 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 rounding_error = 0; - double atol = 2e-3; - return ck_tile::make_tuple(rounding_error, atol); + unsigned max_rounding_error_distance = 0; + double atol = 2e-3; + return ck_tile::make_tuple(max_rounding_error_distance, atol); } else { - unsigned rounding_error = 1; - double atol = 0.0625; - return ck_tile::make_tuple(rounding_error, atol); + unsigned max_rounding_error_distance = 1; + double atol = 0.0625; + return ck_tile::make_tuple(max_rounding_error_distance, atol); } } diff --git a/include/ck_tile/host/check_err.hpp b/include/ck_tile/host/check_err.hpp index b80023b336..2a92e34cc8 100644 --- a/include/ck_tile/host/check_err.hpp +++ b/include/ck_tile/host/check_err.hpp @@ -272,10 +272,10 @@ std::enable_if_t<(std::is_same_v, ranges::range_val bool> CK_TILE_HOST check_err(const Range& out, const RefRange& ref, - const std::string& msg = "Error: Incorrect results!", - unsigned rounding_error = 1, - double atol = 1e-1, - bool allow_infinity_ref = false) + const std::string& msg = "Error: Incorrect results!", + unsigned max_rounding_error_distance = 1, + double atol = 1e-1, + bool allow_infinity_ref = false) { if(out.size() != ref.size()) { @@ -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 = [](fp8_t o, fp8_t r) -> unsigned { + static const auto get_rounding_error_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(o_fp8, r_fp8) <= rounding_error) || + get_rounding_error_distance(o_fp8, r_fp8) <= max_rounding_error_distance) || is_infinity_error(o_fp64, r_fp64)) { max_err = err > max_err ? err : max_err;