ramelg01 | 3751569 | 2022-02-26 22:06:20 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2022 Arm Limited. |
| 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
| 24 | |
| 25 | #include "arm_compute/core/TensorShape.h" |
| 26 | #include "tests/framework/datasets/Datasets.h" |
| 27 | |
| 28 | #include "arm_compute/core/Types.h" |
| 29 | #include "arm_compute/runtime/CL/CLTensor.h" |
| 30 | #include "arm_compute/runtime/CL/CLTensorAllocator.h" |
| 31 | #include "arm_compute/runtime/CL/functions/CLPooling3dLayer.h" |
| 32 | #include "tests/CL/CLAccessor.h" |
| 33 | #include "tests/PaddingCalculator.h" |
| 34 | #include "tests/datasets/Pooling3dLayerDataset.h" |
| 35 | #include "tests/datasets/PoolingTypesDataset.h" |
| 36 | #include "tests/datasets/ShapeDatasets.h" |
| 37 | #include "tests/framework/Asserts.h" |
| 38 | #include "tests/framework/Macros.h" |
| 39 | #include "tests/framework/datasets/Datasets.h" |
| 40 | #include "tests/validation/Validation.h" |
| 41 | #include "tests/validation/fixtures/Pooling3dLayerFixture.h" |
| 42 | |
| 43 | namespace arm_compute |
| 44 | { |
| 45 | namespace test |
| 46 | { |
| 47 | namespace validation |
| 48 | { |
| 49 | namespace |
| 50 | { |
| 51 | /** Input data sets for floating-point data types */ |
| 52 | const auto Pooling3dLayerDatasetFP = combine(combine(combine(combine(datasets::PoolingTypes(), framework::dataset::make("PoolingSize", { Size3D(2, 3, 2) })), |
| 53 | framework::dataset::make("Stride", { Size3D(1, 1, 1), Size3D(2, 1, 1), Size3D(1, 2, 1), Size3D(2, 2, 1) })), |
| 54 | framework::dataset::make("Padding", { Padding3D(0, 1, 0), Padding3D(1, 1, 1) })), |
| 55 | framework::dataset::make("ExcludePadding", { true, false })); |
| 56 | |
| 57 | const auto Pooling3dLayerDatasetFPSmall = combine(combine(combine(combine(datasets::PoolingTypes(), framework::dataset::make("PoolingSize", { Size3D(2, 2, 2), Size3D(3, 3, 3) })), |
| 58 | framework::dataset::make("Stride", { Size3D(2, 2, 2), Size3D(2, 1, 1) })), |
| 59 | framework::dataset::make("Padding", { Padding3D(0, 0, 0), Padding3D(1, 1, 1), Padding3D(1, 0, 0) })), |
| 60 | framework::dataset::make("ExcludePadding", { true, false })); |
| 61 | |
Mohammed Suhail Munshi | 5e549fa | 2022-03-16 11:14:06 +0000 | [diff] [blame^] | 62 | const auto Pooling3DLayerDatasetQuantized = combine(combine(combine(combine(framework::dataset::make("PoolingType", { PoolingType::MAX, PoolingType::AVG }), |
| 63 | framework::dataset::make("PoolingSize", { Size3D(2, 3, 2) })), |
| 64 | framework::dataset::make("Stride", { Size3D(1, 1, 1), Size3D(2, 1, 1), Size3D(1, 2, 1), Size3D(1, 1, 2), Size3D(2, 2, 1)})), |
| 65 | framework::dataset::make("Padding", { Padding3D(0, 0, 0), Padding3D(1, 1, 1), Padding3D(1, 0, 0) })), |
| 66 | framework::dataset::make("ExcludePadding", { true })); |
| 67 | |
ramelg01 | 3751569 | 2022-02-26 22:06:20 +0000 | [diff] [blame] | 68 | using ShapeDataset = framework::dataset::ContainerDataset<std::vector<TensorShape>>; |
| 69 | |
Mohammed Suhail Munshi | 5e549fa | 2022-03-16 11:14:06 +0000 | [diff] [blame^] | 70 | constexpr AbsoluteTolerance<float> tolerance_f32(0.001f); /**< Tolerance value for comparing reference's output against implementation's output for 32-bit floating-point type */ |
| 71 | constexpr AbsoluteTolerance<float> tolerance_f16(0.1f); /**< Tolerance value for comparing reference's output against implementation's output for 16-bit floating-point type */ |
| 72 | constexpr AbsoluteTolerance<int8_t> tolerance_qasymm8_signed(1); /**< Tolerance value for comparing reference's output against implementation's output for QASYMM8_SIGNED integer datatype*/ |
| 73 | constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(1); /**< Tolerance value for comparing reference's output against implementation's output for 8-bit asymmetric type */ |
ramelg01 | 3751569 | 2022-02-26 22:06:20 +0000 | [diff] [blame] | 74 | |
| 75 | } // namespace |
| 76 | |
| 77 | TEST_SUITE(CL) |
| 78 | TEST_SUITE(Pooling3dLayer) |
| 79 | |
| 80 | // *INDENT-OFF* |
| 81 | // clang-format off |
| 82 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( |
| 83 | framework::dataset::make("InputInfo", { TensorInfo(TensorShape(2U, 27U, 13U, 4U, 3U), 1, DataType::F32, DataLayout::NDHWC), // Mismatching data type |
| 84 | TensorInfo(TensorShape(2U, 27U, 13U, 4U, 2U), 1, DataType::F32, DataLayout::NDHWC), // Invalid pad/size combination |
| 85 | TensorInfo(TensorShape(2U, 27U, 13U, 4U, 2U), 1, DataType::F32, DataLayout::NDHWC), // Invalid pad/size combination |
| 86 | TensorInfo(TensorShape(2U, 27U, 13U, 4U, 3U), 1, DataType::F32, DataLayout::NDHWC), // Invalid output shape |
| 87 | TensorInfo(TensorShape(5U, 13U, 15U, 2U, 3U), 1, DataType::F32, DataLayout::NDHWC), // Global Pooling |
| 88 | TensorInfo(TensorShape(13U,13U, 5U, 1U, 2U), 1, DataType::F32, DataLayout::NDHWC), // Invalid output Global Pooling |
| 89 | TensorInfo(TensorShape(5U, 13U, 13U, 4U, 4U), 1, DataType::F32, DataLayout::NDHWC), // Invalid data type |
| 90 | TensorInfo(TensorShape(5U, 13U, 13U, 4U, 4U), 1, DataType::F32, DataLayout::NDHWC), |
| 91 | TensorInfo(TensorShape(5U, 13U, 13U, 5U, 4U), 1, DataType::F32, DataLayout::NDHWC), |
| 92 | TensorInfo(TensorShape(1U, 16U, 1U, 3U, 4U), 1, DataType::F32, DataLayout::NDHWC), |
| 93 | TensorInfo(TensorShape(5U, 13U, 13U, 4U, 3U), 1, DataType::F32, DataLayout::NDHWC), |
| 94 | TensorInfo(TensorShape(5U, 13U, 13U, 4U, 2U), 1, DataType::F32, DataLayout::NDHWC), |
| 95 | TensorInfo(TensorShape(5U, 13U, 13U, 4U, 3U), 1, DataType::F32, DataLayout::NDHWC), |
| 96 | TensorInfo(TensorShape(5U, 13U, 13U, 4U, 3U), 1, DataType::F32, DataLayout::NDHWC), |
| 97 | }), |
| 98 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(2U, 25U, 11U, 3U, 3U), 1, DataType::F16, DataLayout::NDHWC), |
| 99 | TensorInfo(TensorShape(2U, 30U, 11U, 3U, 2U), 1, DataType::F32, DataLayout::NDHWC), |
| 100 | TensorInfo(TensorShape(2U, 25U, 16U, 3U, 2U), 1, DataType::F32, DataLayout::NDHWC), |
| 101 | TensorInfo(TensorShape(2U, 27U, 13U, 3U, 3U), 1, DataType::F32, DataLayout::NDHWC), |
| 102 | TensorInfo(TensorShape(5U, 1U, 1U, 1U, 3U), 1, DataType::F32, DataLayout::NDHWC), // Global pooling applied |
| 103 | TensorInfo(TensorShape(5U, 2U, 2U, 2U, 2U), 1, DataType::F32, DataLayout::NDHWC), // Invalid output Global Pooling |
| 104 | TensorInfo(TensorShape(5U, 12U, 12U, 3U, 4U), 1, DataType::F32, DataLayout::NDHWC), |
| 105 | TensorInfo(TensorShape(5U, 12U, 12U, 3U, 4U), 1, DataType::QASYMM8, DataLayout::NDHWC), // Invalid data type |
| 106 | TensorInfo(TensorShape(5U, 1U, 1U, 1U, 4U), 1, DataType::F32, DataLayout::NDHWC), |
| 107 | TensorInfo(TensorShape(1U, 15U, 1U, 2U, 4U), 1, DataType::F32, DataLayout::NDHWC), // Output width larger than input |
| 108 | TensorInfo(TensorShape(5U, 6U, 6U, 2U, 3U), 1, DataType::F32, DataLayout::NDHWC), |
| 109 | TensorInfo(TensorShape(5U, 6U, 6U, 2U, 2U), 1, DataType::F32, DataLayout::NDHWC), |
| 110 | TensorInfo(TensorShape(5U, 6U, 6U, 2U, 3U), 1, DataType::F32, DataLayout::NDHWC), |
| 111 | TensorInfo(TensorShape(5U, 6U, 6U, 2U, 3U), 1, DataType::F32, DataLayout::NDHWC), |
| 112 | })), |
| 113 | framework::dataset::make("PoolInfo", { Pooling3dLayerInfo(PoolingType::AVG, 3, Size3D(1, 1, 1), Padding3D(0, 0, 0)), |
| 114 | Pooling3dLayerInfo(PoolingType::AVG, 2, Size3D(1, 1, 1), Padding3D(2, 0, 0)), |
| 115 | Pooling3dLayerInfo(PoolingType::AVG, 2, Size3D(1, 1, 1), Padding3D(0, 0, 0)), |
| 116 | Pooling3dLayerInfo(PoolingType::L2, 3, Size3D(1, 1, 1), Padding3D(0, 0, 0)), |
| 117 | Pooling3dLayerInfo(PoolingType::AVG), |
| 118 | Pooling3dLayerInfo(PoolingType::MAX), |
| 119 | Pooling3dLayerInfo(PoolingType::AVG, 2, Size3D(), Padding3D(), false), |
| 120 | Pooling3dLayerInfo(PoolingType::AVG, 2, Size3D(1U, 1U, 1U), Padding3D(), false), |
| 121 | Pooling3dLayerInfo(PoolingType::AVG), |
| 122 | Pooling3dLayerInfo(PoolingType::MAX, 2, Size3D(1, 1, 2), Padding3D(0, 0, 0), false), |
| 123 | Pooling3dLayerInfo(PoolingType::AVG, 2, Size3D(2U, 2U, 2U), Padding3D(), false), |
| 124 | Pooling3dLayerInfo(PoolingType::AVG, 1, Size3D(2U, 2U, 2U), Padding3D(2, 2, 2), true), // Pool size is smaller than the padding size with padding excluded |
| 125 | Pooling3dLayerInfo(PoolingType::AVG, 1, Size3D(2U, 2U, 2U), Padding3D(2, 2, 2), false), // Pool size is smaller than the padding size with padding included |
| 126 | Pooling3dLayerInfo(PoolingType::AVG, 3, Size3D(2U, 2U, 2U), Padding3D(2,1,2,2,1,2), false, false, DimensionRoundingType::CEIL), // CEIL with asymmetric Padding |
| 127 | })), |
| 128 | framework::dataset::make("Expected", { false, false, false, false, true, false, false, false, true , false, true, false, false, false})), |
| 129 | input_info, output_info, pool_info, expected) |
| 130 | { |
| 131 | ARM_COMPUTE_EXPECT(bool(CLPooling3dLayer::validate(&input_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), pool_info)) == expected, framework::LogLevel::ERRORS); |
| 132 | } |
| 133 | |
| 134 | |
| 135 | template <typename T> |
| 136 | using CLPooling3dLayerFixture = Pooling3dLayerValidationFixture<CLTensor, CLAccessor, CLPooling3dLayer, T>; |
| 137 | |
| 138 | template <typename T> |
| 139 | using CLSpecialPooling3dLayerFixture = SpecialPooling3dLayerValidationFixture<CLTensor, CLAccessor, CLPooling3dLayer, T>; |
| 140 | |
| 141 | template <typename T> |
| 142 | using CLPooling3dLayerGlobalFixture = Pooling3dLayerGlobalValidationFixture<CLTensor, CLAccessor, CLPooling3dLayer, T>; |
| 143 | |
Mohammed Suhail Munshi | 5e549fa | 2022-03-16 11:14:06 +0000 | [diff] [blame^] | 144 | template <typename T> |
| 145 | using CLPooling3dLayerQuantizedFixture = Pooling3dLayerValidationQuantizedFixture<CLTensor, CLAccessor, CLPooling3dLayer, T>; |
| 146 | |
ramelg01 | 3751569 | 2022-02-26 22:06:20 +0000 | [diff] [blame] | 147 | // clang-format on |
| 148 | // *INDENT-ON* |
Mohammed Suhail Munshi | 5e549fa | 2022-03-16 11:14:06 +0000 | [diff] [blame^] | 149 | TEST_SUITE(QUANTIZED) |
| 150 | |
| 151 | TEST_SUITE(QASYMM8) |
| 152 | // Small Dataset Quantized Dataset |
| 153 | FIXTURE_DATA_TEST_CASE(RunSmall, CLPooling3dLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small5dShapes(), |
| 154 | combine(Pooling3DLayerDatasetQuantized, |
| 155 | framework::dataset::make("DataType", DataType::QASYMM8))), |
| 156 | framework::dataset::make("InputQuantInfo", { QuantizationInfo(1.f / 127.f, 10), QuantizationInfo(1.f / 127.f, 10) })), |
| 157 | framework::dataset::make("OutputQuantInfo", { QuantizationInfo(1.f / 127.f, 5), QuantizationInfo(1.f / 127.f, 10) }))) |
| 158 | { |
| 159 | // Validate output |
| 160 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 161 | } |
| 162 | |
| 163 | // Large Dataset Quantized Dataset |
| 164 | FIXTURE_DATA_TEST_CASE(RunLarge, CLPooling3dLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large5dShapes(), |
| 165 | combine(Pooling3DLayerDatasetQuantized, |
| 166 | framework::dataset::make("DataType", DataType::QASYMM8))), |
| 167 | framework::dataset::make("InputQuantInfo", { QuantizationInfo(1.f / 127.f, 10), QuantizationInfo(1.f / 127.f, 10) })), |
| 168 | framework::dataset::make("OutputQuantInfo", { QuantizationInfo(1.f / 127.f, 5), QuantizationInfo(1.f / 127.f, 10) }))) |
| 169 | { |
| 170 | // Validate output |
| 171 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 172 | } |
| 173 | TEST_SUITE_END() |
| 174 | |
| 175 | TEST_SUITE(QASYMM8_SIGNED) |
| 176 | |
| 177 | // Large Dataset Quantized Dataset Signed |
| 178 | FIXTURE_DATA_TEST_CASE(RunSmall, CLPooling3dLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small5dShapes(), |
| 179 | combine(Pooling3DLayerDatasetQuantized, |
| 180 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED))), |
| 181 | framework::dataset::make("InputQuantInfo", { QuantizationInfo(1.f / 127.f, -10), QuantizationInfo(1.f / 127.f, -10) })), |
| 182 | framework::dataset::make("OutputQuantInfo", { QuantizationInfo(1.f / 127.f, -5), QuantizationInfo(1.f / 127.f, -10) }))) |
| 183 | { |
| 184 | // Validate output |
| 185 | validate(CLAccessor(_target), _reference, tolerance_qasymm8_signed); |
| 186 | } |
| 187 | |
| 188 | // Large Dataset Quantized pooling test |
| 189 | FIXTURE_DATA_TEST_CASE(RunLarge, CLPooling3dLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large5dShapes(), |
| 190 | combine(Pooling3DLayerDatasetQuantized, |
| 191 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED))), |
| 192 | framework::dataset::make("InputQuantInfo", { QuantizationInfo(1.f / 127.f, -10), QuantizationInfo(1.f / 127.f, -10) })), |
| 193 | framework::dataset::make("OutputQuantInfo", { QuantizationInfo(1.f / 127.f, -5), QuantizationInfo(1.f / 127.f, -10) }))) |
| 194 | { |
| 195 | // Validate output |
| 196 | validate(CLAccessor(_target), _reference, tolerance_qasymm8_signed); |
| 197 | } |
| 198 | |
| 199 | TEST_SUITE_END() |
| 200 | TEST_SUITE_END() |
| 201 | |
ramelg01 | 3751569 | 2022-02-26 22:06:20 +0000 | [diff] [blame] | 202 | TEST_SUITE(Float) |
| 203 | TEST_SUITE(FP32) |
| 204 | |
| 205 | FIXTURE_DATA_TEST_CASE(RunSpecial, CLSpecialPooling3dLayerFixture<float>, framework::DatasetMode::ALL, datasets::Pooling3dLayerDatasetSpecial() * framework::dataset::make("DataType", DataType::F32)) |
| 206 | { |
| 207 | // Validate output |
| 208 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 209 | } |
| 210 | |
| 211 | FIXTURE_DATA_TEST_CASE(RunSmall, CLPooling3dLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small5dShapes(), combine(Pooling3dLayerDatasetFPSmall, |
| 212 | framework::dataset::make("DataType", DataType::F32)))) |
| 213 | { |
| 214 | // Validate output |
| 215 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 216 | } |
| 217 | |
| 218 | FIXTURE_DATA_TEST_CASE(RunLarge, CLPooling3dLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(datasets::Large5dShapes(), combine(Pooling3dLayerDatasetFP, |
Mohammed Suhail Munshi | 5e549fa | 2022-03-16 11:14:06 +0000 | [diff] [blame^] | 219 | framework::dataset::make("DataType", DataType::F32)))) |
ramelg01 | 3751569 | 2022-02-26 22:06:20 +0000 | [diff] [blame] | 220 | { |
| 221 | // Validate output |
| 222 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 223 | } |
| 224 | |
| 225 | TEST_SUITE(GlobalPooling) |
| 226 | // *INDENT-OFF* |
| 227 | // clang-format off |
| 228 | FIXTURE_DATA_TEST_CASE(RunSmall, CLPooling3dLayerFixture<float>, framework::DatasetMode::ALL, |
| 229 | combine(combine(combine(combine(combine(combine( |
| 230 | framework::dataset::make("InputShape", { TensorShape(3U, 27U, 13U, 4U), |
| 231 | TensorShape(4U, 27U, 13U, 4U, 2U) |
| 232 | }), |
| 233 | framework::dataset::make("PoolingType", { PoolingType::AVG, PoolingType::L2, PoolingType::MAX })), |
| 234 | framework::dataset::make("PoolingSize", { Size3D(27, 13, 4) })), |
| 235 | framework::dataset::make("Strides", Size3D(1, 1, 1))), |
| 236 | framework::dataset::make("Paddings", Padding3D(0, 0, 0))), |
| 237 | framework::dataset::make("ExcludePadding", false)), |
| 238 | framework::dataset::make("DataType", DataType::F32))) |
| 239 | { |
| 240 | // Validate output |
| 241 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 242 | } |
| 243 | |
| 244 | FIXTURE_DATA_TEST_CASE(RunSmallGlobal, CLPooling3dLayerGlobalFixture<float>, framework::DatasetMode::ALL, |
| 245 | combine(combine( |
| 246 | framework::dataset::make("InputShape", { TensorShape(27U, 13U, 4U, 3U), |
| 247 | TensorShape(27U, 13U, 4U, 4U, 2U) |
| 248 | }), |
| 249 | framework::dataset::make("PoolingType", { PoolingType::AVG, PoolingType::L2, PoolingType::MAX })), |
| 250 | framework::dataset::make("DataType", DataType::F32))) |
| 251 | { |
| 252 | // Validate output |
| 253 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 254 | } |
| 255 | FIXTURE_DATA_TEST_CASE(RunLarge, CLPooling3dLayerFixture<float>, framework::DatasetMode::NIGHTLY, |
| 256 | combine(combine(combine(combine(combine(combine( |
| 257 | framework::dataset::make("InputShape", { TensorShape(4U, 79U, 37U, 11U), |
| 258 | TensorShape(4U, 79U, 37U, 11U, 2U) |
| 259 | }), |
| 260 | framework::dataset::make("PoolingType", { PoolingType::AVG, PoolingType::L2, PoolingType::MAX })), |
| 261 | framework::dataset::make("PoolingSize", { Size3D(79, 37, 11) })), |
| 262 | framework::dataset::make("Strides", Size3D(1, 1, 1))), |
| 263 | framework::dataset::make("Paddings", Padding3D(0, 0, 0))), |
| 264 | framework::dataset::make("ExcludePadding", false)), |
| 265 | framework::dataset::make("DataType", DataType::F32))) |
| 266 | { |
| 267 | // Validate output |
| 268 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 269 | } |
| 270 | // clang-format on |
| 271 | // *INDENT-ON* |
| 272 | TEST_SUITE_END() // GlobalPooling |
| 273 | TEST_SUITE_END() // FP32 |
| 274 | |
| 275 | TEST_SUITE(FP16) |
| 276 | |
| 277 | FIXTURE_DATA_TEST_CASE(RunSmall, CLPooling3dLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(datasets::Small5x5Shapes(), combine(Pooling3dLayerDatasetFPSmall, |
| 278 | framework::dataset::make("DataType", DataType::F16)))) |
| 279 | { |
| 280 | // Validate output |
| 281 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 282 | } |
| 283 | |
| 284 | FIXTURE_DATA_TEST_CASE(RunLarge, CLPooling3dLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(datasets::Large5dShapes(), combine(Pooling3dLayerDatasetFP, |
Mohammed Suhail Munshi | 5e549fa | 2022-03-16 11:14:06 +0000 | [diff] [blame^] | 285 | framework::dataset::make("DataType", DataType::F16)))) |
ramelg01 | 3751569 | 2022-02-26 22:06:20 +0000 | [diff] [blame] | 286 | { |
| 287 | // Validate output |
| 288 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 289 | } |
| 290 | |
| 291 | TEST_SUITE(GlobalPooling) |
| 292 | // *INDENT-OFF* |
| 293 | // clang-format off |
| 294 | FIXTURE_DATA_TEST_CASE(RunSmall, CLPooling3dLayerFixture<half>, framework::DatasetMode::ALL, |
| 295 | combine(combine(combine(combine(combine(combine( |
| 296 | framework::dataset::make("InputShape", { TensorShape(3U, 27U, 13U, 4U), |
| 297 | TensorShape(4U, 27U, 13U, 4U, 2U) |
| 298 | }), |
| 299 | framework::dataset::make("PoolingType", { PoolingType::AVG, PoolingType::L2, PoolingType::MAX })), |
| 300 | framework::dataset::make("PoolingSize", { Size3D(27, 13, 4) })), |
| 301 | framework::dataset::make("Strides", Size3D(1, 1, 1))), |
| 302 | framework::dataset::make("Paddings", Padding3D(0, 0, 0))), |
| 303 | framework::dataset::make("ExcludePadding", false)), |
| 304 | framework::dataset::make("DataType", DataType::F16))) |
| 305 | { |
| 306 | // Validate output |
| 307 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 308 | } |
| 309 | |
| 310 | FIXTURE_DATA_TEST_CASE(RunSmallGlobal, CLPooling3dLayerGlobalFixture<half>, framework::DatasetMode::ALL, |
| 311 | combine(combine( |
| 312 | framework::dataset::make("InputShape", { TensorShape(27U, 13U, 4U, 3U), |
| 313 | TensorShape(27U, 13U, 4U, 4U, 2U) |
| 314 | }), |
| 315 | framework::dataset::make("PoolingType", { PoolingType::AVG, PoolingType::L2, PoolingType::MAX })), |
| 316 | framework::dataset::make("DataType", DataType::F16))) |
| 317 | { |
| 318 | // Validate output |
| 319 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 320 | } |
| 321 | FIXTURE_DATA_TEST_CASE(RunLarge, CLPooling3dLayerFixture<half>, framework::DatasetMode::NIGHTLY, |
| 322 | combine(combine(combine(combine(combine(combine( |
| 323 | framework::dataset::make("InputShape", { TensorShape(4U, 79U, 37U, 11U), |
| 324 | TensorShape(4U, 79U, 37U, 11U, 2U) |
| 325 | }), |
| 326 | framework::dataset::make("PoolingType", { PoolingType::AVG, PoolingType::L2, PoolingType::MAX })), |
| 327 | framework::dataset::make("PoolingSize", { Size3D(79, 37, 11) })), |
| 328 | framework::dataset::make("Strides", Size3D(1, 1, 1))), |
| 329 | framework::dataset::make("Paddings", Padding3D(0, 0, 0))), |
| 330 | framework::dataset::make("ExcludePadding", false)), |
| 331 | framework::dataset::make("DataType", DataType::F16))) |
| 332 | { |
| 333 | // Validate output |
| 334 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 335 | } |
| 336 | // clang-format on |
| 337 | // *INDENT-ON* |
| 338 | TEST_SUITE_END() // GlobalPooling |
| 339 | TEST_SUITE_END() // FP16 |
| 340 | TEST_SUITE_END() // Float |
| 341 | TEST_SUITE_END() // Pooling3dLayer |
| 342 | TEST_SUITE_END() // CL |
| 343 | } // namespace validation |
| 344 | } // namespace test |
| 345 | } // namespace arm_compute |