aboutsummaryrefslogtreecommitdiff
path: root/delegate/src/test/TestUtils.cpp
diff options
context:
space:
mode:
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++)