From 3c5f949ad73fff961a7d193c9275b73df13b8096 Mon Sep 17 00:00:00 2001 From: John Richardson Date: Wed, 4 Oct 2017 15:27:37 +0100 Subject: COMPMID-575: Port Magnitude to new validation Change-Id: I2600947bef30853d00adfa4b919dbcb860de9bfd Reviewed-on: http://mpd-gerrit.cambridge.arm.com/91717 Tested-by: Kaizen Reviewed-by: Anthony Barbier --- tests/Utils.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/Utils.h') diff --git a/tests/Utils.h b/tests/Utils.h index 4745b8bbd7..465cba88ab 100644 --- a/tests/Utils.h +++ b/tests/Utils.h @@ -106,6 +106,10 @@ using promote_t = typename promote::type; template using make_signed_conditional_t = typename std::conditional::value, std::make_signed, std::common_type>::type; + +template +using make_unsigned_conditional_t = typename std::conditional::value, std::make_unsigned, std::common_type>::type; + // clang-format on // *INDENT-ON* } @@ -298,6 +302,16 @@ struct common_promoted_signed_type using intermediate_type = typename traits::make_signed_conditional_t::type; }; +/** Find the unsigned promoted common type. + */ +template +struct common_promoted_unsigned_type +{ + using common_type = typename std::common_type::type; + using promoted_type = traits::promote_t; + using intermediate_type = typename traits::make_unsigned_conditional_t::type; +}; + /** Convert a linear index into n-dimensional coordinates. * * @param[in] shape Shape of the n-dimensional tensor. -- cgit v1.2.1