aboutsummaryrefslogtreecommitdiff
path: root/delegate/src/test/TestUtils.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'delegate/src/test/TestUtils.hpp')
-rw-r--r--delegate/src/test/TestUtils.hpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/delegate/src/test/TestUtils.hpp b/delegate/src/test/TestUtils.hpp
index b165920762..ad7600d27e 100644
--- a/delegate/src/test/TestUtils.hpp
+++ b/delegate/src/test/TestUtils.hpp
@@ -5,10 +5,15 @@
#pragma once
+#include <tensorflow/lite/c/common.h>
#include <tensorflow/lite/interpreter.h>
#include <doctest/doctest.h>
+#include <half/half.hpp>
+
+using Half = half_float::half;
+
namespace armnnDelegate
{
@@ -43,6 +48,14 @@ void CompareData(uint8_t tensor1[], uint8_t tensor2[], size_t tensorSize);
/// Can be used to compare int16_t data coming from a tflite interpreter with a tolerance of 1
void CompareData(int16_t tensor1[], int16_t tensor2[], size_t tensorSize);
+/// Can be used to compare Half (Float16) data with a tolerance of limit_of_float*100
+void CompareData(Half tensor1[], Half tensor2[], size_t tensorSize);
+
+/// Can be used to compare TfLiteFloat16 data coming from a tflite interpreter
+void CompareData(TfLiteFloat16 tensor1[], TfLiteFloat16 tensor2[], size_t tensorSize);
+
+/// Can be used to compare Half (Float16) data and TfLiteFloat16 data coming from a tflite interpreter
+void CompareData(TfLiteFloat16 tensor1[], Half tensor2[], size_t tensorSize);
/// Can be used to compare the output tensor shape and values
/// from armnnDelegateInterpreter and tfLiteInterpreter.