diff options
author | Colm Donelan <colm.donelan@arm.com> | 2024-01-22 10:07:14 +0000 |
---|---|---|
committer | TeresaARM <teresa.charlinreyes@arm.com> | 2024-02-07 15:37:05 +0000 |
commit | 7bcae3c835468d9b0770514dc7127f02d47cec5f (patch) | |
tree | 03fe2da7324715be89c1c0ba476b083558c158ed /delegate/test/ResizeTest.cpp | |
parent | a52bca23d225144e92f521341718a70489d5c217 (diff) | |
download | armnn-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/ResizeTest.cpp')
-rw-r--r-- | delegate/test/ResizeTest.cpp | 67 |
1 files changed, 9 insertions, 58 deletions
diff --git a/delegate/test/ResizeTest.cpp b/delegate/test/ResizeTest.cpp index 95f4d93e59..de042db512 100644 --- a/delegate/test/ResizeTest.cpp +++ b/delegate/test/ResizeTest.cpp @@ -1,25 +1,16 @@ // -// Copyright © 2020, 2023 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2020, 2023-2024 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // #include "ResizeTestHelper.hpp" -#include <armnn_delegate.hpp> - -#include <flatbuffers/flatbuffers.h> -#include <tensorflow/lite/interpreter.h> -#include <tensorflow/lite/kernels/register.h> -#include <tensorflow/lite/model.h> - -#include <tensorflow/lite/version.h> - #include <doctest/doctest.h> namespace armnnDelegate { -void ResizeBiliniarFloat32Test(std::vector<armnn::BackendId>& backends) +void ResizeBiliniarFloat32Test(const std::vector<armnn::BackendId>& backends = {}) { // Set input data std::vector<float> input1Values @@ -45,7 +36,6 @@ void ResizeBiliniarFloat32Test(std::vector<armnn::BackendId>& backends) const std::vector<int32_t> expectedOutputShape = { 1, 5, 5, 1 }; ResizeFP32TestImpl(tflite::BuiltinOperator_RESIZE_BILINEAR, - backends, input1Values, input1Shape, input2NewShape, @@ -54,7 +44,7 @@ void ResizeBiliniarFloat32Test(std::vector<armnn::BackendId>& backends) expectedOutputShape); } -void ResizeNearestNeighbourFloat32Test(std::vector<armnn::BackendId>& backends) +void ResizeNearestNeighbourFloat32Test(const std::vector<armnn::BackendId>& backends = {}) { // Set input data std::vector<float> input1Values { 1.0f, 2.0f, 3.0f, 4.0f } @@ -69,7 +59,6 @@ void ResizeNearestNeighbourFloat32Test(std::vector<armnn::BackendId>& backends) const std::vector<int32_t> expectedOutputShape = { 1, 1, 1, 1 }; ResizeFP32TestImpl(tflite::BuiltinOperator_RESIZE_NEAREST_NEIGHBOR, - backends, input1Values, input1Shape, input2NewShape, @@ -78,57 +67,19 @@ void ResizeNearestNeighbourFloat32Test(std::vector<armnn::BackendId>& backends) expectedOutputShape); } -TEST_SUITE("ResizeTests_GpuAccTests") -{ - -TEST_CASE ("Resize_Biliniar_Float32_GpuAcc_Test") -{ - std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; - ResizeBiliniarFloat32Test(backends); -} - -TEST_CASE ("Resize_NearestNeighbour_Float32_GpuAcc_Test") -{ - std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; - ResizeNearestNeighbourFloat32Test(backends); -} - -} // TEST_SUITE("ResizeTests_GpuAccTests") - - -TEST_SUITE("ResizeTests_CpuAccTests") -{ - -TEST_CASE ("Resize_Biliniar_Float32_CpuAcc_Test") -{ - std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; - ResizeBiliniarFloat32Test(backends); -} - -TEST_CASE ("Resize_NearestNeighbour_Float32_CpuAcc_Test") -{ - std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; - ResizeNearestNeighbourFloat32Test(backends); -} - -} // TEST_SUITE("ResizeTests_CpuAccTests") - - -TEST_SUITE("ResizeTests_CpuRefTests") +TEST_SUITE("ResizeTestsTests") { -TEST_CASE ("Resize_Biliniar_Float32_CpuRef_Test") +TEST_CASE ("Resize_Biliniar_Float32_Test") { - std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; - ResizeBiliniarFloat32Test(backends); + ResizeBiliniarFloat32Test(); } -TEST_CASE ("Resize_NearestNeighbour_Float32_CpuRef_Test") +TEST_CASE ("Resize_NearestNeighbour_Float32_Test") { - std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; - ResizeNearestNeighbourFloat32Test(backends); + ResizeNearestNeighbourFloat32Test(); } -} // TEST_SUITE("ResizeTests_CpuRefTests") +} // TEST_SUITE("ResizeTestsTests") } // namespace armnnDelegate |