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