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/SpaceDepthTest.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/SpaceDepthTest.cpp')
-rw-r--r-- | delegate/test/SpaceDepthTest.cpp | 118 |
1 files changed, 21 insertions, 97 deletions
diff --git a/delegate/test/SpaceDepthTest.cpp b/delegate/test/SpaceDepthTest.cpp index 6cffba33eb..add51b4a21 100644 --- a/delegate/test/SpaceDepthTest.cpp +++ b/delegate/test/SpaceDepthTest.cpp @@ -1,20 +1,16 @@ // -// 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 // #include "SpaceDepthTestHelper.hpp" -#include <armnn_delegate.hpp> - -#include <flatbuffers/flatbuffers.h> - #include <doctest/doctest.h> namespace armnnDelegate { -void DepthToSpaceFp32Test(std::vector<armnn::BackendId>& backends, int blockSize) +void DepthToSpaceFp32Test(int blockSize) { // Set input data std::vector<int32_t> inputShape { 1, 2, 2, 4 }; @@ -32,15 +28,15 @@ void DepthToSpaceFp32Test(std::vector<armnn::BackendId>& backends, int blockSize SpaceDepthTest<float>(tflite::BuiltinOperator_DEPTH_TO_SPACE, ::tflite::TensorType_FLOAT32, - backends, inputShape, outputShape, inputValues, expectedOutputValues, + {}, blockSize); } -void DepthToSpaceUint8Test(std::vector<armnn::BackendId>& backends, int blockSize) +void DepthToSpaceUint8Test(int blockSize) { // Set input data std::vector<int32_t> inputShape { 2, 1, 1, 4 }; @@ -54,15 +50,15 @@ void DepthToSpaceUint8Test(std::vector<armnn::BackendId>& backends, int blockSiz SpaceDepthTest<uint8_t>(tflite::BuiltinOperator_DEPTH_TO_SPACE, ::tflite::TensorType_UINT8, - backends, inputShape, outputShape, inputValues, expectedOutputValues, + {}, blockSize); } -void SpaceToDepthFp32Test(std::vector<armnn::BackendId>& backends, int blockSize) +void SpaceToDepthFp32Test(int blockSize) { // Set input data std::vector<int32_t> inputShape { 1, 2, 2, 2 }; @@ -73,15 +69,15 @@ void SpaceToDepthFp32Test(std::vector<armnn::BackendId>& backends, int blockSize SpaceDepthTest<float>(tflite::BuiltinOperator_SPACE_TO_DEPTH, ::tflite::TensorType_FLOAT32, - backends, inputShape, outputShape, inputValues, expectedOutputValues, + {}, blockSize); } -void SpaceToDepthUint8Test(std::vector<armnn::BackendId>& backends, int blockSize) +void SpaceToDepthUint8Test(int blockSize) { // Set input data std::vector<int32_t> inputShape { 1, 2, 2, 1 }; @@ -92,115 +88,43 @@ void SpaceToDepthUint8Test(std::vector<armnn::BackendId>& backends, int blockSiz SpaceDepthTest<uint8_t>(tflite::BuiltinOperator_SPACE_TO_DEPTH, ::tflite::TensorType_UINT8, - backends, inputShape, outputShape, inputValues, expectedOutputValues, + {}, blockSize); } -TEST_SUITE("DepthToSpace_CpuRefTests") -{ - -TEST_CASE ("DepthToSpaceFp32Test_CpuRef_Test") -{ - std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; - DepthToSpaceFp32Test(backends, 2); -} - -TEST_CASE ("DepthToSpaceUint8Test_CpuRef_Test") -{ - std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; - DepthToSpaceUint8Test(backends, 2); -} - -} // TEST_SUITE("DepthToSpace_CpuRefTests") - - -TEST_SUITE("DepthToSpace_CpuAccTests") -{ - -TEST_CASE ("DepthToSpaceFp32Test_CpuAcc_Test") -{ - std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; - DepthToSpaceFp32Test(backends, 2); -} - -TEST_CASE ("DepthToSpaceUint8Test_CpuAcc_Test") -{ - std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; - DepthToSpaceUint8Test(backends, 2); -} - -} // TEST_SUITE("DepthToSpace_CpuAccTests") - -TEST_SUITE("DepthToSpace_GpuAccTests") +TEST_SUITE("DepthToSpaceTests") { -TEST_CASE ("DepthToSpaceFp32Test_GpuAcc_Test") -{ - std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; - DepthToSpaceFp32Test(backends, 2); -} - -TEST_CASE ("DepthToSpaceUint8Test_GpuAcc_Test") +TEST_CASE ("DepthToSpaceFp32Test_Test") { - std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; - DepthToSpaceUint8Test(backends, 2); + DepthToSpaceFp32Test(2); } -} // TEST_SUITE("DepthToSpace_GpuAccTests") - -TEST_SUITE("SpaceToDepth_CpuRefTests") -{ - -TEST_CASE ("SpaceToDepthFp32Test_CpuRef_Test") +TEST_CASE ("DepthToSpaceUint8Test_Test") { - std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; - SpaceToDepthFp32Test(backends, 2); + DepthToSpaceUint8Test(2); } -TEST_CASE ("SpaceToDepthUint8Test_CpuRef_Test") -{ - std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; - SpaceToDepthUint8Test(backends, 2); -} - -} // TEST_SUITE("SpaceToDepth_CpuRefTests") - -TEST_SUITE("SpaceToDepth_CpuAccTests") -{ - -TEST_CASE ("SpaceToDepthFp32Test_CpuAcc_Test") -{ - std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; - SpaceToDepthFp32Test(backends, 2); -} - -TEST_CASE ("SpaceToDepthUint8Test_CpuAcc_Test") -{ - std::vector<armnn::BackendId> backends = { armnn::Compute::CpuAcc }; - SpaceToDepthUint8Test(backends, 2); -} +} // TEST_SUITE("DepthToSpaceTests") -} // TEST_SUITE("SpaceToDepth_CpuAccTests") -TEST_SUITE("SpaceToDepth_GpuAccTests") +TEST_SUITE("SpaceToDepthTests") { -TEST_CASE ("SpaceToDepthFp32Test_GpuAcc_Test") +TEST_CASE ("SpaceToDepthFp32Test_Test") { - std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; - SpaceToDepthFp32Test(backends, 2); + SpaceToDepthFp32Test(2); } -TEST_CASE ("SpaceToDepthUint8Test_GpuAcc_Test") +TEST_CASE ("SpaceToDepthUint8Test_Test") { - std::vector<armnn::BackendId> backends = { armnn::Compute::GpuAcc }; - SpaceToDepthUint8Test(backends, 2); + SpaceToDepthUint8Test(2); } -} // TEST_SUITE("SpaceToDepth_GpuAccTests") +} // TEST_SUITE("SpaceToDepthTests") } // namespace armnnDelegate |