aboutsummaryrefslogtreecommitdiff
path: root/src/backends/backendsCommon/test/EndToEndTestImpl.hpp
diff options
context:
space:
mode:
authorMike Kelly <mike.kelly@arm.com>2021-03-29 15:04:50 +0100
committermike.kelly <mike.kelly@arm.com>2021-03-29 14:03:30 +0000
commit386ff1a721cdca3689b009ba31f2d3ac8bea2fae (patch)
treee2f5c26ab2601fd0be8c1223111f55cf1ff94e6e /src/backends/backendsCommon/test/EndToEndTestImpl.hpp
parent23dbe3d3ff51c2b297ce5bf6360da6552f1c3bf5 (diff)
downloadarmnn-386ff1a721cdca3689b009ba31f2d3ac8bea2fae.tar.gz
IVGCVSW-5790 Merge async prototype
* Added thread safe execution mechanism for armnn * Removed duplicate function bool Compare(T a, T b, float tolerance) * Added StridedSliceAsyncEndToEndTest * Fixed memory leak Signed-off-by: Mike Kelly <mike.kelly@arm.com> Change-Id: I2d367fc77ee7c01b8953138543e76af5e691211f
Diffstat (limited to 'src/backends/backendsCommon/test/EndToEndTestImpl.hpp')
-rw-r--r--src/backends/backendsCommon/test/EndToEndTestImpl.hpp19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/backends/backendsCommon/test/EndToEndTestImpl.hpp b/src/backends/backendsCommon/test/EndToEndTestImpl.hpp
index 9ce42019f0..3a757d0c59 100644
--- a/src/backends/backendsCommon/test/EndToEndTestImpl.hpp
+++ b/src/backends/backendsCommon/test/EndToEndTestImpl.hpp
@@ -4,6 +4,8 @@
//
#pragma once
+#include "CommonTestUtils.hpp"
+
#include <armnn/Descriptors.hpp>
#include <armnn/INetwork.hpp>
#include <armnn/IRuntime.hpp>
@@ -105,23 +107,6 @@ inline bool ConstantUsageUint8Test(const std::vector<BackendId>& backends)
);
}
-// Utility template for comparing tensor elements
-template<DataType ArmnnType, typename T = ResolveType<ArmnnType>>
-bool Compare(T a, T b, float tolerance = 0.000001f)
-{
- if (ArmnnType == DataType::Boolean)
- {
- // NOTE: Boolean is represented as uint8_t (with zero equals
- // false and everything else equals true), therefore values
- // need to be casted to bool before comparing them
- return static_cast<bool>(a) == static_cast<bool>(b);
- }
-
- // NOTE: All other types can be cast to float and compared with
- // a certain level of tolerance
- return std::fabs(static_cast<float>(a) - static_cast<float>(b)) <= tolerance;
-}
-
// Utility function to find the number of instances of a substring within a string.
int SubStringCounter(std::string& string, std::string&& substring)
{