Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 1 | /* |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 2 | * Copyright (c) 2019-2023 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 | { |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 45 | using framework::dataset::make; |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 46 | using namespace arm_compute::misc::shape_calculator; |
| 47 | |
| 48 | // Create function for CLDepthwiseConvolutionLayerNativeKernel |
| 49 | using CLDepthwiseConvolutionLayerNative = CLSynthetizeFunction<CLDepthwiseConvolutionLayerNativeKernel>; |
| 50 | |
| 51 | // Fixture for CLDepthwiseConvolutionLayerNative |
| 52 | template <typename T> |
| 53 | using CLDepthwiseConvolutionLayerNativeFixture = DepthwiseConvolutionLayerNativeConfigurableValidationFixture<CLTensor, CLAccessor, CLDepthwiseConvolutionLayerNative, T>; |
| 54 | |
| 55 | namespace |
| 56 | { |
| 57 | // *INDENT-OFF* |
| 58 | // clang-format off |
| 59 | RelativeTolerance<float> rel_tolerance_f32(0.001f); |
| 60 | constexpr float abs_tolerance_f32(0.0001f); |
| 61 | |
Giorgio Arena | dac622a | 2019-12-23 15:01:17 +0000 | [diff] [blame] | 62 | 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] | 63 | constexpr float abs_tolerance_f16(0.03f); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 64 | |
| 65 | /** Width values to test - Precommit */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 66 | const auto width_values_precommit = make("width", { 1U, 33U } ); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 67 | |
| 68 | /** Width values to test - Nightly */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 69 | const auto width_values_nightly = make("width", { 53U, 47U } ); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 70 | |
| 71 | /** Height values to test - Precommit */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 72 | const auto height_values_precommit = make("height", { 19U } ); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 73 | |
| 74 | /** Height values to test - Nightly */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 75 | const auto height_values_nightly = make("height", { 39U, 43U } ); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 76 | |
| 77 | /** Channel values to test - Precommit */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 78 | const auto channel_values_precommit = make("channels", { 15U }); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 79 | |
| 80 | /** Channel values to test - Nightly */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 81 | const auto channel_values_nightly = make("channels", { 33U, 19U }); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 82 | |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 83 | /** Channel values to test with cl_image support - Precommit */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 84 | const auto channel_values_export_to_cl_image_precommit = make("channels", { 16U }); |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 85 | |
| 86 | /** Channel values to test with cl_image support - Nightly */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 87 | const auto channel_values_export_to_cl_image_nightly = make("channels", { 32U }); |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 88 | |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 89 | /** Batch values to test - Precommit */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 90 | const auto batch_values_precommit = make("batch", { 1U, 2U }); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 91 | |
| 92 | /** Batch values to test - Nightly */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 93 | const auto batch_values_nightly = make("batch", { 3U }); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 94 | |
| 95 | /** Kernel size values to test - Precommit */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 96 | const auto kernel_sz_values_precommit = make("kernel_size", { Size2D(1U, 1U), Size2D(1U, 3U), Size2D(5U, 5U) }); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 97 | |
| 98 | /** Kernel size values to test - Nightly */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 99 | const auto kernel_sz_values_nightly = make("kernel_size", { Size2D(3U, 5U), Size2D(5U, 1U), Size2D(1U, 7U), Size2D(9U, 7U) }); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 100 | |
| 101 | /** Depth multiplier values to test - All */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 102 | const auto depth_multiplier_values = make("depth_multiplier", {3U}); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 103 | |
| 104 | /** Dilation values to test - All */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 105 | const auto dilation_values = make("dilation", { Size2D(1U, 1U), Size2D(3U, 3U) }); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 106 | |
| 107 | /** Stride values to test - All */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 108 | const auto stride_values = make("stride", { Size2D(1U, 1U), Size2D(3U, 2U) }); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 109 | |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 110 | /** Padding values to test - Precommit */ |
| 111 | const auto padding_valid_values = make("padding_valid", { true, false }); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 112 | |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 113 | /** Padding values to test - Nightly */ |
| 114 | const auto padding_valid_values_nightly = make("padding_valid", { false }); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 115 | |
| 116 | /** Data layout values to test - All */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 117 | const auto data_layout_values = make("data_layout", { DataLayout::NHWC }); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 118 | |
| 119 | /** N0 values to test - Precommit */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 120 | const auto n0_values_precommit = make("N0", {2, 4}); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 121 | |
| 122 | /** N0 values to test - Nightly */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 123 | const auto n0_values_nightly = make("N0", {3, 8}); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 124 | |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 125 | /** N0 values to test with cl_image support - Precommit */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 126 | const auto n0_values_export_to_cl_image_precommit = make("N0", {4}); |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 127 | |
| 128 | /** N0 values to test with cl_image support - Nightly */ |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 129 | const auto n0_values_export_to_cl_image_nightly = make("N0", {8}); |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 130 | |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 131 | /** Activation values to test in precommit */ |
| 132 | const auto act_values = make("Activation", { ActivationLayerInfo() }); |
| 133 | |
| 134 | const auto activations_rest = make("Activation", |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 135 | { |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 136 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 137 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 6.f, 0.5f), |
| 138 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 0.8f, -0.5f), |
| 139 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LEAKY_RELU, 0.1f), |
| 140 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::SOFT_RELU), |
| 141 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::ELU), |
| 142 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::ABS), |
| 143 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC), |
| 144 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH), |
| 145 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::SQUARE), |
| 146 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::HARD_SWISH), |
| 147 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LINEAR, 2.f, 1.f), |
| 148 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::GELU) |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 149 | }); |
| 150 | |
| 151 | } // namespace |
| 152 | |
| 153 | TEST_SUITE(CL) |
| 154 | TEST_SUITE(DepthwiseConvolutionLayerNative) |
| 155 | TEST_SUITE(Float) |
| 156 | TEST_SUITE(FP32) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 157 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerNativeFixture<float>, framework::DatasetMode::ALL, |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 158 | 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] | 159 | width_values_precommit, |
| 160 | height_values_precommit), |
| 161 | channel_values_precommit), |
| 162 | batch_values_precommit), |
| 163 | kernel_sz_values_precommit), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 164 | make("depth_multiplier", 1)), |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 165 | dilation_values), |
| 166 | stride_values), |
| 167 | padding_valid_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 168 | make("DataType", DataType::F32)), |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 169 | data_layout_values), |
| 170 | act_values), |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 171 | n0_values_precommit), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 172 | make("ExportToCLImage", false))) |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 173 | { |
| 174 | // Validate output |
| 175 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 176 | } |
| 177 | |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 178 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerNativeFixture<float>, framework::DatasetMode::NIGHTLY, |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 179 | 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] | 180 | width_values_nightly, |
| 181 | height_values_nightly), |
| 182 | channel_values_nightly), |
| 183 | batch_values_nightly), |
| 184 | kernel_sz_values_nightly), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 185 | make("depth_multiplier", 1)), |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 186 | dilation_values), |
| 187 | stride_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 188 | padding_valid_values_nightly), |
| 189 | make("DataType", DataType::F32)), |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 190 | data_layout_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 191 | make("Activation", { ActivationLayerInfo() })), |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 192 | n0_values_nightly), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 193 | make("ExportToCLImage", false))) |
| 194 | { |
| 195 | // Validate output |
| 196 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 197 | } |
| 198 | |
| 199 | FIXTURE_DATA_TEST_CASE_NEW(RunActivations, CLDepthwiseConvolutionLayerNativeFixture<float>, framework::DatasetMode::ALL, |
| 200 | combine( |
| 201 | make("width", { 33U } ), |
| 202 | height_values_precommit, |
| 203 | channel_values_precommit, |
| 204 | make("batch", { 2U } ), |
| 205 | make("kernel_size", { Size2D(5U, 5U) }), |
| 206 | make("depth_multiplier", 1), |
| 207 | make("dilation", Size2D(3U, 3U)), |
| 208 | make("stride", Size2D(3U, 2U)), |
| 209 | padding_valid_values_nightly, |
| 210 | make("DataType", DataType::F32), |
| 211 | data_layout_values, |
| 212 | activations_rest, |
| 213 | n0_values_precommit, |
| 214 | make("ExportToCLImage", false))) |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 215 | { |
| 216 | // Validate output |
| 217 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 218 | } |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 219 | |
| 220 | TEST_SUITE(ExportWeightsToCLImage) |
| 221 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerNativeFixture<float>, framework::DatasetMode::ALL, |
| 222 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
| 223 | width_values_precommit, |
| 224 | height_values_precommit), |
| 225 | channel_values_export_to_cl_image_precommit), |
| 226 | batch_values_precommit), |
| 227 | kernel_sz_values_precommit), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 228 | make("depth_multiplier", 1)), |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 229 | dilation_values), |
| 230 | stride_values), |
| 231 | padding_valid_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 232 | make("DataType", DataType::F32)), |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 233 | data_layout_values), |
| 234 | act_values), |
| 235 | n0_values_export_to_cl_image_precommit), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 236 | make("ExportToCLImage", true))) |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 237 | { |
| 238 | // Validate output |
| 239 | if(_validate_output) |
| 240 | { |
| 241 | // Validate output |
| 242 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 243 | } |
| 244 | else |
| 245 | { |
| 246 | ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped"); |
| 247 | framework::ARM_COMPUTE_PRINT_INFO(); |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerNativeFixture<float>, framework::DatasetMode::NIGHTLY, |
| 252 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
| 253 | width_values_nightly, |
| 254 | height_values_nightly), |
| 255 | channel_values_export_to_cl_image_nightly), |
| 256 | batch_values_nightly), |
| 257 | kernel_sz_values_nightly), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 258 | make("depth_multiplier", 1)), |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 259 | dilation_values), |
| 260 | stride_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 261 | padding_valid_values_nightly), |
| 262 | make("DataType", DataType::F32)), |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 263 | data_layout_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 264 | make("Activation", { ActivationLayerInfo() })), |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 265 | n0_values_export_to_cl_image_nightly), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 266 | make("ExportToCLImage", true))) |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 267 | { |
| 268 | // Validate output |
| 269 | if(_validate_output) |
| 270 | { |
| 271 | // Validate output |
| 272 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 273 | } |
| 274 | else |
| 275 | { |
| 276 | ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped"); |
| 277 | framework::ARM_COMPUTE_PRINT_INFO(); |
| 278 | } |
| 279 | } |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 280 | |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 281 | TEST_SUITE_END() // ExportWeightsToCLImage |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 282 | TEST_SUITE_END() // FP32 |
| 283 | |
| 284 | TEST_SUITE(FP16) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 285 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerNativeFixture<half>, framework::DatasetMode::ALL, |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 286 | 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] | 287 | width_values_precommit, |
| 288 | height_values_precommit), |
| 289 | channel_values_precommit), |
| 290 | batch_values_precommit), |
| 291 | kernel_sz_values_precommit), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 292 | make("depth_multiplier", 1)), |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 293 | dilation_values), |
| 294 | stride_values), |
| 295 | padding_valid_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 296 | make("DataType", DataType::F16)), |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 297 | data_layout_values), |
| 298 | act_values), |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 299 | n0_values_precommit), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 300 | make("ExportToCLImage", false))) |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 301 | { |
| 302 | // Validate output |
Giorgio Arena | dac622a | 2019-12-23 15:01:17 +0000 | [diff] [blame] | 303 | validate(CLAccessor(_target), _reference, rel_tolerance_f16); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 304 | } |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 305 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerNativeFixture<half>, framework::DatasetMode::NIGHTLY, |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 306 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 307 | make("width", { 47U } ), |
| 308 | make("height", { 39U } )), |
| 309 | make("channels", { 19U } )), |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 310 | batch_values_nightly), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 311 | make("kernel_size", { Size2D(5U, 5U) })), |
| 312 | make("depth_multiplier", 1)), |
| 313 | make("dilation", { Size2D(3U, 3U) })), |
| 314 | make("stride", { Size2D(3U, 2U) })), |
| 315 | padding_valid_values_nightly), |
| 316 | make("DataType", DataType::F16)), |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 317 | data_layout_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 318 | make("Activation", { ActivationLayerInfo() })), |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 319 | n0_values_nightly), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 320 | make("ExportToCLImage", false))) |
| 321 | { |
| 322 | // Validate output |
| 323 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); |
| 324 | } |
| 325 | |
| 326 | FIXTURE_DATA_TEST_CASE_NEW(RunActivations, CLDepthwiseConvolutionLayerNativeFixture<half>, framework::DatasetMode::ALL, |
| 327 | combine( |
| 328 | make("width", { 33U } ), |
| 329 | height_values_precommit, |
| 330 | channel_values_precommit, |
| 331 | make("batch", { 2U } ), |
| 332 | make("kernel_size", { Size2D(5U, 5U) }), |
| 333 | make("depth_multiplier", 4), |
| 334 | make("dilation", Size2D(3U, 3U)), |
| 335 | make("stride", Size2D(3U, 2U)), |
| 336 | padding_valid_values_nightly, |
| 337 | make("DataType", DataType::F16), |
| 338 | data_layout_values, |
| 339 | activations_rest, |
| 340 | n0_values_precommit, |
| 341 | make("ExportToCLImage", false))) |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 342 | { |
| 343 | // Validate output |
Giorgio Arena | dac622a | 2019-12-23 15:01:17 +0000 | [diff] [blame] | 344 | 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] | 345 | } |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 346 | |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 347 | TEST_SUITE(ExportWeightsToCLImage) |
| 348 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerNativeFixture<half>, framework::DatasetMode::ALL, |
| 349 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
| 350 | width_values_precommit, |
| 351 | height_values_precommit), |
| 352 | channel_values_export_to_cl_image_precommit), |
| 353 | batch_values_precommit), |
| 354 | kernel_sz_values_precommit), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 355 | make("depth_multiplier", 1)), |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 356 | dilation_values), |
| 357 | stride_values), |
| 358 | padding_valid_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 359 | make("DataType", DataType::F16)), |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 360 | data_layout_values), |
| 361 | act_values), |
| 362 | n0_values_export_to_cl_image_precommit), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 363 | make("ExportToCLImage", true))) |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 364 | { |
| 365 | // Validate output |
| 366 | if(_validate_output) |
| 367 | { |
| 368 | // Validate output |
| 369 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); |
| 370 | } |
| 371 | else |
| 372 | { |
| 373 | ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped"); |
| 374 | framework::ARM_COMPUTE_PRINT_INFO(); |
| 375 | } |
| 376 | } |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 377 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerNativeFixture<half>, framework::DatasetMode::NIGHTLY, |
| 378 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 379 | make("width", { 47U } ), |
| 380 | make("height", { 39U } )), |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 381 | channel_values_export_to_cl_image_nightly), |
| 382 | batch_values_nightly), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 383 | make("kernel_size", { Size2D(5U, 5U) })), |
| 384 | make("depth_multiplier", 1)), |
| 385 | make("dilation", { Size2D(3U, 3U) })), |
| 386 | make("stride", { Size2D(3U, 2U) })), |
| 387 | padding_valid_values_nightly), |
| 388 | make("DataType", DataType::F16)), |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 389 | data_layout_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 390 | make("Activation", { ActivationLayerInfo() })), |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 391 | n0_values_export_to_cl_image_nightly), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 392 | make("ExportToCLImage", true))) |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 393 | { |
| 394 | // Validate output |
| 395 | if(_validate_output) |
| 396 | { |
| 397 | // Validate output |
| 398 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); |
| 399 | } |
| 400 | else |
| 401 | { |
| 402 | ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped"); |
| 403 | framework::ARM_COMPUTE_PRINT_INFO(); |
| 404 | } |
| 405 | } |
| 406 | TEST_SUITE_END() // ExportWeightsToCLImage |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 407 | TEST_SUITE_END() // FP16 |
| 408 | TEST_SUITE_END() // Float |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 409 | |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 410 | TEST_SUITE(DepthMultiplier) |
| 411 | TEST_SUITE(Float) |
| 412 | TEST_SUITE(FP32) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 413 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerNativeFixture<float>, framework::DatasetMode::ALL, |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 414 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 415 | make("width", { 33U } ), |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 416 | height_values_precommit), |
| 417 | channel_values_precommit), |
| 418 | batch_values_precommit), |
| 419 | kernel_sz_values_precommit), |
| 420 | depth_multiplier_values), |
| 421 | dilation_values), |
| 422 | stride_values), |
| 423 | padding_valid_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 424 | make("DataType", DataType::F32)), |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 425 | data_layout_values), |
| 426 | act_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 427 | make("N0", 1)), |
| 428 | make("ExportToCLImage", false))) |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 429 | { |
| 430 | // Validate output |
| 431 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 432 | } |
| 433 | |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 434 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerNativeFixture<float>, framework::DatasetMode::NIGHTLY, |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 435 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 436 | make("width", { 53U } ), |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 437 | height_values_nightly), |
| 438 | channel_values_nightly), |
| 439 | batch_values_nightly), |
| 440 | kernel_sz_values_nightly), |
| 441 | depth_multiplier_values), |
| 442 | dilation_values), |
| 443 | stride_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 444 | padding_valid_values_nightly), |
| 445 | make("DataType", DataType::F32)), |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 446 | data_layout_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 447 | make("Activation", { ActivationLayerInfo() })), |
| 448 | make("N0", 1)), |
| 449 | make("ExportToCLImage", false))) |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 450 | { |
| 451 | // Validate output |
| 452 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 453 | } |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 454 | |
| 455 | TEST_SUITE(DepthMultiplierMultipleOfOutputChannels) |
| 456 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerNativeFixture<float>, framework::DatasetMode::ALL, |
| 457 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 458 | make("width", { 33U } ), |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 459 | height_values_precommit), |
| 460 | channel_values_precommit), |
| 461 | batch_values_precommit), |
| 462 | kernel_sz_values_precommit), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 463 | make("depth_multiplier", 2)), |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 464 | dilation_values), |
| 465 | stride_values), |
| 466 | padding_valid_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 467 | make("DataType", DataType::F32)), |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 468 | data_layout_values), |
| 469 | act_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 470 | make("N0", {2})), |
| 471 | make("ExportToCLImage", false))) |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 472 | { |
| 473 | // Validate output |
| 474 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 475 | } |
| 476 | |
| 477 | TEST_SUITE(ExportWeightsToCLImage) |
| 478 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerNativeFixture<float>, framework::DatasetMode::ALL, |
| 479 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 480 | make("width", { 33U } ), |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 481 | height_values_precommit), |
| 482 | channel_values_precommit), |
| 483 | batch_values_precommit), |
| 484 | kernel_sz_values_precommit), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 485 | make("depth_multiplier", 4)), |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 486 | dilation_values), |
| 487 | stride_values), |
| 488 | padding_valid_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 489 | make("DataType", DataType::F32)), |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 490 | data_layout_values), |
| 491 | act_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 492 | make("N0", {4})), |
| 493 | make("ExportToCLImage", true))) |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 494 | { |
| 495 | // Validate output |
| 496 | if(_validate_output) |
| 497 | { |
| 498 | // Validate output |
| 499 | validate(CLAccessor(_target), _reference, rel_tolerance_f32, 0.f, abs_tolerance_f32); |
| 500 | } |
| 501 | else |
| 502 | { |
| 503 | ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped"); |
| 504 | framework::ARM_COMPUTE_PRINT_INFO(); |
| 505 | } |
| 506 | } |
| 507 | TEST_SUITE_END() // ExportWeightsToCLImage |
| 508 | TEST_SUITE_END() // DepthMultiplierMultipleOfOutputChannels |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 509 | TEST_SUITE_END() // FP32 |
| 510 | |
| 511 | TEST_SUITE(FP16) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 512 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerNativeFixture<half>, framework::DatasetMode::ALL, |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 513 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 514 | make("width", { 33U } ), |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 515 | height_values_precommit), |
| 516 | channel_values_precommit), |
| 517 | batch_values_precommit), |
| 518 | kernel_sz_values_precommit), |
| 519 | depth_multiplier_values), |
| 520 | dilation_values), |
| 521 | stride_values), |
| 522 | padding_valid_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 523 | make("DataType", DataType::F16)), |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 524 | data_layout_values), |
| 525 | act_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 526 | make("N0", 1)), |
| 527 | make("ExportToCLImage", false))) |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 528 | { |
| 529 | // Validate output |
Giorgio Arena | dac622a | 2019-12-23 15:01:17 +0000 | [diff] [blame] | 530 | validate(CLAccessor(_target), _reference, rel_tolerance_f16); |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 531 | } |
| 532 | |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 533 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, CLDepthwiseConvolutionLayerNativeFixture<half>, framework::DatasetMode::NIGHTLY, |
Gian Marco Iodice | 8155c02 | 2021-04-16 15:08:59 +0100 | [diff] [blame] | 534 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 535 | make("width", { 53U } ), |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 536 | height_values_nightly), |
| 537 | channel_values_nightly), |
| 538 | batch_values_nightly), |
| 539 | kernel_sz_values_nightly), |
| 540 | depth_multiplier_values), |
| 541 | dilation_values), |
| 542 | stride_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 543 | padding_valid_values_nightly), |
| 544 | make("DataType", DataType::F16)), |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 545 | data_layout_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 546 | make("Activation", { ActivationLayerInfo() })), |
| 547 | make("N0", 1)), |
| 548 | make("ExportToCLImage", false))) |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 549 | { |
| 550 | // Validate output |
Giorgio Arena | dac622a | 2019-12-23 15:01:17 +0000 | [diff] [blame] | 551 | 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] | 552 | } |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 553 | |
| 554 | TEST_SUITE(DepthMultiplierMultipleOfOutputChannels) |
| 555 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerNativeFixture<half>, framework::DatasetMode::ALL, |
| 556 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 557 | make("width", { 33U } ), |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 558 | height_values_precommit), |
| 559 | channel_values_precommit), |
| 560 | batch_values_precommit), |
| 561 | kernel_sz_values_precommit), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 562 | make("depth_multiplier", 2)), |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 563 | dilation_values), |
| 564 | stride_values), |
| 565 | padding_valid_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 566 | make("DataType", DataType::F16)), |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 567 | data_layout_values), |
| 568 | act_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 569 | make("N0", {2})), |
| 570 | make("ExportToCLImage", false))) |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 571 | { |
| 572 | // Validate output |
| 573 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); |
| 574 | } |
| 575 | |
| 576 | TEST_SUITE(ExportWeightsToCLImage) |
| 577 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, CLDepthwiseConvolutionLayerNativeFixture<half>, framework::DatasetMode::ALL, |
| 578 | combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine(combine( |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 579 | make("width", { 33U } ), |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 580 | height_values_precommit), |
| 581 | channel_values_precommit), |
| 582 | batch_values_precommit), |
| 583 | kernel_sz_values_precommit), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 584 | make("depth_multiplier", 4)), |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 585 | dilation_values), |
| 586 | stride_values), |
| 587 | padding_valid_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 588 | make("DataType", DataType::F16)), |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 589 | data_layout_values), |
| 590 | act_values), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame^] | 591 | make("N0", {4})), |
| 592 | make("ExportToCLImage", true))) |
Gian Marco Iodice | 211a55d | 2022-08-31 11:47:08 +0100 | [diff] [blame] | 593 | { |
| 594 | // Validate output |
| 595 | if(_validate_output) |
| 596 | { |
| 597 | // Validate output |
| 598 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, 0.f, abs_tolerance_f16); |
| 599 | } |
| 600 | else |
| 601 | { |
| 602 | ARM_COMPUTE_TEST_INFO("cl_khr_image2d_from_buffer not supported. TEST skipped"); |
| 603 | framework::ARM_COMPUTE_PRINT_INFO(); |
| 604 | } |
| 605 | } |
| 606 | TEST_SUITE_END() // ExportWeightsToCLImage |
| 607 | TEST_SUITE_END() // DepthMultiplierMultipleOfOutputChannels |
Gian Marco Iodice | 9285adb | 2019-09-05 16:10:27 +0100 | [diff] [blame] | 608 | TEST_SUITE_END() // FP16 |
| 609 | TEST_SUITE_END() // Float |
| 610 | TEST_SUITE_END() // DepthMultiplier |
| 611 | TEST_SUITE_END() // DepthwiseConvolutionLayerNative |
| 612 | TEST_SUITE_END() // CL |
| 613 | } // namespace validation |
| 614 | } // namespace test |
| 615 | } // namespace arm_compute |