aboutsummaryrefslogtreecommitdiff
path: root/delegate/test/UnidirectionalSequenceLstmTestHelper.hpp
diff options
context:
space:
mode:
authorColm Donelan <colm.donelan@arm.com>2024-01-22 10:07:14 +0000
committerTeresaARM <teresa.charlinreyes@arm.com>2024-02-07 15:37:05 +0000
commit7bcae3c835468d9b0770514dc7127f02d47cec5f (patch)
tree03fe2da7324715be89c1c0ba476b083558c158ed /delegate/test/UnidirectionalSequenceLstmTestHelper.hpp
parenta52bca23d225144e92f521341718a70489d5c217 (diff)
downloadarmnn-7bcae3c835468d9b0770514dc7127f02d47cec5f.tar.gz
IVGCVSW-7675 Rework more DelegateUnitTests so backends are subcases.
The intent of this change is to remove the per backend test cases in the delegate unit tests. They will be replaced by using DocTest SUBCASES. The sub cases are paramaterized by the available backends. The list of available backends are determined by the compilation flags. Signed-off-by: Colm Donelan <colm.donelan@arm.com> Change-Id: I6dd0369491c4582b8e2467b911dfd085dddcf576
Diffstat (limited to 'delegate/test/UnidirectionalSequenceLstmTestHelper.hpp')
-rw-r--r--delegate/test/UnidirectionalSequenceLstmTestHelper.hpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/delegate/test/UnidirectionalSequenceLstmTestHelper.hpp b/delegate/test/UnidirectionalSequenceLstmTestHelper.hpp
index c27f8d854b..a47d80ea5d 100644
--- a/delegate/test/UnidirectionalSequenceLstmTestHelper.hpp
+++ b/delegate/test/UnidirectionalSequenceLstmTestHelper.hpp
@@ -1,5 +1,5 @@
//
-// Copyright © 2021, 2023 Arm Ltd and Contributors. All rights reserved.
+// Copyright © 2021, 2023-2024 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
@@ -10,13 +10,8 @@
#include <armnn_delegate.hpp>
#include <DelegateTestInterpreter.hpp>
-#include <flatbuffers/flatbuffers.h>
-#include <tensorflow/lite/kernels/register.h>
#include <tensorflow/lite/version.h>
-#include <doctest/doctest.h>
-
-#include <armnn/utility/IgnoreUnused.hpp>
#include <armnn/utility/NumericCast.hpp>
#include <armnn/TypesUtils.hpp>
@@ -573,8 +568,7 @@ std::vector<char> CreateUnidirectionalSequenceLstmTfLiteModel(tflite::TensorType
}
template<typename T>
-void UnidirectionalSequenceLstmTestImpl(std::vector<armnn::BackendId>& backends,
- tflite::TensorType tensorType,
+void UnidirectionalSequenceLstmTestImpl(tflite::TensorType tensorType,
int32_t batchSize,
int32_t timeSize,
int32_t inputSize,
@@ -619,6 +613,7 @@ void UnidirectionalSequenceLstmTestImpl(std::vector<armnn::BackendId>& backends,
float clippingThresCell,
float clippingThresProj,
bool isTimeMajor,
+ const std::vector<armnn::BackendId>& backends = {},
float quantScale = 0.1f)
{
using namespace delegateTestInterpreter;
@@ -687,7 +682,7 @@ void UnidirectionalSequenceLstmTestImpl(std::vector<armnn::BackendId>& backends,
std::vector<int32_t> tfLiteOutputShape = tfLiteInterpreter.GetOutputShape(0);
// Setup interpreter with Arm NN Delegate applied.
- auto armnnInterpreter = DelegateTestInterpreter(modelBuffer, backends);
+ auto armnnInterpreter = DelegateTestInterpreter(modelBuffer, CaptureAvailableBackends(backends));
CHECK(armnnInterpreter.AllocateTensors() == kTfLiteOk);
CHECK(armnnInterpreter.FillInputTensor<float>(inputValues, 0) == kTfLiteOk);
CHECK(armnnInterpreter.Invoke() == kTfLiteOk);