From dda691c3b6d45de1e2dea28674ae6af6e17e9815 Mon Sep 17 00:00:00 2001 From: Gunes Bayir Date: Fri, 22 Dec 2023 10:51:36 +0000 Subject: =?UTF-8?q?Call=20std::round()=20directly=20in=20non=20Android?= =?UTF-8?q?=E2=84=A2=20and=20Bare=20Metal=20builds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The workaround is not relevant anymore as we update our memory debugging tools. Signed-off-by: Gunes Bayir Change-Id: Ib00e0ad9ba693f97fee87158dd03d3617dce9282 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10908 Reviewed-by: Gian Marco Iodice Comments-Addressed: Arm Jenkins Benchmark: Arm Jenkins Tested-by: Arm Jenkins --- support/ToolchainSupport.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/support/ToolchainSupport.h b/support/ToolchainSupport.h index 4d394889c3..accbb643c2 100644 --- a/support/ToolchainSupport.h +++ b/support/ToolchainSupport.h @@ -21,8 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef ARM_COMPUTE_SUPPORT_TOOLCHAINSUPPORT -#define ARM_COMPUTE_SUPPORT_TOOLCHAINSUPPORT +#ifndef ACL_SUPPORT_TOOLCHAINSUPPORT_H +#define ACL_SUPPORT_TOOLCHAINSUPPORT_H #include "support/Bfloat16.h" #include "support/Half.h" @@ -184,8 +184,7 @@ inline T nearbyint(T value) template ::value>::type> inline T round(T value) { - //Workaround Valgrind's mismatches: when running from Valgrind the call to std::round(-4.500000) == -4.000000 instead of 5.00000 - return (value < 0.f) ? static_cast(value - 0.5f) : static_cast(value + 0.5f); + return std::round(value); } /** Round floating-point value with half value rounding away from zero and cast to long @@ -331,4 +330,4 @@ inline bool signbit(bfloat16 value) } // namespace cpp11 } // namespace support } // namespace arm_compute -#endif /* ARM_COMPUTE_SUPPORT_TOOLCHAINSUPPORT */ +#endif // ACL_SUPPORT_TOOLCHAINSUPPORT_H -- cgit v1.2.1