aboutsummaryrefslogtreecommitdiff
path: root/delegate/src/test/Pooling2dTestHelper.hpp
diff options
context:
space:
mode:
authorJan Eilers <jan.eilers@arm.com>2020-11-17 19:06:35 +0000
committerFrancis Murtagh <francis.murtagh@arm.com>2020-11-18 13:28:01 +0000
commit3812fbc78080a9b2493deeaf210d9580417c6c1c (patch)
tree6c737f8345dedfb95ab84bbe0a6fd07b53cfb6af /delegate/src/test/Pooling2dTestHelper.hpp
parent06d2d1b2012389a22688e070dadb9639f80fbec8 (diff)
downloadarmnn-3812fbc78080a9b2493deeaf210d9580417c6c1c.tar.gz
IVGCVSW-5543 Fix delegate Pooling2d failures on CpuAcc/GpuAcc
* Added tolerance when comparing data * Removed unsupported int16 tests Signed-off-by: Jan Eilers <jan.eilers@arm.com> Change-Id: I10f3ac26b894bb1da3af61bfe2d2a41c2f5d2bb1
Diffstat (limited to 'delegate/src/test/Pooling2dTestHelper.hpp')
-rw-r--r--delegate/src/test/Pooling2dTestHelper.hpp22
1 files changed, 3 insertions, 19 deletions
diff --git a/delegate/src/test/Pooling2dTestHelper.hpp b/delegate/src/test/Pooling2dTestHelper.hpp
index f107d9473f..c2c7be7955 100644
--- a/delegate/src/test/Pooling2dTestHelper.hpp
+++ b/delegate/src/test/Pooling2dTestHelper.hpp
@@ -5,6 +5,8 @@
#pragma once
+#include "TestUtils.hpp"
+
#include <armnn_delegate.hpp>
#include <flatbuffers/flatbuffers.h>
@@ -183,26 +185,8 @@ void Pooling2dTest(tflite::BuiltinOperator poolingOperatorCode,
// Run EnqueueWorkload
CHECK(tfLiteInterpreter->Invoke() == kTfLiteOk);
CHECK(armnnDelegateInterpreter->Invoke() == kTfLiteOk);
- // Compare output data
- auto tfLiteDelegateOutputId = tfLiteInterpreter->outputs()[0];
- auto tfLiteDelegateOutputData = tfLiteInterpreter->typed_tensor<T>(tfLiteDelegateOutputId);
- auto tfLiteDelegateOutputTensor = tfLiteInterpreter->tensor(tfLiteDelegateOutputId);
- auto armnnDelegateOutputId = armnnDelegateInterpreter->outputs()[0];
- auto armnnDelegateOutputData = armnnDelegateInterpreter->typed_tensor<T>(armnnDelegateOutputId);
- auto armnnDelegateOutputTensor = armnnDelegateInterpreter->tensor(armnnDelegateOutputId);
-
- for (size_t i = 0; i < static_cast<size_t>(tfLiteDelegateOutputTensor->dims->size); i++)
- {
- CHECK(outputShape[i] == armnnDelegateOutputTensor->dims->data[i]);
- CHECK(tfLiteDelegateOutputTensor->dims->data[i] == armnnDelegateOutputTensor->dims->data[i]);
- }
- for (size_t i = 0; i < expectedOutputValues.size(); i++)
- {
- CHECK(expectedOutputValues[i] == armnnDelegateOutputData[i]);
- CHECK(tfLiteDelegateOutputData[i] == expectedOutputValues[i]);
- CHECK(tfLiteDelegateOutputData[i] == armnnDelegateOutputData[i]);
- }
+ armnnDelegate::CompareOutputData(tfLiteInterpreter, armnnDelegateInterpreter, outputShape, expectedOutputValues);
}
} // anonymous namespace