Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 1 | /* |
Michele Di Giorgio | d9eaf61 | 2020-07-08 11:12:57 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2020 Arm Limited. |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 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, |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 22 | * SOFTWARE. |
| 23 | */ |
| 24 | #include "arm_compute/core/Types.h" |
| 25 | #include "arm_compute/runtime/CL/CLTensor.h" |
| 26 | #include "arm_compute/runtime/CL/CLTensorAllocator.h" |
| 27 | #include "arm_compute/runtime/CL/functions/CLDepthwiseConvolutionLayer.h" |
| 28 | #include "tests/CL/CLAccessor.h" |
| 29 | #include "tests/PaddingCalculator.h" |
| 30 | #include "tests/datasets/DepthwiseConvolutionLayerDataset.h" |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 31 | #include "tests/datasets/DilatedDepthwiseConvolutionLayerDataset.h" |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 32 | #include "tests/framework/Asserts.h" |
| 33 | #include "tests/framework/Macros.h" |
| 34 | #include "tests/framework/datasets/Datasets.h" |
| 35 | #include "tests/validation/Validation.h" |
| 36 | #include "tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h" |
| 37 | |
| 38 | namespace arm_compute |
| 39 | { |
| 40 | namespace test |
| 41 | { |
| 42 | namespace validation |
| 43 | { |
| 44 | namespace |
| 45 | { |
Georgios Pinitas | 009fede | 2018-10-26 12:54:21 +0100 | [diff] [blame] | 46 | RelativeTolerance<half_float::half> tolerance_f16(half_float::half(0.01)); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */ |
| 47 | constexpr RelativeTolerance<float> tolerance_f32(0.01f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */ |
Georgios Pinitas | 83e3e75 | 2018-11-07 18:33:08 +0000 | [diff] [blame] | 48 | constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(0); /**< Tolerance value for comparing reference's output against implementation's output for DataType::QASYMM8 */ |
Georgios Pinitas | 009fede | 2018-10-26 12:54:21 +0100 | [diff] [blame] | 49 | constexpr float tolerance_num = 0.05f; /**< Tolerance number */ |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 50 | |
Michele Di Giorgio | 601ba3f | 2019-08-22 16:20:04 +0100 | [diff] [blame] | 51 | const auto depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 5 }); |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 52 | const auto large_depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 5, 8 }); |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 53 | |
| 54 | //Activation Functions |
| 55 | const auto ActivationFunctionsDataset = framework::dataset::make("ActivationInfo", |
| 56 | { |
| 57 | ActivationLayerInfo(), |
| 58 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) |
| 59 | }); |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 60 | } // namespace |
| 61 | |
| 62 | TEST_SUITE(CL) |
| 63 | TEST_SUITE(DepthwiseConvolutionLayer) |
| 64 | |
Giorgio Arena | ad0c738 | 2018-04-23 16:16:21 +0100 | [diff] [blame] | 65 | // *INDENT-OFF* |
| 66 | // clang-format off |
Manuel Bottini | 387259a | 2020-05-21 17:14:36 +0100 | [diff] [blame] | 67 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip( |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 68 | framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type input/weights |
| 69 | TensorInfo(TensorShape(27U, 13U, 3U), 1, DataType::F32), // Mismatching input feature maps |
| 70 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching depth multiplier |
| 71 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases size |
| 72 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases dimensions |
| 73 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid output size |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 74 | TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // patch size bigger than input width |
| 75 | TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // dilation < 1 |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 76 | TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), |
| 77 | TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::QASYMM8), |
Giorgio Arena | ad0c738 | 2018-04-23 16:16:21 +0100 | [diff] [blame] | 78 | }), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 79 | framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16), |
| 80 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 81 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 82 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 83 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 84 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 85 | TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32), |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 86 | TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32), |
| 87 | TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 88 | TensorInfo(TensorShape(3U, 3U, 24U), 1, DataType::QASYMM8), |
Giorgio Arena | ad0c738 | 2018-04-23 16:16:21 +0100 | [diff] [blame] | 89 | })), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 90 | framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 91 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 92 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 93 | TensorInfo(TensorShape(4U), 1, DataType::F32), |
| 94 | TensorInfo(TensorShape(2U, 2U), 1, DataType::F32), |
| 95 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 96 | TensorInfo(TensorShape(16U), 1, DataType::F32), |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 97 | TensorInfo(TensorShape(16U), 1, DataType::F32), |
| 98 | TensorInfo(TensorShape(16U), 1, DataType::F32), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 99 | TensorInfo(TensorShape(24U), 1, DataType::S32), |
Giorgio Arena | ad0c738 | 2018-04-23 16:16:21 +0100 | [diff] [blame] | 100 | })), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 101 | framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 102 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 103 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 104 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 105 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 106 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), |
| 107 | TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32), |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 108 | TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32), |
| 109 | TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 110 | TensorInfo(TensorShape(32U, 11U, 24U), 1, DataType::QASYMM8), |
Giorgio Arena | ad0c738 | 2018-04-23 16:16:21 +0100 | [diff] [blame] | 111 | })), |
| 112 | framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0), |
| 113 | PadStrideInfo(1, 1, 0, 0), |
| 114 | PadStrideInfo(1, 1, 0, 0), |
| 115 | PadStrideInfo(1, 1, 0, 0), |
| 116 | PadStrideInfo(1, 1, 0, 0), |
| 117 | PadStrideInfo(1, 1, 0, 0), |
| 118 | PadStrideInfo(1, 1, 0, 0), |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 119 | PadStrideInfo(1, 1, 0, 0), |
| 120 | PadStrideInfo(1, 1, 0, 0), |
Giorgio Arena | ad0c738 | 2018-04-23 16:16:21 +0100 | [diff] [blame] | 121 | PadStrideInfo(1, 1, 1, 0), |
| 122 | })), |
| 123 | framework::dataset::make("DepthMultiplier", { 1, |
| 124 | 1, |
| 125 | 3, |
| 126 | 1, |
| 127 | 1, |
| 128 | 1, |
| 129 | 2, |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 130 | 2, |
| 131 | 2, |
Giorgio Arena | ad0c738 | 2018-04-23 16:16:21 +0100 | [diff] [blame] | 132 | 3, |
| 133 | })), |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 134 | framework::dataset::make("Dilation", { Size2D(1U, 1U), |
| 135 | Size2D(1U, 1U), |
| 136 | Size2D(1U, 1U), |
| 137 | Size2D(1U, 1U), |
| 138 | Size2D(1U, 1U), |
| 139 | Size2D(1U, 1U), |
| 140 | Size2D(20U, 1U), |
| 141 | Size2D(0U, 1U), |
| 142 | Size2D(1U, 1U), |
| 143 | Size2D(1U, 1U), |
| 144 | })), |
| 145 | framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, true, true })), |
| 146 | input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier, dilation, expected) |
Giorgio Arena | ad0c738 | 2018-04-23 16:16:21 +0100 | [diff] [blame] | 147 | { |
Michele Di Giorgio | 601ba3f | 2019-08-22 16:20:04 +0100 | [diff] [blame] | 148 | bool is_valid = bool(CLDepthwiseConvolutionLayer::validate(&input_info.clone()->set_is_resizable(true), &weights_info.clone()->set_is_resizable(true), &biases_info.clone()->set_is_resizable(true), &output_info.clone()->set_is_resizable(true), conv_info, depth_multiplier,ActivationLayerInfo(), dilation)); |
Giorgio Arena | ad0c738 | 2018-04-23 16:16:21 +0100 | [diff] [blame] | 149 | ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS); |
| 150 | } |
| 151 | // clang-format on |
| 152 | // *INDENT-ON* |
| 153 | |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 154 | template <typename T> |
| 155 | using CLDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T>; |
| 156 | |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 157 | TEST_SUITE(Float) |
Michele Di Giorgio | d24af8a | 2018-05-08 17:23:52 +0100 | [diff] [blame] | 158 | TEST_SUITE(FP16) |
Michele Di Giorgio | 933fe86 | 2018-02-19 15:42:12 +0000 | [diff] [blame] | 159 | TEST_SUITE(W3x3) |
Giorgio Arena | e6bb3c6 | 2018-08-23 11:19:11 +0100 | [diff] [blame] | 160 | TEST_SUITE(NCHW) |
Pablo Tello | 8bf622a | 2018-12-03 15:54:49 +0000 | [diff] [blame] | 161 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 162 | combine(combine(combine(combine(framework::dataset::concat(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), |
| 163 | datasets::SmallDepthwiseConvolutionLayerDataset3x3NCHW()), |
| 164 | depth_multipliers), |
| 165 | framework::dataset::make("DataType", |
| 166 | DataType::F16)), |
| 167 | framework::dataset::make("DataLayout", DataLayout::NCHW)), |
| 168 | ActivationFunctionsDataset)) |
Michele Di Giorgio | 933fe86 | 2018-02-19 15:42:12 +0000 | [diff] [blame] | 169 | { |
| 170 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 171 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 172 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 173 | large_depth_multipliers), |
Pablo Tello | 8bf622a | 2018-12-03 15:54:49 +0000 | [diff] [blame] | 174 | framework::dataset::make("DataType", |
| 175 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 176 | framework::dataset::make("DataLayout", DataLayout::NCHW)), |
| 177 | ActivationFunctionsDataset)) |
Michele Di Giorgio | 933fe86 | 2018-02-19 15:42:12 +0000 | [diff] [blame] | 178 | { |
| 179 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 180 | } |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 181 | TEST_SUITE(Dilation) |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 182 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 183 | depth_multipliers), |
| 184 | framework::dataset::make("DataType", |
| 185 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 186 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 187 | ActivationFunctionsDataset)) |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 188 | { |
| 189 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 190 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 191 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 192 | large_depth_multipliers), |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 193 | framework::dataset::make("DataType", |
| 194 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 195 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 196 | ActivationFunctionsDataset)) |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 197 | { |
| 198 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 199 | } |
| 200 | TEST_SUITE_END() // Dilation |
| 201 | TEST_SUITE_END() // NCHW |
Michele Di Giorgio | d24af8a | 2018-05-08 17:23:52 +0100 | [diff] [blame] | 202 | |
Giorgio Arena | e6bb3c6 | 2018-08-23 11:19:11 +0100 | [diff] [blame] | 203 | TEST_SUITE(NHWC) |
Pablo Tello | 8bf622a | 2018-12-03 15:54:49 +0000 | [diff] [blame] | 204 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 205 | combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), |
| 206 | depth_multipliers), |
| 207 | framework::dataset::make("DataType", |
| 208 | DataType::F16)), |
| 209 | framework::dataset::make("DataLayout", DataLayout::NHWC)), |
| 210 | ActivationFunctionsDataset)) |
Giorgio Arena | e6bb3c6 | 2018-08-23 11:19:11 +0100 | [diff] [blame] | 211 | { |
| 212 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 213 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 214 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 215 | large_depth_multipliers), |
Pablo Tello | 8bf622a | 2018-12-03 15:54:49 +0000 | [diff] [blame] | 216 | framework::dataset::make("DataType", |
| 217 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 218 | framework::dataset::make("DataLayout", DataLayout::NHWC)), |
| 219 | ActivationFunctionsDataset)) |
Giorgio Arena | e6bb3c6 | 2018-08-23 11:19:11 +0100 | [diff] [blame] | 220 | { |
| 221 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 222 | } |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 223 | TEST_SUITE(Dilation) |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 224 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 225 | depth_multipliers), |
| 226 | framework::dataset::make("DataType", |
| 227 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 228 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 229 | ActivationFunctionsDataset)) |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 230 | { |
| 231 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 232 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 233 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 234 | large_depth_multipliers), |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 235 | framework::dataset::make("DataType", |
| 236 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 237 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 238 | ActivationFunctionsDataset)) |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 239 | { |
| 240 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 241 | } |
| 242 | TEST_SUITE_END() // Dilation |
| 243 | TEST_SUITE_END() // NHWC |
| 244 | TEST_SUITE_END() // W3x3 |
Giorgio Arena | e6bb3c6 | 2018-08-23 11:19:11 +0100 | [diff] [blame] | 245 | |
Michele Di Giorgio | d24af8a | 2018-05-08 17:23:52 +0100 | [diff] [blame] | 246 | TEST_SUITE(Generic) |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 247 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 248 | depth_multipliers), |
Michele Di Giorgio | d24af8a | 2018-05-08 17:23:52 +0100 | [diff] [blame] | 249 | framework::dataset::make("DataType", |
| 250 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 251 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 252 | ActivationFunctionsDataset)) |
Michele Di Giorgio | d24af8a | 2018-05-08 17:23:52 +0100 | [diff] [blame] | 253 | { |
| 254 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 255 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 256 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 257 | large_depth_multipliers), |
Michele Di Giorgio | d24af8a | 2018-05-08 17:23:52 +0100 | [diff] [blame] | 258 | framework::dataset::make("DataType", |
| 259 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 260 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 261 | ActivationFunctionsDataset)) |
Michele Di Giorgio | d24af8a | 2018-05-08 17:23:52 +0100 | [diff] [blame] | 262 | { |
| 263 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 264 | } |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 265 | |
| 266 | TEST_SUITE(Dilation) |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 267 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 268 | depth_multipliers), |
| 269 | framework::dataset::make("DataType", |
| 270 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 271 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 272 | ActivationFunctionsDataset)) |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 273 | { |
| 274 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 275 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 276 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 277 | large_depth_multipliers), |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 278 | framework::dataset::make("DataType", |
| 279 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 280 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 281 | ActivationFunctionsDataset)) |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 282 | { |
| 283 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 284 | } |
| 285 | TEST_SUITE_END() // Dilation |
| 286 | TEST_SUITE_END() // Generic |
| 287 | TEST_SUITE_END() // FP16 |
Michele Di Giorgio | 933fe86 | 2018-02-19 15:42:12 +0000 | [diff] [blame] | 288 | |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 289 | TEST_SUITE(FP32) |
| 290 | TEST_SUITE(W3x3) |
Giorgio Arena | d051e97 | 2018-06-20 11:46:42 +0100 | [diff] [blame] | 291 | TEST_SUITE(NCHW) |
Pablo Tello | 8bf622a | 2018-12-03 15:54:49 +0000 | [diff] [blame] | 292 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 293 | combine(combine(combine(combine(framework::dataset::concat(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), |
| 294 | datasets::SmallDepthwiseConvolutionLayerDataset3x3NCHW()), |
| 295 | depth_multipliers), |
| 296 | framework::dataset::make("DataType", |
| 297 | DataType::F32)), |
| 298 | framework::dataset::make("DataLayout", DataLayout::NCHW)), |
| 299 | ActivationFunctionsDataset)) |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 300 | { |
| 301 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 302 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 303 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 304 | large_depth_multipliers), |
Pablo Tello | 8bf622a | 2018-12-03 15:54:49 +0000 | [diff] [blame] | 305 | framework::dataset::make("DataType", |
| 306 | DataType::F32)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 307 | framework::dataset::make("DataLayout", DataLayout::NCHW)), |
| 308 | ActivationFunctionsDataset)) |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 309 | { |
| 310 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 311 | } |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 312 | TEST_SUITE(Dilation) |
| 313 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 314 | combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers), |
| 315 | framework::dataset::make("DataType", |
| 316 | DataType::F32)), |
| 317 | framework::dataset::make("DataLayout", DataLayout::NCHW)), |
| 318 | ActivationFunctionsDataset)) |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 319 | { |
| 320 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 321 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 322 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, |
| 323 | combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 324 | large_depth_multipliers), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 325 | framework::dataset::make("DataType", |
| 326 | DataType::F32)), |
| 327 | framework::dataset::make("DataLayout", DataLayout::NCHW)), |
| 328 | ActivationFunctionsDataset)) |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 329 | { |
| 330 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 331 | } |
| 332 | |
| 333 | TEST_SUITE_END() // Dilation |
| 334 | TEST_SUITE_END() // NCHW |
Giorgio Arena | d051e97 | 2018-06-20 11:46:42 +0100 | [diff] [blame] | 335 | TEST_SUITE(NHWC) |
Pablo Tello | 8bf622a | 2018-12-03 15:54:49 +0000 | [diff] [blame] | 336 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 337 | combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), |
| 338 | depth_multipliers), |
| 339 | framework::dataset::make("DataType", |
| 340 | DataType::F32)), |
| 341 | framework::dataset::make("DataLayout", DataLayout::NHWC)), |
| 342 | ActivationFunctionsDataset)) |
Giorgio Arena | d051e97 | 2018-06-20 11:46:42 +0100 | [diff] [blame] | 343 | { |
| 344 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 345 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 346 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 347 | large_depth_multipliers), |
Pablo Tello | 8bf622a | 2018-12-03 15:54:49 +0000 | [diff] [blame] | 348 | framework::dataset::make("DataType", |
| 349 | DataType::F32)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 350 | framework::dataset::make("DataLayout", DataLayout::NHWC)), |
| 351 | ActivationFunctionsDataset)) |
Giorgio Arena | d051e97 | 2018-06-20 11:46:42 +0100 | [diff] [blame] | 352 | { |
| 353 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 354 | } |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 355 | TEST_SUITE(Dilation) |
| 356 | |
| 357 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 358 | combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 359 | depth_multipliers), |
| 360 | framework::dataset::make("DataType", |
| 361 | DataType::F32)), |
| 362 | framework::dataset::make("DataLayout", DataLayout::NHWC)), |
| 363 | ActivationFunctionsDataset)) |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 364 | { |
| 365 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 366 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 367 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, |
| 368 | combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 369 | large_depth_multipliers), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 370 | framework::dataset::make("DataType", |
| 371 | DataType::F32)), |
| 372 | framework::dataset::make("DataLayout", DataLayout::NHWC)), |
| 373 | ActivationFunctionsDataset)) |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 374 | { |
| 375 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 376 | } |
| 377 | TEST_SUITE_END() // Dilation |
| 378 | TEST_SUITE_END() // NHWC |
| 379 | TEST_SUITE_END() // W3x3 |
Michele Di Giorgio | d24af8a | 2018-05-08 17:23:52 +0100 | [diff] [blame] | 380 | |
| 381 | TEST_SUITE(Generic) |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 382 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 383 | depth_multipliers), |
Michele Di Giorgio | d24af8a | 2018-05-08 17:23:52 +0100 | [diff] [blame] | 384 | framework::dataset::make("DataType", |
| 385 | DataType::F32)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 386 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 387 | ActivationFunctionsDataset)) |
Michele Di Giorgio | d24af8a | 2018-05-08 17:23:52 +0100 | [diff] [blame] | 388 | { |
| 389 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 390 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 391 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 392 | large_depth_multipliers), |
Michele Di Giorgio | d24af8a | 2018-05-08 17:23:52 +0100 | [diff] [blame] | 393 | framework::dataset::make("DataType", |
| 394 | DataType::F32)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 395 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 396 | ActivationFunctionsDataset)) |
Michele Di Giorgio | d24af8a | 2018-05-08 17:23:52 +0100 | [diff] [blame] | 397 | { |
| 398 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 399 | } |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 400 | |
| 401 | TEST_SUITE(Dilation) |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 402 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 403 | depth_multipliers), |
| 404 | framework::dataset::make("DataType", |
| 405 | DataType::F32)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 406 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 407 | ActivationFunctionsDataset)) |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 408 | { |
| 409 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 410 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 411 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, |
| 412 | combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 413 | large_depth_multipliers), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 414 | framework::dataset::make("DataType", |
| 415 | DataType::F32)), |
| 416 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 417 | ActivationFunctionsDataset)) |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 418 | { |
| 419 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 420 | } |
| 421 | TEST_SUITE_END() // Dilation |
| 422 | TEST_SUITE_END() // Generic |
| 423 | TEST_SUITE_END() // FP32 |
| 424 | TEST_SUITE_END() // Float |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 425 | |
| 426 | template <typename T> |
Georgios Pinitas | de5a1cc | 2018-02-02 12:52:07 +0000 | [diff] [blame] | 427 | using CLDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T>; |
Michele Di Giorgio | df4cf57 | 2019-10-09 15:32:39 +0100 | [diff] [blame] | 428 | template <typename T> |
| 429 | using CLDepthwiseConvolutionLayerQuantizedPerChannelFixture = DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayer, T, int8_t>; |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 430 | |
| 431 | TEST_SUITE(Quantized) |
| 432 | TEST_SUITE(QASYMM8) |
Georgios Pinitas | de5a1cc | 2018-02-02 12:52:07 +0000 | [diff] [blame] | 433 | TEST_SUITE(Generic) |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 434 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 435 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 436 | depth_multipliers), |
| 437 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Michele Di Giorgio | 14cbfb2 | 2019-10-23 10:53:10 +0100 | [diff] [blame] | 438 | framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10), QuantizationInfo(2.2f, 10) })), |
Gian Marco Iodice | e5ecd01 | 2019-08-28 15:56:36 +0100 | [diff] [blame] | 439 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
Michele Di Giorgio | 4cd4cde | 2020-01-06 14:07:44 +0000 | [diff] [blame] | 440 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), // NCHW is tested with int8 |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 441 | ActivationFunctionsDataset)) |
Georgios Pinitas | de5a1cc | 2018-02-02 12:52:07 +0000 | [diff] [blame] | 442 | { |
| 443 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 444 | } |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 445 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 446 | combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 447 | large_depth_multipliers), |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 448 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Michele Di Giorgio | 14cbfb2 | 2019-10-23 10:53:10 +0100 | [diff] [blame] | 449 | framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })), |
Gian Marco Iodice | e5ecd01 | 2019-08-28 15:56:36 +0100 | [diff] [blame] | 450 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 2) })), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 451 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 452 | ActivationFunctionsDataset)) |
Georgios Pinitas | de5a1cc | 2018-02-02 12:52:07 +0000 | [diff] [blame] | 453 | { |
| 454 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 455 | } |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 456 | TEST_SUITE(Dilation) |
| 457 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 458 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 459 | depth_multipliers), |
| 460 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Michele Di Giorgio | 14cbfb2 | 2019-10-23 10:53:10 +0100 | [diff] [blame] | 461 | framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })), |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 462 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8, 1) })), |
Michele Di Giorgio | 4cd4cde | 2020-01-06 14:07:44 +0000 | [diff] [blame] | 463 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), // NCHW is tested with int8 |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 464 | ActivationFunctionsDataset)) |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 465 | { |
| 466 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 467 | } |
| 468 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 469 | combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 470 | large_depth_multipliers), |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 471 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Michele Di Giorgio | 14cbfb2 | 2019-10-23 10:53:10 +0100 | [diff] [blame] | 472 | framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(1.3f, 10) })), |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 473 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 474 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 475 | ActivationFunctionsDataset)) |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 476 | { |
| 477 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 478 | } |
| 479 | TEST_SUITE_END() // Dilation |
| 480 | TEST_SUITE_END() // Generic |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 481 | TEST_SUITE(W3x3) |
Pablo Tello | 8bf622a | 2018-12-03 15:54:49 +0000 | [diff] [blame] | 482 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 483 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), |
| 484 | depth_multipliers), |
| 485 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Michele Di Giorgio | 14cbfb2 | 2019-10-23 10:53:10 +0100 | [diff] [blame] | 486 | framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10), QuantizationInfo(2.2f, 10) })), |
Gian Marco Iodice | e5ecd01 | 2019-08-28 15:56:36 +0100 | [diff] [blame] | 487 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 488 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 489 | ActivationFunctionsDataset)) |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 490 | { |
| 491 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 492 | } |
Pablo Tello | 8bf622a | 2018-12-03 15:54:49 +0000 | [diff] [blame] | 493 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 494 | combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 495 | large_depth_multipliers), |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 496 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Michele Di Giorgio | 14cbfb2 | 2019-10-23 10:53:10 +0100 | [diff] [blame] | 497 | framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })), |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 498 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 499 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 500 | ActivationFunctionsDataset)) |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 501 | { |
| 502 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 503 | } |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 504 | TEST_SUITE(Dilation) |
| 505 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 506 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 507 | depth_multipliers), |
| 508 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Michele Di Giorgio | 14cbfb2 | 2019-10-23 10:53:10 +0100 | [diff] [blame] | 509 | framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })), |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 510 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 511 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 512 | ActivationFunctionsDataset)) |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 513 | { |
| 514 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 515 | } |
| 516 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 517 | combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 518 | large_depth_multipliers), |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 519 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Michele Di Giorgio | 14cbfb2 | 2019-10-23 10:53:10 +0100 | [diff] [blame] | 520 | framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })), |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 521 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 522 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 523 | ActivationFunctionsDataset)) |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 524 | { |
| 525 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 526 | } |
| 527 | TEST_SUITE_END() // Dilation |
| 528 | TEST_SUITE_END() // W3x3 |
| 529 | TEST_SUITE_END() // QASYMM8 |
Michele Di Giorgio | df4cf57 | 2019-10-09 15:32:39 +0100 | [diff] [blame] | 530 | |
Michele Di Giorgio | 4cd4cde | 2020-01-06 14:07:44 +0000 | [diff] [blame] | 531 | TEST_SUITE(QASYMM8_SIGNED) |
| 532 | TEST_SUITE(Generic) |
| 533 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, |
| 534 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 535 | depth_multipliers), |
| 536 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 537 | framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10), QuantizationInfo(2.2f, 10) })), |
| 538 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
| 539 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 540 | ActivationFunctionsDataset)) |
| 541 | { |
| 542 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 543 | } |
| 544 | TEST_SUITE(Dilation) |
| 545 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, |
| 546 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 547 | depth_multipliers), |
| 548 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 549 | framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10), QuantizationInfo(2.2f, 10) })), |
| 550 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8, 1) })), |
| 551 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 552 | ActivationFunctionsDataset)) |
| 553 | { |
| 554 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 555 | } |
| 556 | TEST_SUITE_END() // Dilation |
| 557 | TEST_SUITE_END() // Generic |
| 558 | TEST_SUITE_END() // QASYMM8_SIGNED |
| 559 | |
Michele Di Giorgio | df4cf57 | 2019-10-09 15:32:39 +0100 | [diff] [blame] | 560 | TEST_SUITE(QSYMM8_PER_CHANNEL) |
| 561 | TEST_SUITE(Generic) |
| 562 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
| 563 | combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 564 | depth_multipliers), |
| 565 | framework::dataset::make("SrcDataType", DataType::QASYMM8)), |
| 566 | framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)), |
| 567 | framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })), |
| 568 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
| 569 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 570 | ActivationFunctionsDataset)) |
| 571 | { |
| 572 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 573 | } |
| 574 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
| 575 | combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(), |
| 576 | large_depth_multipliers), |
| 577 | framework::dataset::make("SrcDataType", DataType::QASYMM8)), |
| 578 | framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)), |
| 579 | framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 580 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 2) })), |
| 581 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 582 | ActivationFunctionsDataset)) |
| 583 | { |
| 584 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 585 | } |
| 586 | TEST_SUITE(Dilation) |
| 587 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
| 588 | combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 589 | depth_multipliers), |
| 590 | framework::dataset::make("SrcDataType", DataType::QASYMM8)), |
| 591 | framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)), |
| 592 | framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 593 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8, 1) })), |
| 594 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 595 | ActivationFunctionsDataset)) |
| 596 | { |
| 597 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 598 | } |
| 599 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
| 600 | combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
| 601 | large_depth_multipliers), |
| 602 | framework::dataset::make("SrcDataType", DataType::QASYMM8)), |
| 603 | framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)), |
| 604 | framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 605 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })), |
| 606 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 607 | ActivationFunctionsDataset)) |
| 608 | { |
| 609 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 610 | } |
| 611 | TEST_SUITE_END() // Dilation |
| 612 | TEST_SUITE_END() // Generic |
| 613 | TEST_SUITE(W3x3) |
| 614 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
| 615 | combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), |
| 616 | depth_multipliers), |
| 617 | framework::dataset::make("SrcDataType", DataType::QASYMM8)), |
| 618 | framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)), |
| 619 | framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) })), |
| 620 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
| 621 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 622 | ActivationFunctionsDataset)) |
| 623 | { |
| 624 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 625 | } |
| 626 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
| 627 | combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
| 628 | large_depth_multipliers), |
| 629 | framework::dataset::make("SrcDataType", DataType::QASYMM8)), |
| 630 | framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)), |
| 631 | framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 632 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 633 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 634 | ActivationFunctionsDataset)) |
| 635 | { |
| 636 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 637 | } |
| 638 | TEST_SUITE(Dilation) |
| 639 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
| 640 | combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 641 | depth_multipliers), |
| 642 | framework::dataset::make("SrcDataType", DataType::QASYMM8)), |
| 643 | framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)), |
| 644 | framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 645 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 646 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 647 | ActivationFunctionsDataset)) |
| 648 | { |
| 649 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 650 | } |
| 651 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDepthwiseConvolutionLayerQuantizedPerChannelFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
| 652 | combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 653 | large_depth_multipliers), |
| 654 | framework::dataset::make("SrcDataType", DataType::QASYMM8)), |
| 655 | framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)), |
| 656 | framework::dataset::make("SrcQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 657 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 658 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 659 | ActivationFunctionsDataset)) |
| 660 | { |
| 661 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 662 | } |
| 663 | TEST_SUITE_END() // Dilation |
| 664 | TEST_SUITE_END() // W3x3 |
| 665 | TEST_SUITE_END() // QSYMM8_PER_CHANNEL |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 666 | TEST_SUITE_END() // Quantized |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 667 | |
Usama Arif | e73686a | 2019-04-08 17:30:48 +0100 | [diff] [blame] | 668 | TEST_SUITE_END() // DepthwiseConvolutionLayer |
| 669 | TEST_SUITE_END() // CL |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 670 | } // namespace validation |
| 671 | } // namespace test |
| 672 | } // namespace arm_compute |