Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 1 | /* |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 2 | * Copyright (c) 2019-2021 Arm Limited. |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +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 | */ |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 24 | #include "arm_compute/core/KernelDescriptors.h" |
| 25 | #include "arm_compute/core/Types.h" |
| 26 | #include "arm_compute/core/utils/misc/ShapeCalculator.h" |
| 27 | #include "arm_compute/runtime/CL/CLTensor.h" |
| 28 | #include "arm_compute/runtime/CL/CLTensorAllocator.h" |
Sang-Hoon Park | bef7fa2 | 2020-10-21 15:58:54 +0100 | [diff] [blame] | 29 | #include "src/core/CL/kernels/CLDepthwiseConvolutionLayerNativeKernel.h" |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 30 | #include "tests/CL/CLAccessor.h" |
| 31 | #include "tests/CL/Helper.h" |
| 32 | #include "tests/PaddingCalculator.h" |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 33 | #include "tests/framework/Asserts.h" |
| 34 | #include "tests/framework/Macros.h" |
| 35 | #include "tests/framework/datasets/Datasets.h" |
| 36 | #include "tests/validation/Validation.h" |
| 37 | #include "tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h" |
| 38 | |
| 39 | namespace arm_compute |
| 40 | { |
| 41 | namespace test |
| 42 | { |
| 43 | namespace validation |
| 44 | { |
| 45 | using namespace arm_compute::misc::shape_calculator; |
| 46 | |
| 47 | // Create function for CLDepthwiseConvolutionLayerNativeKernel |
| 48 | using CLDepthwiseConvolutionLayerNative = CLSynthetizeFunction<CLDepthwiseConvolutionLayerNativeKernel>; |
| 49 | |
| 50 | // Fixture for CLDepthwiseConvolutionLayerNative |
| 51 | template <typename T> |
| 52 | using CLDepthwiseConvolutionLayerNativeFixture = DepthwiseConvolutionLayerNativeConfigurableValidationFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayerNative, T>; |
| 53 | |
| 54 | namespace |
| 55 | { |
| 56 | // *INDENT-OFF* |
| 57 | // clang-format off |
| 58 | RelativeTolerance<float> rel_tolerance_f32(0.001f); |
| 59 | constexpr float abs_tolerance_f32(0.0001f); |
| 60 | |
Giorgio Arena | dac622a | 2019-12-23 15:01:17 +0000 | [diff] [blame] | 61 | RelativeTolerance<half_float::half> rel_tolerance_f16(half_float::half(0.01f)); |
Michele Di Giorgio | 7d7c420 | 2020-02-25 20:13:36 +0000 | [diff] [blame] | 62 | constexpr float abs_tolerance_f16(0.03f); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 63 | |
| 64 | /** Width values to test - Precommit */ |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 65 | const auto width_values_precommit = framework::dataset::make("width", { 1U, 33U } ); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 66 | |
| 67 | /** Width values to test - Nightly */ |
| 68 | const auto width_values_nightly = framework::dataset::make("width", { 53U, 47U } ); |
| 69 | |
| 70 | /** Height values to test - Precommit */ |
| 71 | const auto height_values_precommit = framework::dataset::make("height", { 19U } ); |
| 72 | |
| 73 | /** Height values to test - Nightly */ |
| 74 | const auto height_values_nightly = framework::dataset::make("height", { 39U, 43U } ); |
| 75 | |
| 76 | /** Channel values to test - Precommit */ |
| 77 | const auto channel_values_precommit = framework::dataset::make("channels", { 15U }); |
| 78 | |
| 79 | /** Channel values to test - Nightly */ |
| 80 | const auto channel_values_nightly = framework::dataset::make("channels", { 33U, 19U }); |
| 81 | |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 82 | /** Channel values to test with cl_image support - Precommit */ |
| 83 | const auto channel_values_export_to_cl_image_precommit = framework::dataset::make("channels", { 16U }); |
| 84 | |
| 85 | /** Channel values to test with cl_image support - Nightly */ |
| 86 | const auto channel_values_export_to_cl_image_nightly = framework::dataset::make("channels", { 32U }); |
| 87 | |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 88 | /** Batch values to test - Precommit */ |
| 89 | const auto batch_values_precommit = framework::dataset::make("batch", { 1U, 2U }); |
| 90 | |
| 91 | /** Batch values to test - Nightly */ |
| 92 | const auto batch_values_nightly = framework::dataset::make("batch", { 1U, 3U }); |
| 93 | |
| 94 | /** Kernel size values to test - Precommit */ |
| 95 | const auto kernel_sz_values_precommit = framework::dataset::make("kernel_size", { Size2D(1U, 1U), Size2D(1U, 3U), Size2D(5U, 5U) }); |
| 96 | |
| 97 | /** Kernel size values to test - Nightly */ |
| 98 | const auto kernel_sz_values_nightly = framework::dataset::make("kernel_size", { Size2D(3U, 5U), Size2D(5U, 1U), Size2D(1U, 7U), Size2D(9U, 7U) }); |
| 99 | |
| 100 | /** Depth multiplier values to test - All */ |
| 101 | const auto depth_multiplier_values = framework::dataset::make("depth_multiplier", {3U}); |
| 102 | |
| 103 | /** Dilation values to test - All */ |
| 104 | const auto dilation_values = framework::dataset::make("dilation", { Size2D(1U, 1U), Size2D(3U, 3U) }); |
| 105 | |
| 106 | /** Stride values to test - All */ |
| 107 | const auto stride_values = framework::dataset::make("stride", { Size2D(1U, 1U), Size2D(3U, 2U) }); |
| 108 | |
| 109 | /** Padding values to test - All */ |
| 110 | const auto padding_valid_values = framework::dataset::make("padding_valid", { true, false }); |
| 111 | |
| 112 | /** Data type values to test - All */ |
| 113 | const auto data_type_values = framework::dataset::make("data_type", { DataType::F32, DataType::F16 }); |
| 114 | |
| 115 | /** Data layout values to test - All */ |
| 116 | const auto data_layout_values = framework::dataset::make("data_layout", { DataLayout::NHWC }); |
| 117 | |
| 118 | /** N0 values to test - Precommit */ |
| 119 | const auto n0_values_precommit = framework::dataset::make("N0", {2, 4}); |
| 120 | |
| 121 | /** N0 values to test - Nightly */ |
| 122 | const auto n0_values_nightly = framework::dataset::make("N0", {3, 8}); |
| 123 | |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 124 | /** N0 values to test with cl_image support - Precommit */ |
| 125 | const auto n0_values_export_to_cl_image_precommit = framework::dataset::make("N0", {4}); |
| 126 | |
| 127 | /** N0 values to test with cl_image support - Nightly */ |
| 128 | const auto n0_values_export_to_cl_image_nightly = framework::dataset::make("N0", {8}); |
| 129 | |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 130 | /** Activation values to test */ |
| 131 | const auto act_values = framework::dataset::make("Activation", |
| 132 | { |
| 133 | ActivationLayerInfo(), |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 134 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 6.0f, 0.5f), |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 135 | }); |
| 136 | |
| 137 | } // namespace |
| 138 | |
| 139 | TEST_SUITE(CL) |
| 140 | TEST_SUITE(DepthwiseConvolutionLayerNative) |
| 141 | TEST_SUITE(Float) |
| 142 | TEST_SUITE(FP32) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 143 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerNativeFixture<float>, framework::DatasetMode::ALL, |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 144 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 145 | width_values_precommit, |
| 146 | height_values_precommit), |
| 147 | channel_values_precommit), |
| 148 | batch_values_precommit), |
| 149 | kernel_sz_values_precommit), |
| 150 | framework::dataset::make("depth_multiplier", 1)), |
| 151 | dilation_values), |
| 152 | stride_values), |
| 153 | padding_valid_values), |
| 154 | framework::dataset::make("DataType", DataType::F32)), |
| 155 | data_layout_values), |
| 156 | act_values), |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 157 | n0_values_precommit), |
| 158 | framework::dataset::make("ExportToCLImage", false))) |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 159 | { |
| 160 | // Validate output |
| 161 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 162 | } |
| 163 | |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 164 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerNativeFixture<float>, framework::DatasetMode::NIGHTLY, |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 165 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 166 | width_values_nightly, |
| 167 | height_values_nightly), |
| 168 | channel_values_nightly), |
| 169 | batch_values_nightly), |
| 170 | kernel_sz_values_nightly), |
| 171 | framework::dataset::make("depth_multiplier", 1)), |
| 172 | dilation_values), |
| 173 | stride_values), |
| 174 | padding_valid_values), |
| 175 | framework::dataset::make("DataType", DataType::F32)), |
| 176 | data_layout_values), |
| 177 | act_values), |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 178 | n0_values_nightly), |
| 179 | framework::dataset::make("ExportToCLImage", false))) |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 180 | { |
| 181 | // Validate output |
| 182 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 183 | } |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 184 | |
| 185 | TEST_SUITE(ExportWeightsToCLImage) |
| 186 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerNativeFixture<float>, framework::DatasetMode::ALL, |
| 187 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
| 188 | width_values_precommit, |
| 189 | height_values_precommit), |
| 190 | channel_values_export_to_cl_image_precommit), |
| 191 | batch_values_precommit), |
| 192 | kernel_sz_values_precommit), |
| 193 | framework::dataset::make("depth_multiplier", 1)), |
| 194 | dilation_values), |
| 195 | stride_values), |
| 196 | padding_valid_values), |
| 197 | framework::dataset::make("DataType", DataType::F32)), |
| 198 | data_layout_values), |
| 199 | act_values), |
| 200 | n0_values_export_to_cl_image_precommit), |
| 201 | framework::dataset::make("ExportToCLImage", true))) |
| 202 | { |
| 203 | // Validate output |
| 204 | if(_validate_output) |
| 205 | { |
| 206 | // Validate output |
| 207 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 208 | } |
| 209 | else |
| 210 | { |
| 211 | ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped"); |
| 212 | framework::ARM_COMPUTE_PRINT_INFO(); |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerNativeFixture<float>, framework::DatasetMode::NIGHTLY, |
| 217 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
| 218 | width_values_nightly, |
| 219 | height_values_nightly), |
| 220 | channel_values_export_to_cl_image_nightly), |
| 221 | batch_values_nightly), |
| 222 | kernel_sz_values_nightly), |
| 223 | framework::dataset::make("depth_multiplier", 1)), |
| 224 | dilation_values), |
| 225 | stride_values), |
| 226 | padding_valid_values), |
| 227 | framework::dataset::make("DataType", DataType::F32)), |
| 228 | data_layout_values), |
| 229 | act_values), |
| 230 | n0_values_export_to_cl_image_nightly), |
| 231 | framework::dataset::make("ExportToCLImage", true))) |
| 232 | { |
| 233 | // Validate output |
| 234 | if(_validate_output) |
| 235 | { |
| 236 | // Validate output |
| 237 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 238 | } |
| 239 | else |
| 240 | { |
| 241 | ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped"); |
| 242 | framework::ARM_COMPUTE_PRINT_INFO(); |
| 243 | } |
| 244 | } |
| 245 | TEST_SUITE_END() // ExportWeightsToCLImage |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 246 | TEST_SUITE_END() // FP32 |
| 247 | |
| 248 | TEST_SUITE(FP16) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 249 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerNativeFixture<half>, framework::DatasetMode::ALL, |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 250 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 251 | width_values_precommit, |
| 252 | height_values_precommit), |
| 253 | channel_values_precommit), |
| 254 | batch_values_precommit), |
| 255 | kernel_sz_values_precommit), |
| 256 | framework::dataset::make("depth_multiplier", 1)), |
| 257 | dilation_values), |
| 258 | stride_values), |
| 259 | padding_valid_values), |
| 260 | framework::dataset::make("DataType", DataType::F16)), |
| 261 | data_layout_values), |
| 262 | act_values), |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 263 | n0_values_precommit), |
| 264 | framework::dataset::make("ExportToCLImage", false))) |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 265 | { |
| 266 | // Validate output |
Giorgio Arena | dac622a | 2019-12-23 15:01:17 +0000 | [diff] [blame] | 267 | validate(CLAccessor(_target), _reference, rel_tolerance_f16); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 268 | } |
| 269 | |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 270 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerNativeFixture<half>, framework::DatasetMode::NIGHTLY, |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 271 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 272 | width_values_nightly, |
| 273 | height_values_nightly), |
| 274 | channel_values_nightly), |
| 275 | batch_values_nightly), |
| 276 | kernel_sz_values_nightly), |
| 277 | framework::dataset::make("depth_multiplier", 1)), |
| 278 | dilation_values), |
| 279 | stride_values), |
| 280 | padding_valid_values), |
| 281 | framework::dataset::make("DataType", DataType::F16)), |
| 282 | data_layout_values), |
| 283 | act_values), |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 284 | n0_values_nightly), |
| 285 | framework::dataset::make("ExportToCLImage", false))) |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 286 | { |
| 287 | // Validate output |
Giorgio Arena | dac622a | 2019-12-23 15:01:17 +0000 | [diff] [blame] | 288 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 289 | } |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 290 | TEST_SUITE(ExportWeightsToCLImage) |
| 291 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerNativeFixture<half>, framework::DatasetMode::ALL, |
| 292 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
| 293 | width_values_precommit, |
| 294 | height_values_precommit), |
| 295 | channel_values_export_to_cl_image_precommit), |
| 296 | batch_values_precommit), |
| 297 | kernel_sz_values_precommit), |
| 298 | framework::dataset::make("depth_multiplier", 1)), |
| 299 | dilation_values), |
| 300 | stride_values), |
| 301 | padding_valid_values), |
| 302 | framework::dataset::make("DataType", DataType::F16)), |
| 303 | data_layout_values), |
| 304 | act_values), |
| 305 | n0_values_export_to_cl_image_precommit), |
| 306 | framework::dataset::make("ExportToCLImage", true))) |
| 307 | { |
| 308 | // Validate output |
| 309 | if(_validate_output) |
| 310 | { |
| 311 | // Validate output |
| 312 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); |
| 313 | } |
| 314 | else |
| 315 | { |
| 316 | ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped"); |
| 317 | framework::ARM_COMPUTE_PRINT_INFO(); |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerNativeFixture<half>, framework::DatasetMode::NIGHTLY, |
| 322 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
| 323 | width_values_nightly, |
| 324 | height_values_nightly), |
| 325 | channel_values_export_to_cl_image_nightly), |
| 326 | batch_values_nightly), |
| 327 | kernel_sz_values_nightly), |
| 328 | framework::dataset::make("depth_multiplier", 1)), |
| 329 | dilation_values), |
| 330 | stride_values), |
| 331 | padding_valid_values), |
| 332 | framework::dataset::make("DataType", DataType::F16)), |
| 333 | data_layout_values), |
| 334 | act_values), |
| 335 | n0_values_export_to_cl_image_nightly), |
| 336 | framework::dataset::make("ExportToCLImage", true))) |
| 337 | { |
| 338 | // Validate output |
| 339 | if(_validate_output) |
| 340 | { |
| 341 | // Validate output |
| 342 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); |
| 343 | } |
| 344 | else |
| 345 | { |
| 346 | ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped"); |
| 347 | framework::ARM_COMPUTE_PRINT_INFO(); |
| 348 | } |
| 349 | } |
| 350 | TEST_SUITE_END() // ExportWeightsToCLImage |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 351 | TEST_SUITE_END() // FP16 |
| 352 | TEST_SUITE_END() // Float |
| 353 | TEST_SUITE(DepthMultiplier) |
| 354 | TEST_SUITE(Float) |
| 355 | TEST_SUITE(FP32) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 356 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerNativeFixture<float>, framework::DatasetMode::ALL, |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 357 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 358 | width_values_precommit, |
| 359 | height_values_precommit), |
| 360 | channel_values_precommit), |
| 361 | batch_values_precommit), |
| 362 | kernel_sz_values_precommit), |
| 363 | depth_multiplier_values), |
| 364 | dilation_values), |
| 365 | stride_values), |
| 366 | padding_valid_values), |
| 367 | framework::dataset::make("DataType", DataType::F32)), |
| 368 | data_layout_values), |
| 369 | act_values), |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 370 | framework::dataset::make("N0", 1)), |
| 371 | framework::dataset::make("ExportToCLImage", false))) |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 372 | { |
| 373 | // Validate output |
| 374 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 375 | } |
| 376 | |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 377 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerNativeFixture<float>, framework::DatasetMode::NIGHTLY, |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 378 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 379 | width_values_nightly, |
| 380 | height_values_nightly), |
| 381 | channel_values_nightly), |
| 382 | batch_values_nightly), |
| 383 | kernel_sz_values_nightly), |
| 384 | depth_multiplier_values), |
| 385 | dilation_values), |
| 386 | stride_values), |
| 387 | padding_valid_values), |
| 388 | framework::dataset::make("DataType", DataType::F32)), |
| 389 | data_layout_values), |
| 390 | act_values), |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 391 | framework::dataset::make("N0", 1)), |
| 392 | framework::dataset::make("ExportToCLImage", false))) |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 393 | { |
| 394 | // Validate output |
| 395 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 396 | } |
| 397 | TEST_SUITE_END() // FP32 |
| 398 | |
| 399 | TEST_SUITE(FP16) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 400 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerNativeFixture<half>, framework::DatasetMode::ALL, |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 401 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 402 | width_values_precommit, |
| 403 | height_values_precommit), |
| 404 | channel_values_precommit), |
| 405 | batch_values_precommit), |
| 406 | kernel_sz_values_precommit), |
| 407 | depth_multiplier_values), |
| 408 | dilation_values), |
| 409 | stride_values), |
| 410 | padding_valid_values), |
| 411 | framework::dataset::make("DataType", DataType::F16)), |
| 412 | data_layout_values), |
| 413 | act_values), |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 414 | framework::dataset::make("N0", 1)), |
| 415 | framework::dataset::make("ExportToCLImage", false))) |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 416 | { |
| 417 | // Validate output |
Giorgio Arena | dac622a | 2019-12-23 15:01:17 +0000 | [diff] [blame] | 418 | validate(CLAccessor(_target), _reference, rel_tolerance_f16); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 419 | } |
| 420 | |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 421 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerNativeFixture<half>, framework::DatasetMode::NIGHTLY, |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 422 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 423 | width_values_nightly, |
| 424 | height_values_nightly), |
| 425 | channel_values_nightly), |
| 426 | batch_values_nightly), |
| 427 | kernel_sz_values_nightly), |
| 428 | depth_multiplier_values), |
| 429 | dilation_values), |
| 430 | stride_values), |
| 431 | padding_valid_values), |
| 432 | framework::dataset::make("DataType", DataType::F16)), |
| 433 | data_layout_values), |
| 434 | act_values), |
Gian Marco Iodice | 561c176 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 435 | framework::dataset::make("N0", 1)), |
| 436 | framework::dataset::make("ExportToCLImage", false))) |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 437 | { |
| 438 | // Validate output |
Giorgio Arena | dac622a | 2019-12-23 15:01:17 +0000 | [diff] [blame] | 439 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 440 | } |
| 441 | TEST_SUITE_END() // FP16 |
| 442 | TEST_SUITE_END() // Float |
| 443 | TEST_SUITE_END() // DepthMultiplier |
| 444 | TEST_SUITE_END() // DepthwiseConvolutionLayerNative |
| 445 | TEST_SUITE_END() // CL |
| 446 | } // namespace validation |
| 447 | } // namespace test |
| 448 | } // namespace arm_compute |