From a66409cfd9700f94839a17f3e1b4f48ea463aa95 Mon Sep 17 00:00:00 2001 From: Po Yen Chen Date: Tue, 9 Apr 2024 12:49:07 +0000 Subject: [PATCH] Unify saturates<> implementation --- .../core/utility/unary_element_function.hpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/include/ck_tile/core/utility/unary_element_function.hpp b/include/ck_tile/core/utility/unary_element_function.hpp index c882cbe5fe..1596519efc 100644 --- a/include/ck_tile/core/utility/unary_element_function.hpp +++ b/include/ck_tile/core/utility/unary_element_function.hpp @@ -56,20 +56,9 @@ struct saturates CK_TILE_HOST_DEVICE constexpr auto operator()(const From& from) const -> std::enable_if_t, From> { - if constexpr(std::is_floating_point_v || std::is_same_v || - std::is_same_v || std::is_same_v || - std::is_same_v) - { - return clamp(from, - type_convert(numeric::lowest()), - type_convert(numeric::max())); - } - else - { - return clamp(from, - type_convert(numeric::min()), - type_convert(numeric::max())); - } + return clamp(from, + type_convert(numeric::lowest()), + type_convert(numeric::max())); } };