Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 1 | /* |
SiCong Li | 1b2f868 | 2023-01-04 10:04:26 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2023 Arm Limited. |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [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, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 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/CLDirectConvolutionLayer.h" |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 28 | #include "tests/CL/CLAccessor.h" |
| 29 | #include "tests/PaddingCalculator.h" |
Jaroslaw Rzepecki | 2ecbada | 2017-11-29 13:51:34 +0000 | [diff] [blame] | 30 | #include "tests/datasets/DirectConvolutionLayerDataset.h" |
Moritz Pflanzer | a09de0c | 2017-09-01 20:41:12 +0100 | [diff] [blame] | 31 | #include "tests/datasets/ShapeDatasets.h" |
| 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/DirectConvolutionLayerFixture.h" |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 37 | |
SiCong Li | 54eafd8 | 2023-01-26 17:36:08 +0000 | [diff] [blame] | 38 | /** Synced with tests/validation/dynamic_fusion/gpu/cl/DirectConv2d.cpp |
| 39 | * Please check there for any differences in the coverage |
| 40 | */ |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 41 | namespace arm_compute |
| 42 | { |
| 43 | namespace test |
| 44 | { |
| 45 | namespace validation |
| 46 | { |
| 47 | namespace |
| 48 | { |
Gunes Bayir | 38ce29d | 2021-08-04 12:45:33 +0100 | [diff] [blame] | 49 | RelativeTolerance<half> tolerance_fp16(half(0.2)); /**< Tolerance for floating point tests */ |
| 50 | RelativeTolerance<float> tolerance_fp32(0.05f); /**< Tolerance for floating point tests */ |
| 51 | constexpr float abs_tolerance_f32(0.0001f); /**< Absolute tolerance for FP32 tests*/ |
| 52 | |
| 53 | constexpr float tolerance_num = 0.07f; /**< Tolerance number */ |
| 54 | constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(1); /**< Tolerance for quantized tests */ |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 55 | |
Michalis Spyrou | 4509173 | 2019-05-13 17:41:01 +0100 | [diff] [blame] | 56 | const auto data_strides = combine(framework::dataset::make("StrideX", 1, 3), framework::dataset::make("StrideY", 1, 3)); |
| 57 | const auto data_strides_small = combine(framework::dataset::make("StrideX", 1), framework::dataset::make("StrideY", 1)); |
| 58 | const auto data_ksize_one = combine(framework::dataset::make("PadX", 0, 1), combine(framework::dataset::make("PadY", 0, 1), framework::dataset::make("KernelSize", 1))); |
| 59 | const auto data_ksize_one_small = combine(framework::dataset::make("PadX", 0), combine(framework::dataset::make("PadY", 0), framework::dataset::make("KernelSize", 1))); |
| 60 | const auto data_ksize_three = combine(framework::dataset::make("PadX", 0, 2), combine(framework::dataset::make("PadY", 0, 2), framework::dataset::make("KernelSize", 3))); |
| 61 | const auto data_ksize_five = combine(framework::dataset::make("PadX", 0, 3), combine(framework::dataset::make("PadY", 0, 3), framework::dataset::make("KernelSize", 5))); |
| 62 | const auto data_ksize_nine = combine(framework::dataset::make("PadX", 0, 3), combine(framework::dataset::make("PadY", 0, 3), framework::dataset::make("KernelSize", 9))); |
| 63 | const auto data_ksize_nine_small = combine(framework::dataset::make("PadX", 0, 1), combine(framework::dataset::make("PadY", 0, 1), framework::dataset::make("KernelSize", 9))); |
Michalis Spyrou | def665a | 2017-08-14 11:26:37 +0100 | [diff] [blame] | 64 | |
Michalis Spyrou | 4509173 | 2019-05-13 17:41:01 +0100 | [diff] [blame] | 65 | const auto data_all_kernels = concat(concat(data_ksize_one, data_ksize_three), data_ksize_five); |
| 66 | |
| 67 | const auto data = combine(datasets::SmallDirectConvolutionShapes(), combine(data_strides, data_all_kernels)); |
| 68 | const auto data9x9 = combine(datasets::SmallDirectConvolutionShapes(), combine(data_strides, data_ksize_nine)); |
| 69 | const auto data_small = combine(datasets::SmallDirectConvolutionShapes(), combine(data_strides_small, data_ksize_one_small)); |
| 70 | const auto data_small9x9 = combine(datasets::SmallDirectConvolutionShapes(), combine(data_strides_small, data_ksize_nine_small)); |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 71 | |
| 72 | /** Direct convolution nightly data set. */ |
Michele Di Giorgio | ba2cc1a | 2020-07-15 17:39:30 +0100 | [diff] [blame] | 73 | const auto data_nightly = combine(data, framework::dataset::make("NumKernels", { 1, 4 })); |
| 74 | const auto data_nightly_9x9 = combine(data9x9, framework::dataset::make("NumKernels", { 1, 4 })); |
| 75 | const auto data_nightly_usecase = combine(framework::dataset::make("InputShape", { TensorShape{ 3U, 800U, 800U } }), |
| 76 | combine(framework::dataset::make("StrideX", { 1 }), |
| 77 | combine(framework::dataset::make("StrideY", { 1 }), |
| 78 | combine(framework::dataset::make("PadX", { 4 }), |
| 79 | combine(framework::dataset::make("PadY", { 4 }), |
| 80 | combine(framework::dataset::make("KernelSize", 9), |
| 81 | framework::dataset::make("NumKernels", { 16 }))))))); |
| 82 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 83 | /** Direct convolution precommit data set. */ |
Michalis Spyrou | 4509173 | 2019-05-13 17:41:01 +0100 | [diff] [blame] | 84 | const auto data_precommit = combine(data_small, framework::dataset::make("NumKernels", { 1 })); |
| 85 | const auto data_precommit_9x9 = combine(data_small9x9, framework::dataset::make("NumKernels", { 1 })); |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 86 | |
Isabella Gottardi | 3f217ec | 2018-02-12 14:59:19 +0000 | [diff] [blame] | 87 | /** Activation function Dataset*/ |
| 88 | const auto ActivationFunctionsDataset = framework::dataset::make("ActivationInfo", |
Michalis Spyrou | 5ce99a2 | 2019-01-25 14:17:49 +0000 | [diff] [blame] | 89 | { ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 0.5f) }); |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 90 | } // namespace |
| 91 | |
| 92 | TEST_SUITE(CL) |
| 93 | TEST_SUITE(DirectConvolutionLayer) |
| 94 | |
Michele Di Giorgio | 97e2580 | 2021-03-25 12:37:45 +0000 | [diff] [blame] | 95 | /** Check whether the configuration of a Direct Convolution layer with no |
| 96 | * bias leads to a successful execution. |
| 97 | */ |
| 98 | TEST_CASE(NoBias, framework::DatasetMode::PRECOMMIT) |
| 99 | { |
| 100 | const auto src_shape = TensorShape(27U, 13U, 2U); |
| 101 | const auto weights_shape = TensorShape(3U, 3U, 2U, 4U); |
| 102 | const auto bias_shape = TensorShape(4U); |
| 103 | const auto dst_shape = TensorShape(25U, 11U, 4U); |
| 104 | constexpr auto dt = DataType::F32; |
| 105 | |
| 106 | auto src = create_tensor<CLTensor>(src_shape, dt); |
| 107 | auto weights = create_tensor<CLTensor>(weights_shape, dt); |
| 108 | auto dst = create_tensor<CLTensor>(dst_shape, dt); |
| 109 | |
| 110 | const auto conv_info = PadStrideInfo(1, 1, 0, 0); |
| 111 | |
| 112 | // Create Direct Convolution function |
| 113 | CLDirectConvolutionLayer conv{}; |
| 114 | conv.configure(&src, &weights, nullptr, &dst, conv_info); |
| 115 | |
| 116 | src.allocator()->allocate(); |
| 117 | weights.allocator()->allocate(); |
| 118 | dst.allocator()->allocate(); |
| 119 | |
| 120 | library->fill_tensor_value(CLAccessor(src), 1.f); |
| 121 | library->fill_tensor_value(CLAccessor(weights), 1.f); |
| 122 | |
| 123 | conv.run(); |
| 124 | |
| 125 | // Compute reference to compare |
| 126 | SimpleTensor<float> ref_src{ src_shape, dt }; |
| 127 | SimpleTensor<float> ref_weights{ weights_shape, dt }; |
| 128 | SimpleTensor<float> ref_bias{ bias_shape, dt }; |
| 129 | library->fill_tensor_value(ref_src, 1.f); |
| 130 | library->fill_tensor_value(ref_weights, 1.f); |
| 131 | // No bias |
| 132 | library->fill_tensor_value(ref_bias, 0.f); |
| 133 | auto ref_dst = reference::convolution_layer<float>(ref_src, ref_weights, ref_bias, dst_shape, conv_info); |
| 134 | |
| 135 | validate(CLAccessor(dst), ref_dst); |
| 136 | } |
| 137 | |
Ramy Elgammal | 73f19af | 2022-10-23 11:44:49 +0100 | [diff] [blame] | 138 | /** Check whether the case of rectangle kernels i.e. when width and height of the weight_shape are not equal |
| 139 | * would lead to successful run |
| 140 | */ |
| 141 | TEST_CASE(NonSquareKernel, framework::DatasetMode::PRECOMMIT) |
| 142 | { |
| 143 | auto src_shape = TensorShape(33U, 27U, 3U); |
| 144 | auto weights_shape = TensorShape(5U, 7U, 3U, 4U); // non-square kernel |
| 145 | const auto bias_shape = TensorShape(4U); |
| 146 | auto dst_shape = TensorShape(11U, 12U, 4U); |
| 147 | constexpr auto dt = DataType::F32; |
| 148 | |
| 149 | TensorShape src_shape_nhwc(src_shape); |
| 150 | TensorShape weights_shape_nhwc(weights_shape); |
| 151 | TensorShape dst_shape_nhwc(dst_shape); |
| 152 | |
| 153 | // Non-square shapes are only allowed for NHWC |
| 154 | permute(src_shape_nhwc, PermutationVector(2U, 0U, 1U)); |
| 155 | permute(weights_shape_nhwc, PermutationVector(2U, 0U, 1U)); |
| 156 | permute(dst_shape_nhwc, PermutationVector(2U, 0U, 1U)); |
| 157 | |
| 158 | auto src = create_tensor<CLTensor>(src_shape_nhwc, dt, 1, QuantizationInfo(), DataLayout::NHWC); |
| 159 | auto weights = create_tensor<CLTensor>(weights_shape_nhwc, dt, 1, QuantizationInfo(), DataLayout::NHWC); |
| 160 | auto dst = create_tensor<CLTensor>(dst_shape_nhwc, dt, 1, QuantizationInfo(), DataLayout::NHWC); |
| 161 | const auto conv_info = PadStrideInfo(3, 2, 1, 1, 2, 0, DimensionRoundingType::FLOOR); |
| 162 | |
| 163 | // Create direct convolution function |
| 164 | CLDirectConvolutionLayer conv{}; |
| 165 | conv.configure(&src, &weights, nullptr, &dst, conv_info); |
| 166 | |
| 167 | src.allocator()->allocate(); |
| 168 | weights.allocator()->allocate(); |
| 169 | dst.allocator()->allocate(); |
| 170 | |
| 171 | library->fill_tensor_value(CLAccessor(src), 1.f); |
| 172 | library->fill_tensor_value(CLAccessor(weights), 1.f); |
| 173 | |
| 174 | conv.run(); |
| 175 | |
| 176 | // Compute reference to compare |
| 177 | SimpleTensor<float> ref_src{ src_shape, dt }; |
| 178 | SimpleTensor<float> ref_weights{ weights_shape, dt }; |
| 179 | SimpleTensor<float> ref_bias{ bias_shape, dt }; |
| 180 | library->fill_tensor_value(ref_src, 1.f); |
| 181 | library->fill_tensor_value(ref_weights, 1.f); |
| 182 | // No bias |
| 183 | library->fill_tensor_value(ref_bias, 0.f); |
| 184 | auto ref_dst = reference::convolution_layer<float>(ref_src, ref_weights, ref_bias, dst_shape, conv_info); |
| 185 | |
| 186 | validate(CLAccessor(dst), ref_dst); |
| 187 | } |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 188 | // *INDENT-OFF* |
| 189 | // clang-format off |
Isabella Gottardi | 3f217ec | 2018-02-12 14:59:19 +0000 | [diff] [blame] | 190 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip( |
SiCong Li | 1b2f868 | 2023-01-04 10:04:26 +0000 | [diff] [blame] | 191 | framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid: Mismatching data type input/weights |
| 192 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid: Mismatching input feature maps |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 193 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid weights dimensions |
SiCong Li | 1b2f868 | 2023-01-04 10:04:26 +0000 | [diff] [blame] | 194 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Unsupported biases size |
| 195 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Unsupported biases dimensions |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 196 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid output size |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 197 | TensorInfo(TensorShape(32U, 16U, 2U), 1, DataType::F32), |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 198 | }), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 199 | framework::dataset::make("WeightsInfo",{ TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F16), |
| 200 | TensorInfo(TensorShape(3U, 3U, 3U, 4U), 1, DataType::F32), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 201 | TensorInfo(TensorShape(3U, 3U, 2U, 4U, 3U), 1, DataType::F32), |
| 202 | TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32), |
| 203 | TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32), |
| 204 | TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 205 | TensorInfo(TensorShape(1U, 1U, 2U, 4U), 1, DataType::F32), |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 206 | })), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 207 | framework::dataset::make("BiasesInfo",{ TensorInfo(TensorShape(4U), 1, DataType::F32), |
| 208 | TensorInfo(TensorShape(4U), 1, DataType::F32), |
| 209 | TensorInfo(TensorShape(4U), 1, DataType::F32), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 210 | TensorInfo(TensorShape(3U), 1, DataType::F32), |
| 211 | TensorInfo(TensorShape(4U, 2U), 1, DataType::F32), |
| 212 | TensorInfo(TensorShape(4U), 1, DataType::F32), |
| 213 | TensorInfo(TensorShape(4U), 1, DataType::F32), |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 214 | })), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 215 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32), |
| 216 | TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32), |
| 217 | TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32), |
| 218 | TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32), |
| 219 | TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 220 | TensorInfo(TensorShape(26U, 11U, 4U), 1, DataType::F32), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 221 | TensorInfo(TensorShape(32U, 16U, 4U), 1, DataType::F32), |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 222 | })), |
| 223 | framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0), |
| 224 | PadStrideInfo(1, 1, 0, 0), |
| 225 | PadStrideInfo(1, 1, 0, 0), |
| 226 | PadStrideInfo(1, 1, 0, 0), |
| 227 | PadStrideInfo(1, 1, 0, 0), |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 228 | PadStrideInfo(1, 1, 0, 0), |
Giorgio Arena | 5948634 | 2017-12-01 10:42:47 +0000 | [diff] [blame] | 229 | PadStrideInfo(1, 1, 0, 0), |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 230 | })), |
Isabella Gottardi | 3f217ec | 2018-02-12 14:59:19 +0000 | [diff] [blame] | 231 | framework::dataset::make("ActivationInfo", |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 232 | { |
SiCong Li | 1b2f868 | 2023-01-04 10:04:26 +0000 | [diff] [blame] | 233 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 234 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 235 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 236 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 237 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 238 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
Isabella Gottardi | 3f217ec | 2018-02-12 14:59:19 +0000 | [diff] [blame] | 239 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) |
| 240 | })), |
SiCong Li | 1b2f868 | 2023-01-04 10:04:26 +0000 | [diff] [blame] | 241 | framework::dataset::make("Expected", { false, false, false, false, false, false, true })), |
Isabella Gottardi | 3f217ec | 2018-02-12 14:59:19 +0000 | [diff] [blame] | 242 | input_info, weights_info, biases_info, output_info, conv_info, act_info, expected) |
| 243 | { |
| 244 | bool is_valid = bool(CLDirectConvolutionLayer::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, act_info)); |
Georgios Pinitas | 631c41a | 2017-12-06 11:53:03 +0000 | [diff] [blame] | 245 | ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS); |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 246 | } |
SiCong Li | 1b2f868 | 2023-01-04 10:04:26 +0000 | [diff] [blame] | 247 | // clang-format on |
| 248 | // *INDENT-ON* |
Georgios Pinitas | 30902ed | 2017-11-14 15:32:57 +0000 | [diff] [blame] | 249 | |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 250 | template <typename T> |
| 251 | using CLDirectConvolutionLayerFixture = DirectConvolutionValidationFixture<CLTensor, CLAccessor, CLDirectConvolutionLayer, T>; |
Jaroslaw Rzepecki | 2ecbada | 2017-11-29 13:51:34 +0000 | [diff] [blame] | 252 | template <typename T> |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 253 | using CLDirectConvolutionLayerMixedDataLayoutFixture = DirectConvolutionValidationFixture<CLTensor, CLAccessor, CLDirectConvolutionLayer, T, true>; |
| 254 | template <typename T> |
Jaroslaw Rzepecki | 2ecbada | 2017-11-29 13:51:34 +0000 | [diff] [blame] | 255 | using CLDirectConvolutionValidationWithTensorShapesFixture = DirectConvolutionValidationWithTensorShapesFixture<CLTensor, CLAccessor, CLDirectConvolutionLayer, T>; |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 256 | template <typename T> |
| 257 | using CLDirectConvolutionLayerQuantizedFixture = DirectConvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDirectConvolutionLayer, T>; |
| 258 | template <typename T> |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 259 | using CLDirectConvolutionLayerQuantizedMixedDataLayoutFixture = DirectConvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDirectConvolutionLayer, T, true>; |
| 260 | template <typename T> |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 261 | using CLDirectConvolutionValidationWithTensorShapesQuantizedFixture = DirectConvolutionValidationWithTensorShapesQuantizedFixture<CLTensor, CLAccessor, CLDirectConvolutionLayer, T>; |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 262 | |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 263 | TEST_SUITE(NHWC) |
SiCong Li | 1b2f868 | 2023-01-04 10:04:26 +0000 | [diff] [blame] | 264 | // *INDENT-OFF* |
| 265 | // clang-format off |
| 266 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip( |
| 267 | framework::dataset::make("InputInfo", { |
| 268 | TensorInfo(TensorShape(2U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Arbitrary weight sizes for NHWC are supported |
| 269 | TensorInfo(TensorShape(2U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Non-rectangular weights dimensions for NHWC are supported |
| 270 | TensorInfo(TensorShape(2U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Strides > 2 for any kernel sizes for NHWC are supported |
| 271 | }), |
| 272 | framework::dataset::make("WeightsInfo",{ |
| 273 | TensorInfo(TensorShape(2U, 13U, 13U, 4U), 1, DataType::F32, DataLayout::NHWC), |
| 274 | TensorInfo(TensorShape(2U, 5U, 3U, 4U), 1, DataType::F32, DataLayout::NHWC), |
| 275 | TensorInfo(TensorShape(2U, 3U, 3U, 4U), 1, DataType::F32, DataLayout::NHWC), |
| 276 | })), |
| 277 | framework::dataset::make("BiasesInfo",{ |
| 278 | TensorInfo(TensorShape(4U), 1, DataType::F32, DataLayout::NHWC), |
| 279 | TensorInfo(TensorShape(4U), 1, DataType::F32, DataLayout::NHWC), |
| 280 | TensorInfo(TensorShape(4U), 1, DataType::F32, DataLayout::NHWC), |
| 281 | })), |
| 282 | framework::dataset::make("OutputInfo",{ |
| 283 | TensorInfo(TensorShape(4U, 15U, 1U), 1, DataType::F32, DataLayout::NHWC), |
| 284 | TensorInfo(TensorShape(4U, 23U, 11U), 1, DataType::F32, DataLayout::NHWC), |
| 285 | TensorInfo(TensorShape(4U, 9U, 4U), 1, DataType::F32, DataLayout::NHWC), |
| 286 | })), |
| 287 | framework::dataset::make("ConvInfo", { |
| 288 | PadStrideInfo(1, 1, 0, 0), |
| 289 | PadStrideInfo(1, 1, 0, 0), |
| 290 | PadStrideInfo(3, 3, 0, 0), |
| 291 | })), |
| 292 | framework::dataset::make("ActivationInfo", |
| 293 | { |
| 294 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 295 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 296 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 297 | })), |
| 298 | framework::dataset::make("Expected", { true, true, true })), |
| 299 | input_info, weights_info, biases_info, output_info, conv_info, act_info, expected) |
| 300 | { |
| 301 | bool is_valid = bool(CLDirectConvolutionLayer::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, act_info)); |
| 302 | ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS); |
| 303 | } |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 304 | TEST_SUITE(FP16) |
| 305 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDirectConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, |
| 306 | combine(combine(combine(zip(zip(zip(zip(zip(zip( |
Gian Marco Iodice | 2ba39b6 | 2021-05-07 09:21:47 +0100 | [diff] [blame] | 307 | framework::dataset::make("InputShape", { TensorShape(27U, 13U, 23U), |
| 308 | TensorShape(19U, 5U, 16U, 4U), |
| 309 | TensorShape(13U, 5U, 17U, 2U), |
| 310 | TensorShape(32U, 37U, 13U) } ), |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 311 | framework::dataset::make("StrideX", { 1, 3, 1, 1 })), |
| 312 | framework::dataset::make("StrideY", { 1, 3, 2, 1 })), |
| 313 | framework::dataset::make("PadX", { 1, 3, 0, 4 })), |
| 314 | framework::dataset::make("PadY", { 1, 3, 0, 4 })), |
| 315 | framework::dataset::make("KernelSize", { 3, 8, 1, 9 })), |
Gian Marco Iodice | 5c9eed8 | 2021-03-19 11:26:20 +0000 | [diff] [blame] | 316 | framework::dataset::make("NumKernels", { 17, 3, 1, 19 })), |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 317 | framework::dataset::make("DataType", DataType::F16)), |
| 318 | framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) )), |
| 319 | framework::dataset::make("DataLayout", DataLayout::NHWC))) |
| 320 | { |
| 321 | validate(CLAccessor(_target), _reference, tolerance_fp16, tolerance_num); |
| 322 | } |
| 323 | |
| 324 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDirectConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, |
| 325 | combine(combine(combine(zip(zip(zip(zip(zip(zip( |
| 326 | framework::dataset::make("InputShape", { TensorShape(800U, 800U, 3U) } ), |
| 327 | framework::dataset::make("StrideX", { 1 })), |
| 328 | framework::dataset::make("StrideY", { 1 })), |
| 329 | framework::dataset::make("PadX", { 1 })), |
| 330 | framework::dataset::make("PadY", { 1 })), |
| 331 | framework::dataset::make("KernelSize", { 9 })), |
| 332 | framework::dataset::make("NumKernels", { 3 })), |
| 333 | framework::dataset::make("DataType", DataType::F16)), |
| 334 | framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::IDENTITY) )), |
| 335 | framework::dataset::make("DataLayout", DataLayout::NHWC))) |
| 336 | { |
| 337 | validate(CLAccessor(_target), _reference, tolerance_fp16, tolerance_num); |
| 338 | } |
| 339 | |
| 340 | TEST_SUITE_END() // FP16 |
| 341 | |
| 342 | TEST_SUITE(FP32) |
| 343 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDirectConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, |
| 344 | combine(combine(combine(zip(zip(zip(zip(zip(zip( |
Gian Marco Iodice | 2ba39b6 | 2021-05-07 09:21:47 +0100 | [diff] [blame] | 345 | framework::dataset::make("InputShape", { TensorShape(27U, 13U, 23U), |
| 346 | TensorShape(19U, 5U, 16U, 4U), |
| 347 | TensorShape(13U, 5U, 17U, 2U), |
| 348 | TensorShape(32U, 37U, 13U) } ), |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 349 | framework::dataset::make("StrideX", { 1, 3, 1, 1 })), |
| 350 | framework::dataset::make("StrideY", { 1, 3, 2, 1 })), |
| 351 | framework::dataset::make("PadX", { 1, 3, 0, 4 })), |
| 352 | framework::dataset::make("PadY", { 1, 3, 0, 4 })), |
| 353 | framework::dataset::make("KernelSize", { 3, 8, 1, 9 })), |
Gian Marco Iodice | 5c9eed8 | 2021-03-19 11:26:20 +0000 | [diff] [blame] | 354 | framework::dataset::make("NumKernels", { 17, 3, 1, 19 })), |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 355 | framework::dataset::make("DataType", DataType::F32)), |
| 356 | framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) )), |
| 357 | framework::dataset::make("DataLayout", DataLayout::NHWC))) |
| 358 | { |
Gunes Bayir | 38ce29d | 2021-08-04 12:45:33 +0100 | [diff] [blame] | 359 | validate(CLAccessor(_target), _reference, tolerance_fp32, 0.0, abs_tolerance_f32); |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 360 | } |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 361 | FIXTURE_DATA_TEST_CASE(RunMixedDataLayout, CLDirectConvolutionLayerMixedDataLayoutFixture<float>, framework::DatasetMode::PRECOMMIT, |
| 362 | combine(combine(combine(zip(zip(zip(zip(zip(zip( |
Gian Marco Iodice | 2ba39b6 | 2021-05-07 09:21:47 +0100 | [diff] [blame] | 363 | framework::dataset::make("InputShape", { TensorShape(27U, 13U, 23U), |
| 364 | TensorShape(19U, 5U, 16U, 4U), |
| 365 | TensorShape(13U, 5U, 17U, 2U), |
| 366 | TensorShape(32U, 37U, 13U) } ), |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 367 | framework::dataset::make("StrideX", { 1 })), |
| 368 | framework::dataset::make("StrideY", { 2 })), |
| 369 | framework::dataset::make("PadX", { 1 })), |
| 370 | framework::dataset::make("PadY", { 3 })), |
| 371 | framework::dataset::make("KernelSize", { 3 })), |
| 372 | framework::dataset::make("NumKernels", { 3 })), |
| 373 | framework::dataset::make("DataType", DataType::F32)), |
| 374 | framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) )), |
| 375 | framework::dataset::make("DataLayout", DataLayout::NHWC))) |
| 376 | { |
Gunes Bayir | 38ce29d | 2021-08-04 12:45:33 +0100 | [diff] [blame] | 377 | validate(CLAccessor(_target), _reference, tolerance_fp32, 0.0, abs_tolerance_f32); |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 378 | } |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 379 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDirectConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, |
| 380 | combine(combine(combine(zip(zip(zip(zip(zip(zip( |
| 381 | framework::dataset::make("InputShape", { TensorShape(800U, 800U, 3U) } ), |
| 382 | framework::dataset::make("StrideX", { 1 })), |
| 383 | framework::dataset::make("StrideY", { 1 })), |
| 384 | framework::dataset::make("PadX", { 1 })), |
| 385 | framework::dataset::make("PadY", { 1 })), |
| 386 | framework::dataset::make("KernelSize", { 9 })), |
| 387 | framework::dataset::make("NumKernels", { 3 })), |
| 388 | framework::dataset::make("DataType", DataType::F32)), |
| 389 | framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::IDENTITY) )), |
| 390 | framework::dataset::make("DataLayout", DataLayout::NHWC))) |
| 391 | { |
Gunes Bayir | 38ce29d | 2021-08-04 12:45:33 +0100 | [diff] [blame] | 392 | validate(CLAccessor(_target), _reference, tolerance_fp32, 0.0, abs_tolerance_f32); |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 393 | } |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 394 | TEST_SUITE_END() // FP32 |
| 395 | |
| 396 | TEST_SUITE(Quantized) |
| 397 | TEST_SUITE(QASYMM8) |
| 398 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDirectConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
| 399 | combine(combine(combine(combine(zip(zip(zip(zip(zip(zip( |
Gian Marco Iodice | 2ba39b6 | 2021-05-07 09:21:47 +0100 | [diff] [blame] | 400 | framework::dataset::make("InputShape", { TensorShape(27U, 13U, 23U), |
| 401 | TensorShape(19U, 5U, 16U, 4U), |
| 402 | TensorShape(13U, 5U, 17U, 2U), |
| 403 | TensorShape(32U, 37U, 13U) } ), |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 404 | framework::dataset::make("StrideX", { 1, 3, 1, 1 })), |
| 405 | framework::dataset::make("StrideY", { 1, 3, 2, 1 })), |
| 406 | framework::dataset::make("PadX", { 1, 3, 0, 4 })), |
| 407 | framework::dataset::make("PadY", { 1, 3, 0, 4 })), |
| 408 | framework::dataset::make("KernelSize", { 3, 8, 1, 9 })), |
| 409 | framework::dataset::make("NumKernels", { 7, 3, 1, 3 })), |
| 410 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 411 | framework::dataset::make("QuantizationInfo", QuantizationInfo(1.1f / 255, 10))), |
| 412 | framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) )), |
| 413 | framework::dataset::make("DataLayout", DataLayout::NHWC))) |
| 414 | { |
| 415 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 416 | } |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 417 | FIXTURE_DATA_TEST_CASE(RunMixedDataLayout, CLDirectConvolutionLayerQuantizedMixedDataLayoutFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
| 418 | combine(combine(combine(combine(zip(zip(zip(zip(zip(zip( |
Gian Marco Iodice | 2ba39b6 | 2021-05-07 09:21:47 +0100 | [diff] [blame] | 419 | framework::dataset::make("InputShape", { TensorShape(27U, 13U, 23U), |
| 420 | TensorShape(19U, 5U, 16U, 4U), |
| 421 | TensorShape(13U, 5U, 17U, 2U), |
| 422 | TensorShape(32U, 37U, 13U) } ), |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 423 | framework::dataset::make("StrideX", { 1 })), |
| 424 | framework::dataset::make("StrideY", { 2 })), |
| 425 | framework::dataset::make("PadX", { 1 })), |
| 426 | framework::dataset::make("PadY", { 1 })), |
| 427 | framework::dataset::make("KernelSize", { 3 })), |
| 428 | framework::dataset::make("NumKernels", { 3 })), |
| 429 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 430 | framework::dataset::make("QuantizationInfo", QuantizationInfo(1.1f / 255, 10))), |
| 431 | framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) )), |
| 432 | framework::dataset::make("DataLayout", DataLayout::NHWC))) |
| 433 | { |
| 434 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 435 | } |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 436 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDirectConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
| 437 | combine(combine(combine(combine(zip(zip(zip(zip(zip(zip( |
| 438 | framework::dataset::make("InputShape", { TensorShape(800U, 800U, 3U) } ), |
| 439 | framework::dataset::make("StrideX", { 1 })), |
| 440 | framework::dataset::make("StrideY", { 1 })), |
| 441 | framework::dataset::make("PadX", { 1 })), |
| 442 | framework::dataset::make("PadY", { 1 })), |
| 443 | framework::dataset::make("KernelSize", { 9 })), |
| 444 | framework::dataset::make("NumKernels", { 3 })), |
| 445 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 446 | framework::dataset::make("QuantizationInfo", QuantizationInfo(2.f / 255, 10))), |
| 447 | framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) )), |
| 448 | framework::dataset::make("DataLayout", DataLayout::NHWC))) |
| 449 | { |
| 450 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 451 | } |
| 452 | |
| 453 | TEST_SUITE_END() // QASYMM8 |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 454 | TEST_SUITE(QASYMM8_SIGNED) |
| 455 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDirectConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, |
| 456 | combine(combine(combine(combine(zip(zip(zip(zip(zip(zip( |
Gian Marco Iodice | 2ba39b6 | 2021-05-07 09:21:47 +0100 | [diff] [blame] | 457 | framework::dataset::make("InputShape", { TensorShape(27U, 13U, 23U), |
| 458 | TensorShape(19U, 5U, 16U, 4U), |
| 459 | TensorShape(13U, 5U, 17U, 2U), |
| 460 | TensorShape(32U, 37U, 13U) } ), |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 461 | framework::dataset::make("StrideX", { 1, 3, 1, 1 })), |
| 462 | framework::dataset::make("StrideY", { 1, 3, 2, 1 })), |
| 463 | framework::dataset::make("PadX", { 1, 3, 0, 4 })), |
| 464 | framework::dataset::make("PadY", { 1, 3, 0, 4 })), |
| 465 | framework::dataset::make("KernelSize", { 3, 8, 1, 9 })), |
| 466 | framework::dataset::make("NumKernels", { 7, 3, 1, 3 })), |
| 467 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 468 | framework::dataset::make("QuantizationInfo", QuantizationInfo(2.f / 255, 10))), |
| 469 | framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) )), |
| 470 | framework::dataset::make("DataLayout", DataLayout::NHWC))) |
| 471 | { |
| 472 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 473 | } |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 474 | FIXTURE_DATA_TEST_CASE(RunMixedDataLayout, CLDirectConvolutionLayerQuantizedMixedDataLayoutFixture<int8_t>, framework::DatasetMode::PRECOMMIT, |
| 475 | combine(combine(combine(combine(zip(zip(zip(zip(zip(zip( |
Gian Marco Iodice | 2ba39b6 | 2021-05-07 09:21:47 +0100 | [diff] [blame] | 476 | framework::dataset::make("InputShape", { TensorShape(27U, 13U, 23U), |
| 477 | TensorShape(19U, 5U, 16U, 4U), |
| 478 | TensorShape(13U, 5U, 17U, 2U), |
| 479 | TensorShape(32U, 37U, 13U) } ), |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 480 | framework::dataset::make("StrideX", { 1 })), |
| 481 | framework::dataset::make("StrideY", { 1 })), |
| 482 | framework::dataset::make("PadX", { 1 })), |
| 483 | framework::dataset::make("PadY", { 1 })), |
| 484 | framework::dataset::make("KernelSize", { 3 })), |
| 485 | framework::dataset::make("NumKernels", { 3 })), |
| 486 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 487 | framework::dataset::make("QuantizationInfo", QuantizationInfo(2.f / 255, 10))), |
| 488 | framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) )), |
| 489 | framework::dataset::make("DataLayout", DataLayout::NHWC))) |
| 490 | { |
| 491 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 492 | } |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 493 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDirectConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY, |
| 494 | combine(combine(combine(combine(zip(zip(zip(zip(zip(zip( |
| 495 | framework::dataset::make("InputShape", { TensorShape(800U, 800U, 3U) } ), |
| 496 | framework::dataset::make("StrideX", { 1 })), |
| 497 | framework::dataset::make("StrideY", { 1 })), |
| 498 | framework::dataset::make("PadX", { 1 })), |
| 499 | framework::dataset::make("PadY", { 1 })), |
| 500 | framework::dataset::make("KernelSize", { 9 })), |
| 501 | framework::dataset::make("NumKernels", { 3 })), |
| 502 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 503 | framework::dataset::make("QuantizationInfo", QuantizationInfo(2.f / 255, 10))), |
| 504 | framework::dataset::make("ActivationInfo", ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) )), |
| 505 | framework::dataset::make("DataLayout", DataLayout::NHWC))) |
| 506 | { |
| 507 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 508 | } |
| 509 | TEST_SUITE_END() // QASYMM8_SIGNED |
| 510 | TEST_SUITE_END() // Quantized |
| 511 | TEST_SUITE_END() // NHWC |
| 512 | |
SiCong Li | 1b2f868 | 2023-01-04 10:04:26 +0000 | [diff] [blame] | 513 | TEST_SUITE(NCHW) |
| 514 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip( |
| 515 | framework::dataset::make("InputInfo", { |
| 516 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32, DataLayout::NCHW), // Unsupported kernel width |
| 517 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32, DataLayout::NCHW), // Non-rectangular weights dimensions are unsupported |
| 518 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32, DataLayout::NCHW) // Unsupported stride |
| 519 | }), |
| 520 | framework::dataset::make("WeightsInfo",{ |
| 521 | TensorInfo(TensorShape(11U, 11U, 2U, 4U), 1, DataType::F32, DataLayout::NCHW), |
| 522 | TensorInfo(TensorShape(5U, 3U, 2U, 4U), 1, DataType::F32, DataLayout::NCHW), |
| 523 | TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32, DataLayout::NCHW) |
| 524 | })), |
| 525 | framework::dataset::make("BiasesInfo",{ |
| 526 | TensorInfo(TensorShape(4U), 1, DataType::F32, DataLayout::NCHW), |
| 527 | TensorInfo(TensorShape(4U), 1, DataType::F32, DataLayout::NCHW), |
| 528 | TensorInfo(TensorShape(4U), 1, DataType::F32, DataLayout::NCHW) |
| 529 | })), |
| 530 | framework::dataset::make("OutputInfo",{ |
| 531 | TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32, DataLayout::NCHW), |
| 532 | TensorInfo(TensorShape(23U, 11U, 4U), 1, DataType::F32, DataLayout::NCHW), |
| 533 | TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32, DataLayout::NCHW) |
| 534 | })), |
| 535 | framework::dataset::make("ConvInfo", { |
| 536 | PadStrideInfo(1, 1, 0, 0), |
| 537 | PadStrideInfo(1, 1, 0, 0), |
| 538 | PadStrideInfo(3, 3, 0, 0) |
| 539 | })), |
| 540 | framework::dataset::make("ActivationInfo", |
| 541 | { |
| 542 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 543 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 544 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) |
| 545 | })), |
| 546 | framework::dataset::make("Expected", { false, false, false})), |
| 547 | input_info, weights_info, biases_info, output_info, conv_info, act_info, expected) |
| 548 | { |
| 549 | bool is_valid = bool(CLDirectConvolutionLayer::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, act_info)); |
| 550 | ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS); |
| 551 | } |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 552 | // clang-format on |
| 553 | // *INDENT-ON* |
SiCong Li | 1b2f868 | 2023-01-04 10:04:26 +0000 | [diff] [blame] | 554 | |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 555 | TEST_SUITE(Float) |
| 556 | TEST_SUITE(FP16) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 557 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDirectConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data_precommit, framework::dataset::make("DataType", DataType::F16)), |
| 558 | ActivationFunctionsDataset), |
| 559 | framework::dataset::make("DataLayout", DataLayout::NCHW))) |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 560 | { |
| 561 | // Validate output |
steniu01 | 3e05e4e | 2017-08-25 17:18:01 +0100 | [diff] [blame] | 562 | validate(CLAccessor(_target), _reference, tolerance_fp16, tolerance_num); |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 563 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 564 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDirectConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data_nightly, framework::dataset::make("DataType", DataType::F16)), |
| 565 | ActivationFunctionsDataset), |
| 566 | framework::dataset::make("DataLayout", DataLayout::NCHW))) |
| 567 | { |
| 568 | // Validate output |
| 569 | validate(CLAccessor(_target), _reference, tolerance_fp16, tolerance_num); |
| 570 | } |
| 571 | TEST_SUITE_END() // FP16 |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 572 | |
| 573 | TEST_SUITE(FP32) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 574 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDirectConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data_precommit, framework::dataset::make("DataType", |
| 575 | DataType::F32)), |
| 576 | ActivationFunctionsDataset), |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 577 | framework::dataset::make("DataLayout", { DataLayout::NCHW }))) |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 578 | { |
Gunes Bayir | 38ce29d | 2021-08-04 12:45:33 +0100 | [diff] [blame] | 579 | validate(CLAccessor(_target), _reference, tolerance_fp32, 0.0, abs_tolerance_f32); |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 580 | } |
Gunes Bayir | 38ce29d | 2021-08-04 12:45:33 +0100 | [diff] [blame] | 581 | FIXTURE_DATA_TEST_CASE(RunMixedDataLayout, CLDirectConvolutionLayerMixedDataLayoutFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data_precommit, |
| 582 | framework::dataset::make("DataType", |
| 583 | DataType::F32)), |
| 584 | ActivationFunctionsDataset), |
| 585 | framework::dataset::make("DataLayout", { DataLayout::NCHW }))) |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 586 | { |
Gunes Bayir | 38ce29d | 2021-08-04 12:45:33 +0100 | [diff] [blame] | 587 | validate(CLAccessor(_target), _reference, tolerance_fp32, 0.0, abs_tolerance_f32); |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 588 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 589 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDirectConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data_nightly, framework::dataset::make("DataType", DataType::F32)), |
| 590 | ActivationFunctionsDataset), |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 591 | framework::dataset::make("DataLayout", { DataLayout::NCHW }))) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 592 | { |
Gunes Bayir | 38ce29d | 2021-08-04 12:45:33 +0100 | [diff] [blame] | 593 | validate(CLAccessor(_target), _reference, tolerance_fp32, 0.0, abs_tolerance_f32); |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 594 | } |
| 595 | TEST_SUITE_END() // FP32 |
Jaroslaw Rzepecki | 2ecbada | 2017-11-29 13:51:34 +0000 | [diff] [blame] | 596 | |
| 597 | TEST_SUITE(FP32_CustomDataset) |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 598 | FIXTURE_DATA_TEST_CASE(Run, CLDirectConvolutionValidationWithTensorShapesFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(datasets::DirectConvolutionLayerDataset(), |
Isabella Gottardi | 3f217ec | 2018-02-12 14:59:19 +0000 | [diff] [blame] | 599 | framework::dataset::make("DataType", DataType::F32)), |
| 600 | ActivationFunctionsDataset)) |
Jaroslaw Rzepecki | 2ecbada | 2017-11-29 13:51:34 +0000 | [diff] [blame] | 601 | { |
| 602 | // Validate output |
Gunes Bayir | 38ce29d | 2021-08-04 12:45:33 +0100 | [diff] [blame] | 603 | validate(CLAccessor(_target), _reference, tolerance_fp32, 0.0, abs_tolerance_f32); |
Jaroslaw Rzepecki | 2ecbada | 2017-11-29 13:51:34 +0000 | [diff] [blame] | 604 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 605 | TEST_SUITE_END() // FP32_CustomDataset |
| 606 | TEST_SUITE_END() // Float |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 607 | |
Isabella Gottardi | 3f217ec | 2018-02-12 14:59:19 +0000 | [diff] [blame] | 608 | const auto QuantizedActivationFunctionsDataset = framework::dataset::make("ActivationInfo", |
| 609 | { |
| 610 | ActivationLayerInfo(), |
| 611 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 612 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 6.f) |
| 613 | }); |
Chunosov | d621bca | 2017-11-03 17:33:15 +0700 | [diff] [blame] | 614 | TEST_SUITE(Quantized) |
| 615 | TEST_SUITE(QASYMM8) |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 616 | FIXTURE_DATA_TEST_CASE(RunMixedDataLayout, CLDirectConvolutionLayerQuantizedMixedDataLayoutFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(data_precommit, |
| 617 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Gunes Bayir | 38ce29d | 2021-08-04 12:45:33 +0100 | [diff] [blame] | 618 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(2.f / 255, 10) })), |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 619 | QuantizedActivationFunctionsDataset), |
| 620 | framework::dataset::make("DataLayout", { DataLayout::NCHW }))) |
| 621 | { |
| 622 | // Validate output |
| 623 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 624 | } |
Giorgio Arena | e620a83 | 2020-02-17 16:33:20 +0000 | [diff] [blame] | 625 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDirectConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(data_precommit, |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 626 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Michele Di Giorgio | 14cbfb2 | 2019-10-23 10:53:10 +0100 | [diff] [blame] | 627 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(2.f / 255, 10), QuantizationInfo(1.1f, 10) })), |
Giorgio Arena | e620a83 | 2020-02-17 16:33:20 +0000 | [diff] [blame] | 628 | QuantizedActivationFunctionsDataset), |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 629 | framework::dataset::make("DataLayout", { DataLayout::NCHW }))) |
Sang-Hoon Park | ab5b1a2 | 2019-10-15 09:29:13 +0100 | [diff] [blame] | 630 | { |
| 631 | // Validate output |
| 632 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 633 | } |
Giorgio Arena | e620a83 | 2020-02-17 16:33:20 +0000 | [diff] [blame] | 634 | FIXTURE_DATA_TEST_CASE(RunSmall9x9, CLDirectConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(data_precommit_9x9, |
| 635 | framework::dataset::make("DataType", |
| 636 | DataType::QASYMM8)), |
Manuel Bottini | 136174a | 2020-11-24 13:04:19 +0000 | [diff] [blame] | 637 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(3.f / 255, 10), QuantizationInfo(1.1f, 10) })), |
Giorgio Arena | e620a83 | 2020-02-17 16:33:20 +0000 | [diff] [blame] | 638 | QuantizedActivationFunctionsDataset), |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 639 | framework::dataset::make("DataLayout", { DataLayout::NCHW }))) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 640 | { |
| 641 | // Validate output |
| 642 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 643 | } |
Giorgio Arena | e620a83 | 2020-02-17 16:33:20 +0000 | [diff] [blame] | 644 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDirectConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(data_nightly, framework::dataset::make("DataType", |
Sang-Hoon Park | ab5b1a2 | 2019-10-15 09:29:13 +0100 | [diff] [blame] | 645 | DataType::QASYMM8)), |
Michele Di Giorgio | 14cbfb2 | 2019-10-23 10:53:10 +0100 | [diff] [blame] | 646 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(2.f / 255, 10), QuantizationInfo(1.1f, 10) })), |
Giorgio Arena | e620a83 | 2020-02-17 16:33:20 +0000 | [diff] [blame] | 647 | QuantizedActivationFunctionsDataset), |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 648 | framework::dataset::make("DataLayout", { DataLayout::NCHW }))) |
Giorgio Arena | e620a83 | 2020-02-17 16:33:20 +0000 | [diff] [blame] | 649 | { |
| 650 | // Validate output |
| 651 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 652 | } |
| 653 | FIXTURE_DATA_TEST_CASE(RunLarge9x9, CLDirectConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(data_nightly_9x9, |
| 654 | framework::dataset::make("DataType", |
| 655 | DataType::QASYMM8)), |
Manuel Bottini | 136174a | 2020-11-24 13:04:19 +0000 | [diff] [blame] | 656 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(3.f / 255, 10), QuantizationInfo(1.1f, 10) })), |
Giorgio Arena | e620a83 | 2020-02-17 16:33:20 +0000 | [diff] [blame] | 657 | QuantizedActivationFunctionsDataset), |
| 658 | framework::dataset::make("DataLayout", { DataLayout::NCHW }))) |
Sang-Hoon Park | ab5b1a2 | 2019-10-15 09:29:13 +0100 | [diff] [blame] | 659 | { |
| 660 | // Validate output |
| 661 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 662 | } |
| 663 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 664 | TEST_SUITE_END() // QASYMM8 |
Jaroslaw Rzepecki | 2ecbada | 2017-11-29 13:51:34 +0000 | [diff] [blame] | 665 | |
| 666 | TEST_SUITE(QASYMM8_CustomDataset) |
Giorgio Arena | e620a83 | 2020-02-17 16:33:20 +0000 | [diff] [blame] | 667 | FIXTURE_DATA_TEST_CASE(Run, CLDirectConvolutionValidationWithTensorShapesQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
| 668 | combine(combine(combine(combine(datasets::DirectConvolutionLayerDataset(), |
| 669 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 670 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(2.f / 255, 127), QuantizationInfo(1.1f, 10) })), |
| 671 | QuantizedActivationFunctionsDataset), |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 672 | framework::dataset::make("DataLayout", { DataLayout::NCHW }))) |
Jaroslaw Rzepecki | 2ecbada | 2017-11-29 13:51:34 +0000 | [diff] [blame] | 673 | { |
| 674 | // Validate output |
| 675 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 676 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 677 | TEST_SUITE_END() // QASYMM8_CustomDataset |
Sheri Zhang | 681f2d4 | 2020-02-20 11:23:08 +0000 | [diff] [blame] | 678 | |
| 679 | TEST_SUITE(QASYMM8_SIGNED) |
| 680 | |
Giorgio Arena | e620a83 | 2020-02-17 16:33:20 +0000 | [diff] [blame] | 681 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDirectConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(data_precommit, framework::dataset::make("DataType", |
Sheri Zhang | 681f2d4 | 2020-02-20 11:23:08 +0000 | [diff] [blame] | 682 | DataType::QASYMM8_SIGNED)), |
| 683 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(2.f / 255, 10), QuantizationInfo(1.1f, -10) })), |
Giorgio Arena | e620a83 | 2020-02-17 16:33:20 +0000 | [diff] [blame] | 684 | QuantizedActivationFunctionsDataset), |
| 685 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Sheri Zhang | 681f2d4 | 2020-02-20 11:23:08 +0000 | [diff] [blame] | 686 | { |
| 687 | // Validate output |
| 688 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 689 | } |
Gunes Bayir | 38ce29d | 2021-08-04 12:45:33 +0100 | [diff] [blame] | 690 | FIXTURE_DATA_TEST_CASE(RunMixedDataLayout, CLDirectConvolutionLayerQuantizedMixedDataLayoutFixture<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(data_precommit, |
| 691 | framework::dataset::make("DataType", |
| 692 | DataType::QASYMM8_SIGNED)), |
| 693 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(1.1f, -10) })), |
| 694 | QuantizedActivationFunctionsDataset), |
| 695 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 696 | { |
| 697 | // Validate output |
| 698 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 699 | } |
Giorgio Arena | e620a83 | 2020-02-17 16:33:20 +0000 | [diff] [blame] | 700 | FIXTURE_DATA_TEST_CASE(RunSmall9x9, CLDirectConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::ALL, combine(combine(combine(combine(data_precommit_9x9, |
Sheri Zhang | 681f2d4 | 2020-02-20 11:23:08 +0000 | [diff] [blame] | 701 | framework::dataset::make("DataType", |
| 702 | DataType::QASYMM8_SIGNED)), |
| 703 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(2.f / 255, 10), QuantizationInfo(1.1f, 10) })), |
Giorgio Arena | e620a83 | 2020-02-17 16:33:20 +0000 | [diff] [blame] | 704 | QuantizedActivationFunctionsDataset), |
| 705 | framework::dataset::make("DataLayout", { DataLayout::NCHW }))) |
Sheri Zhang | 681f2d4 | 2020-02-20 11:23:08 +0000 | [diff] [blame] | 706 | { |
| 707 | // Validate output |
| 708 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 709 | } |
| 710 | |
| 711 | FIXTURE_DATA_TEST_CASE(RunCustomDataset, CLDirectConvolutionValidationWithTensorShapesQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY, |
Giorgio Arena | e620a83 | 2020-02-17 16:33:20 +0000 | [diff] [blame] | 712 | combine(combine(combine(combine(datasets::DirectConvolutionLayerDataset(), |
| 713 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 714 | framework::dataset::make("QuantizationInfo", { QuantizationInfo(2.f / 255, 127), QuantizationInfo(1.1f, 10) })), |
| 715 | QuantizedActivationFunctionsDataset), |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 716 | framework::dataset::make("DataLayout", { DataLayout::NCHW }))) |
Sheri Zhang | 681f2d4 | 2020-02-20 11:23:08 +0000 | [diff] [blame] | 717 | { |
| 718 | // Validate output |
| 719 | validate(CLAccessor(_target), _reference, tolerance_qasymm8); |
| 720 | } |
| 721 | |
| 722 | TEST_SUITE_END() // QASYMM8_SIGNED |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 723 | TEST_SUITE_END() // Quantized |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 724 | TEST_SUITE_END() // NCHW |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 725 | TEST_SUITE_END() // DirectConvolutionLayer |
Gian Marco Iodice | 0841ca0 | 2021-02-01 14:37:02 +0000 | [diff] [blame] | 726 | TEST_SUITE_END() // CL |
| 727 | |
Moritz Pflanzer | b3d2579 | 2017-07-26 11:49:37 +0100 | [diff] [blame] | 728 | } // namespace validation |
| 729 | } // namespace test |
Anthony Barbier | 1c0d0ff | 2018-01-31 13:05:09 +0000 | [diff] [blame] | 730 | } // namespace arm_compute |