aboutsummaryrefslogtreecommitdiff
path: root/delegate/src/test/TestUtils.cpp
diff options
context:
space:
mode:
authorJan Eilers <jan.eilers@arm.com>2020-11-18 10:36:46 +0000
committerJim Flynn <jim.flynn@arm.com>2020-11-19 23:43:11 +0000
commitfe73b04129697dfeaebfb37015ce1b19c9a56101 (patch)
treede19447f9d070e2726e951cb7679655ea04b23da /delegate/src/test/TestUtils.cpp
parentbe25d94aefe53f221304b1f5f344913b708f808b (diff)
downloadarmnn-fe73b04129697dfeaebfb37015ce1b19c9a56101.tar.gz
IVGCVSW-5545 Fix delegate Comparison failures on CpuAcc/GpuAcc
* Create backend test suite structure * Add special compare function for boolean values Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: I55a2ae1ac6ad21cdcdd5ae99ef56ed00fa24776f
Diffstat (limited to 'delegate/src/test/TestUtils.cpp')
-rw-r--r--delegate/src/test/TestUtils.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/delegate/src/test/TestUtils.cpp b/delegate/src/test/TestUtils.cpp
index cf3e1fee6b..31c05a678d 100644
--- a/delegate/src/test/TestUtils.cpp
+++ b/delegate/src/test/TestUtils.cpp
@@ -8,6 +8,26 @@
namespace armnnDelegate
{
+
+
+void CompareData(bool tensor1[], bool tensor2[], size_t tensorSize)
+{
+ auto compareBool = [](auto a, auto b) {return (((a == 0) && (b == 0)) || ((a != 0) && (b != 0)));};
+ for (size_t i = 0; i < tensorSize; i++)
+ {
+ CHECK(compareBool(tensor1[i], tensor2[i]));
+ }
+}
+
+void CompareData(std::vector<bool>& tensor1, bool tensor2[], size_t tensorSize)
+{
+ auto compareBool = [](auto a, auto b) {return (((a == 0) && (b == 0)) || ((a != 0) && (b != 0)));};
+ for (size_t i = 0; i < tensorSize; i++)
+ {
+ CHECK(compareBool(tensor1[i], tensor2[i]));
+ }
+}
+
void CompareData(float tensor1[], float tensor2[], size_t tensorSize)
{
for (size_t i = 0; i < tensorSize; i++)