From 7068f9900d136312318ff430aef588b14e0c87ad Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Thu, 26 Oct 2017 15:23:08 +0100 Subject: COMPMID-631: Merge branches/gles_compute branch Last commit: commit b25c5f68042b0c81bf611d59a1bb8535e1c42497 Author: Xinghang Zhou Date: Wed Oct 25 18:48:10 2017 +0800 Synced validation's tolerances of GCSoftmax from cl side Change-Id: Ibe72054205c1c8721845d679a31af7ed0a7c5cf6 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/93283 Reviewed-by: Anthony Barbier Tested-by: Kaizen --- arm_compute/core/Utils.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'arm_compute/core/Utils.h') diff --git a/arm_compute/core/Utils.h b/arm_compute/core/Utils.h index 96e99e6874..b8c5b34e5a 100644 --- a/arm_compute/core/Utils.h +++ b/arm_compute/core/Utils.h @@ -837,7 +837,16 @@ void print_consecutive_elements_impl(std::ostream &s, const T *ptr, unsigned int { s.width(stream_width); } - s << std::right << static_cast(ptr[i]) << element_delim; + + if(std::is_same::type, half>::value) + { + // We use T instead of print_type here is because the std::is_floating_point returns false and then the print_type becomes int. + s << std::right << static_cast(ptr[i]) << element_delim; + } + else + { + s << std::right << static_cast(ptr[i]) << element_delim; + } } } @@ -859,7 +868,17 @@ int max_consecutive_elements_display_width_impl(std::ostream &s, const T *ptr, u { std::stringstream ss; ss.copyfmt(s); - ss << static_cast(ptr[i]); + + if(std::is_same::type, half>::value) + { + // We use T instead of print_type here is because the std::is_floating_point returns false and then the print_type becomes int. + ss << static_cast(ptr[i]); + } + else + { + ss << static_cast(ptr[i]); + } + max_width = std::max(max_width, ss.str().size()); } return max_width; -- cgit v1.2.1