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