From 61ef5bf586606d6282526641cf2244121d07c6fd Mon Sep 17 00:00:00 2001 From: Diego Lopez Recas Date: Mon, 11 Dec 2017 12:36:55 +0000 Subject: IVGCVSW-847 Fix {NEON/CL}PoolingLayerKernel config Also, add validation test that hits the discovered failure for CL. Change-Id: I5573e0a3f169b85d5fb7299e7c48d74be7165208 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/112717 Tested-by: Jenkins Reviewed-by: Anthony Barbier --- tests/framework/datasets/JoinDataset.h | 12 +++++++----- tests/validation/CL/PoolingLayer.cpp | 17 ++++++++++++++--- 2 files changed, 21 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/framework/datasets/JoinDataset.h b/tests/framework/datasets/JoinDataset.h index eded6e0259..d682c19d6b 100644 --- a/tests/framework/datasets/JoinDataset.h +++ b/tests/framework/datasets/JoinDataset.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -47,8 +47,10 @@ template class JoinDataset : public Dataset { private: - using iter1_type = typename T::iterator; - using iter2_type = typename U::iterator; + using T_noref = typename std::remove_reference::type; + using U_noref = typename std::remove_reference::type; + using iter1_type = typename T_noref::iterator; + using iter2_type = typename U_noref::iterator; public: /** Construct dataset from the given datasets. @@ -65,12 +67,12 @@ public: JoinDataset(JoinDataset &&) = default; /** Type of the dataset. */ - using type = typename T::type; + using type = typename T_noref::type; /** Iterator for the dataset. */ struct iterator { - iterator(const T *dataset1, const U *dataset2) + iterator(const T_noref *dataset1, const U_noref *dataset2) : _iter1{ dataset1->begin() }, _iter2{ dataset2->begin() }, _first_size{ dataset1->size() } { } diff --git a/tests/validation/CL/PoolingLayer.cpp b/tests/validation/CL/PoolingLayer.cpp index ee639376c5..4e5e5aa2e7 100644 --- a/tests/validation/CL/PoolingLayer.cpp +++ b/tests/validation/CL/PoolingLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -43,6 +43,12 @@ namespace validation { namespace { +/** Failing data set */ +const auto PoolingLayerDatasetSpecial = ((((framework::dataset::make("Shape", TensorShape{ 60U, 52U, 3U, 5U }) + * framework::dataset::make("PoolType", PoolingType::AVG)) + * framework::dataset::make("PoolingSize", 100)) + * framework::dataset::make("PadStride", PadStrideInfo(5, 5, 50, 50))) + * framework::dataset::make("ExcludePadding", true)); /** Input data set for floating-point data types */ const auto PoolingLayerDatasetFP = combine(combine(combine(datasets::PoolingTypes(), framework::dataset::make("PoolingSize", { 2, 3, 4, 7, 9 })), framework::dataset::make("PadStride", { PadStrideInfo(1, 1, 0, 0), PadStrideInfo(2, 1, 0, 0), PadStrideInfo(1, 2, 1, 1), PadStrideInfo(2, 2, 1, 0) })), @@ -74,7 +80,7 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32, 0), // Mismatching data type TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32, 0), // Window shrink TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::QS8, 4), // Mismatching fixed point position - TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::QS16, 11), // Window shrink + TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::QS16, 11), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32, 0), // Invalid pad/size combination TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32, 0), // Invalid pad/size combination TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::QASYMM8, 0), // Invalid parameters @@ -104,7 +110,7 @@ DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( PoolingLayerInfo(PoolingType::MAX), PoolingLayerInfo(PoolingType::AVG), })), - framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, false, true })), + framework::dataset::make("Expected", { false, false, false, true, false, false, false, false, false, true })), input_info, output_info, pool_info, expected) { ARM_COMPUTE_EXPECT(bool(CLPoolingLayer::validate(&input_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), pool_info)) == expected, framework::LogLevel::ERRORS); @@ -117,6 +123,11 @@ using CLPoolingLayerFixture = PoolingLayerValidationFixture, framework::DatasetMode::ALL, PoolingLayerDatasetSpecial * framework::dataset::make("DataType", DataType::F32)) +{ + // Validate output + validate(CLAccessor(_target), _reference, tolerance_f32); +} FIXTURE_DATA_TEST_CASE(RunSmall, CLPoolingLayerFixture, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), combine(PoolingLayerDatasetFP, framework::dataset::make("DataType", DataType::F32)))) { -- cgit v1.2.1