aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTeresa Charlin <teresa.charlinreyes@arm.com>2023-12-19 15:49:31 +0000
committerTeresaARM <teresa.charlinreyes@arm.com>2024-01-02 15:07:09 +0000
commit28658bc2ac3a3d6f6e791c35003316a06d6b00ba (patch)
tree2c13cb06ad6f87df88604c3edb9401d8f9536c92 /include
parent58a492395ea46e51fbd87511c474239e9fdb3f2c (diff)
downloadarmnn-28658bc2ac3a3d6f6e791c35003316a06d6b00ba.tar.gz
Fix for Resize with align corners = true creates a memory leak when using valgrind
* Add end to end unit test to CpuRef, CpuAcc and GpuAcc backends Resolves: IVGCVSW-8193 Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: I7be226f084ec814ac72c2c9b3c47c07b3baf0aa5
Diffstat (limited to 'include')
-rw-r--r--include/armnn/Utils.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/armnn/Utils.hpp b/include/armnn/Utils.hpp
index 7c1f096823..8976b38ecc 100644
--- a/include/armnn/Utils.hpp
+++ b/include/armnn/Utils.hpp
@@ -5,6 +5,7 @@
#pragma once
#include <string>
+#include <cmath>
namespace armnn
{
@@ -39,4 +40,10 @@ bool NeonDetected();
const std::string GetVersion();
+inline float roundf(float value)
+{
+ // Workaround Valgrind's mismatches: when running from Valgrind the call to std::round(4.5) == 4.0 instead of 5.0
+ return (value < 0.f) ? ::floorf(value - 0.5f) : ::floorf(value + 0.5f);
+}
+
} // namespace armnn