From 653b96c9a72b2b6d4d82d6ee67b51be66351c617 Mon Sep 17 00:00:00 2001 From: Pablo Marquez Tello Date: Tue, 11 Jul 2023 15:15:46 +0100 Subject: Improved Argminmax testing * Added some corner cases for tiny 1D shapes that caused failures. * Removed unnecessary includes from the test. * Partially resolves COMPMID-6164 Change-Id: I4dfb444715ae389088b9e0aa99c8ac3e8d00d6ae Signed-off-by: Pablo Marquez Tello Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9900 Reviewed-by: Gunes Bayir Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins --- tests/validation/CL/ArgMinMax.cpp | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/tests/validation/CL/ArgMinMax.cpp b/tests/validation/CL/ArgMinMax.cpp index 1d849ed0c7..9bfd9d92c1 100644 --- a/tests/validation/CL/ArgMinMax.cpp +++ b/tests/validation/CL/ArgMinMax.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2021 Arm Limited. + * Copyright (c) 2018-2021, 2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -22,15 +22,11 @@ * SOFTWARE. */ #include "arm_compute/core/Types.h" -#include "arm_compute/core/utils/misc/ShapeCalculator.h" #include "arm_compute/runtime/CL/CLTensor.h" #include "arm_compute/runtime/CL/CLTensorAllocator.h" #include "arm_compute/runtime/CL/functions/CLArgMinMaxLayer.h" -#include "arm_compute/runtime/CL/functions/CLReductionOperation.h" #include "tests/CL/CLAccessor.h" #include "tests/datasets/ShapeDatasets.h" -#include "tests/datasets/SplitDataset.h" -#include "tests/framework/Asserts.h" #include "tests/framework/Macros.h" #include "tests/validation/Validation.h" #include "tests/validation/fixtures/ArgMinMaxFixture.h" @@ -46,6 +42,8 @@ namespace const auto ArgMinMaxSmallDataset = framework::dataset::make("Shape", { TensorShape{ 1U, 7U, 1U, 3U }, + TensorShape{ 3U, 1U, 3U, 2U }, + TensorShape{ 2U, 1U, 3U, 2U }, TensorShape{ 149U, 5U, 1U, 2U }, TensorShape{ 166U, 5U, 1U, 2U }, TensorShape{ 322U, 5U, 1U, 2U }, @@ -53,6 +51,18 @@ const auto ArgMinMaxSmallDataset = framework::dataset::make("Shape", TensorShape{ 2560, 2U, 2U, 2U }, }); +const auto ArgMinMaxSmallDatasetAxis0 = framework::dataset::make("Shape", +{ + TensorShape{ 1U, 5U }, + TensorShape{ 2U, 3U }, + TensorShape{ 1U }, + TensorShape{ 3U }, + TensorShape{ 2U }, + TensorShape{ 5U }, + TensorShape{ 17U }, + TensorShape{ 15U, 2U }, +}); + const auto ArgMinMaxLargeDataset = framework::dataset::make("Shape", { TensorShape{ 517U, 123U, 13U, 2U } }); } // namespace @@ -89,6 +99,16 @@ template using CLArgMinMaxValidationFixture = ArgMinMaxValidationFixture; TEST_SUITE(S32) +FIXTURE_DATA_TEST_CASE(RunSmallAxis0, + CLArgMinMaxValidationFixture, + framework::DatasetMode::PRECOMMIT, + combine(combine(combine(ArgMinMaxSmallDatasetAxis0, framework::dataset::make("DataType", DataType::S32)), framework::dataset::make("Axis", { 0 })), + framework::dataset::make("Operation", { ReductionOperation::ARG_IDX_MIN, ReductionOperation::ARG_IDX_MAX }))) +{ + // Validate output + validate(CLAccessor(_target), _reference); +} + FIXTURE_DATA_TEST_CASE(RunSmall, CLArgMinMaxValidationFixture, framework::DatasetMode::PRECOMMIT, -- cgit v1.2.1