Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 1 | /* |
Gian Marco Iodice | bc6c374 | 2020-10-19 12:49:44 +0100 | [diff] [blame] | 2 | * Copyright (c) 2018-2020 Arm Limited. |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 22 | * SOFTWARE. |
| 23 | */ |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 24 | #include "arm_compute/core/Helpers.h" |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 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" |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 29 | #include "arm_compute/runtime/CL/functions/CLWinogradConvolutionLayer.h" |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 30 | #include "arm_compute/runtime/CL/functions/CLWinogradInputTransform.h" |
Sang-Hoon Park | bef7fa2 | 2020-10-21 15:58:54 +0100 | [diff] [blame] | 31 | #include "src/core/CL/kernels/CLWinogradFilterTransformKernel.h" |
| 32 | #include "src/core/CL/kernels/CLWinogradOutputTransformKernel.h" |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 33 | #include "tests/CL/CLAccessor.h" |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 34 | #include "tests/CL/Helper.h" |
| 35 | #include "tests/PaddingCalculator.h" |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 36 | #include "tests/datasets/LargeConvolutionLayerDataset.h" |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 37 | #include "tests/datasets/ShapeDatasets.h" |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 38 | #include "tests/datasets/SmallConvolutionLayerDataset.h" |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 39 | #include "tests/datasets/WinogradInputTransformDataset.h" |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 40 | #include "tests/datasets/WinogradOutputTransformDataset.h" |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 41 | #include "tests/framework/Asserts.h" |
| 42 | #include "tests/framework/Macros.h" |
| 43 | #include "tests/framework/datasets/Datasets.h" |
| 44 | #include "tests/validation/Validation.h" |
Georgios Pinitas | 9fb1159 | 2018-04-26 20:34:58 +0100 | [diff] [blame] | 45 | #include "tests/validation/fixtures/WinogradConvolutionLayerFixture.h" |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 46 | |
| 47 | namespace arm_compute |
| 48 | { |
| 49 | namespace test |
| 50 | { |
| 51 | namespace validation |
| 52 | { |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 53 | namespace |
| 54 | { |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 55 | // *INDENT-OFF* |
| 56 | // clang-format off |
Michele Di Giorgio | 875a751 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 57 | constexpr AbsoluteTolerance<float> tolerance_f32(0.002f); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 58 | const AbsoluteTolerance<half> tolerance_f16(half(0.5f)); |
Gian Marco Iodice | 4497e81 | 2018-05-08 16:36:52 +0100 | [diff] [blame] | 59 | constexpr AbsoluteTolerance<float> tolerance_convolution_layer_f32(0.1f); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 60 | const AbsoluteTolerance<half> tolerance_convolution_layer_f16(half(0.4f)); |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 61 | RelativeTolerance<half_float::half> rel_tolerance_f16(half(0.2)); /**< Tolerance value for comparing reference's output against implementation's output for FP16 data types */ |
| 62 | constexpr float tolerance_num = 0.05f; /**< Tolerance number */ |
| 63 | constexpr float abs_tolerance_convolution_layer_f16 = 2.5f; /**< Tolerance number */ |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 64 | constexpr float tolerance_num_f16 = 0.15f; /**< Tolerance number */ |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 65 | |
| 66 | // Input transform |
| 67 | const auto SmallWinogradInputTransformDatasetNCHW = |
| 68 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset2x2_3x3(), |
| 69 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset2x1_3x1(), |
| 70 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset1x2_1x3(), |
| 71 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x4_3x3(), |
| 72 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x1_3x1(), |
| 73 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset1x4_1x3(), |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 74 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x4_5x5(), |
| 75 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x1_5x1(), |
| 76 | datasets::SmallWinogradInputTransformDataset1x4_1x5())))))))); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 77 | |
| 78 | const auto SmallWinogradInputTransformDatasetNHWC = framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x4_3x3(), |
Giorgio Arena | 149fdf3 | 2018-07-04 17:03:33 +0100 | [diff] [blame] | 79 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x1_3x1(), |
| 80 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset1x4_1x3(), |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 81 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x4_5x5(), |
| 82 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x1_5x1(), |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 83 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset1x4_1x5(), |
| 84 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset2x1_7x1(), |
| 85 | datasets::SmallWinogradInputTransformDataset1x2_1x7()))))))); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 86 | |
Michele Di Giorgio | f955d51 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 87 | const auto SmallWinogradInputTransformDatasetNHWC_FP32 = framework::dataset::concat(SmallWinogradInputTransformDatasetNHWC, |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 88 | datasets::SmallWinogradInputTransformDataset2x2_7x7()); |
Michele Di Giorgio | f955d51 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 89 | |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 90 | const auto LargeWinogradInputTransformDatasetNCHW = |
| 91 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset2x2_3x3(), |
| 92 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset2x1_3x1(), |
| 93 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset1x2_1x3(), |
| 94 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x4_3x3(), |
| 95 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x1_3x1(), |
| 96 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset1x4_1x3(), |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 97 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x4_5x5(), |
| 98 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x1_5x1(), |
Georgios Pinitas | 0c81684 | 2019-12-20 15:07:43 +0000 | [diff] [blame] | 99 | datasets::LargeWinogradInputTransformDataset1x4_1x5())))))))); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 100 | |
| 101 | const auto LargeWinogradInputTransformDatasetNHWC = |
| 102 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x4_3x3(), |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 103 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x4_5x5(), |
| 104 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x1_5x1(), |
| 105 | datasets::LargeWinogradInputTransformDataset1x4_1x5()))); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 106 | |
Michele Di Giorgio | f955d51 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 107 | const auto LargeWinogradInputTransformDatasetNHWC_FP32 = |
| 108 | framework::dataset::concat(LargeWinogradInputTransformDatasetNHWC, |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 109 | (datasets::LargeWinogradInputTransformDataset2x2_7x7())); |
Michele Di Giorgio | f955d51 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 110 | |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 111 | // Filter transform |
| 112 | const auto SmallWinogradFilterTransformDatasetNCHW = |
| 113 | framework::dataset::concat(combine(datasets::Small3x3Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 2U), Size2D(4U, 4U) })), |
| 114 | framework::dataset::concat(combine(datasets::Small3x1Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 1U), Size2D(4U, 1U) })), |
| 115 | framework::dataset::concat(combine(datasets::Small1x3Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 2U), Size2D(1U, 4U) })), |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 116 | framework::dataset::concat(combine(datasets::Small5x5Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })), |
| 117 | framework::dataset::concat(combine(datasets::Small5x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })), |
| 118 | combine(datasets::Small1x5Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) }))))))); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 119 | |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 120 | const auto SmallWinogradFilterTransformDatasetNHWC_F16 = |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 121 | framework::dataset::concat(combine(datasets::Small3x3Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })), |
Giorgio Arena | 149fdf3 | 2018-07-04 17:03:33 +0100 | [diff] [blame] | 122 | framework::dataset::concat(combine(datasets::Small3x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })), |
| 123 | framework::dataset::concat(combine(datasets::Small1x3Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) })), |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 124 | framework::dataset::concat(combine(datasets::Small5x5Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })), |
| 125 | framework::dataset::concat(combine(datasets::Small5x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })), |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 126 | framework::dataset::concat(combine(datasets::Small1x5Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) })), |
| 127 | framework::dataset::concat(combine(datasets::Small1x7Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 2U) })), |
| 128 | combine(datasets::Small7x1Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 1U) }))))))))); |
Michele Di Giorgio | f955d51 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 129 | |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 130 | const auto SmallWinogradFilterTransformDatasetNHWC_F32 = |
| 131 | framework::dataset::concat(SmallWinogradFilterTransformDatasetNHWC_F16, |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 132 | combine(datasets::Small7x7Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 2U) }))); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 133 | |
| 134 | const auto LargeWinogradFilterTransformDatasetNCHW = |
| 135 | framework::dataset::concat(combine(datasets::Large3x3Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 2U), Size2D(4U, 4U) })), |
| 136 | framework::dataset::concat(combine(datasets::Large3x1Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 1U), Size2D(4U, 1U) })), |
| 137 | framework::dataset::concat(combine(datasets::Large1x3Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 2U), Size2D(1U, 4U) })), |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 138 | framework::dataset::concat(combine(datasets::Large5x5Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })), |
| 139 | framework::dataset::concat(combine(datasets::Large5x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })), |
| 140 | combine(datasets::Large1x5Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) }))))))); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 141 | |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 142 | const auto LargeWinogradFilterTransformDatasetNHWC_F16 = |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 143 | framework::dataset::concat(combine(datasets::Large3x3Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })), |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 144 | framework::dataset::concat(combine(datasets::Large3x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })), |
| 145 | framework::dataset::concat(combine(datasets::Large1x3Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) })), |
| 146 | framework::dataset::concat(combine(datasets::Large5x5Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })), |
| 147 | framework::dataset::concat(combine(datasets::Large5x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })), |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 148 | framework::dataset::concat(combine(datasets::Large1x5Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) })), |
| 149 | framework::dataset::concat(combine(datasets::Large7x1Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 1U) })), |
| 150 | combine(datasets::Large1x7Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 2U) }))))))))); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 151 | |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 152 | const auto LargeWinogradFilterTransformDatasetNHWC_F32 = |
| 153 | framework::dataset::concat(LargeWinogradFilterTransformDatasetNHWC_F16, |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 154 | combine(datasets::Large7x7Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 2U) }))); |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 155 | |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 156 | // Output transform |
| 157 | const auto SmallWinogradOutputTransformDatasetNCHW = datasets::SmallWinogradOutputTransformDatasetNCHW(); |
| 158 | |
giuros01 | 3bfacb2 | 2019-04-01 12:07:02 +0100 | [diff] [blame] | 159 | const auto SmallWinogradOutputTransformDatasetNHWC_F16 = datasets::SmallWinogradOutputTransformDatasetNHWC_F16(); |
| 160 | |
| 161 | const auto SmallWinogradOutputTransformDatasetNHWC_F32 = datasets::SmallWinogradOutputTransformDatasetNHWC_F32(); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 162 | |
| 163 | const auto LargeWinogradOutputTransformDatasetNCHW = datasets::LargeWinogradOutputTransformDatasetNCHW(); |
| 164 | |
giuros01 | 3bfacb2 | 2019-04-01 12:07:02 +0100 | [diff] [blame] | 165 | const auto LargeWinogradOutputTransformDatasetNHWC_F16 = datasets::LargeWinogradOutputTransformDatasetNHWC_F16(); |
| 166 | |
| 167 | const auto LargeWinogradOutputTransformDatasetNHWC_F32 = datasets::LargeWinogradOutputTransformDatasetNHWC_F32(); |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 168 | |
| 169 | //Activation Functions |
| 170 | const auto ActivationFunctionsDataset = framework::dataset::make("ActivationInfo", |
| 171 | { |
| 172 | ActivationLayerInfo(), |
| 173 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 174 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU), |
| 175 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU), |
Georgios Pinitas | 9d6a31c | 2019-02-25 14:33:25 +0000 | [diff] [blame] | 176 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LEAKY_RELU) |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 177 | }); |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 178 | const auto ActivationFunctionsSmallDataset = framework::dataset::make("ActivationInfo", |
| 179 | { |
| 180 | ActivationLayerInfo(), |
| 181 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU), |
Georgios Pinitas | 9d6a31c | 2019-02-25 14:33:25 +0000 | [diff] [blame] | 182 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LEAKY_RELU), |
| 183 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::SOFT_RELU) |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 184 | }); |
Gian Marco Iodice | bc6c374 | 2020-10-19 12:49:44 +0100 | [diff] [blame] | 185 | |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 186 | } // namespace |
| 187 | |
| 188 | using namespace arm_compute::misc::shape_calculator; |
| 189 | |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 190 | TEST_SUITE(CL) |
| 191 | TEST_SUITE(Winograd) |
| 192 | |
| 193 | TEST_SUITE(InputTransform) |
Gian Marco Iodice | bc6c374 | 2020-10-19 12:49:44 +0100 | [diff] [blame] | 194 | |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 195 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 196 | framework::dataset::make("InputInfo",{ |
| 197 | TensorInfo(TensorShape(53U, 21U, 5U, 3U), 1, DataType::F16), // F16 not supported |
| 198 | TensorInfo(TensorShape(53U, 21U, 5U, 3U), 1, DataType::QASYMM8), // QASYMM8 not supported |
| 199 | TensorInfo(TensorShape(53U, 21U, 5U, 3U), 1, DataType::F32), // Kernel size not supported |
| 200 | TensorInfo(TensorShape(53U, 21U, 5U, 3U), 1, DataType::F32), // Strides not supported |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 201 | TensorInfo(TensorShape(53U, 33U, 4U), 1, DataType::F32), // Padding needed |
| 202 | TensorInfo(TensorShape(34U, 42U, 7U, 3U), 1, DataType::F32), // Padding needed |
| 203 | TensorInfo(TensorShape(31U, 37U, 37U), 1, DataType::F32) // Padding needed |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 204 | }), |
| 205 | framework::dataset::make("OutputInfo", { |
| 206 | TensorInfo(TensorShape(5U, 5U, 16U, 3U), 1, DataType::F16), |
| 207 | TensorInfo(TensorShape(5U, 5U, 16U, 3U), 1, DataType::QASYMM8), |
| 208 | TensorInfo(TensorShape(5U, 5U, 16U, 3U), 1, DataType::F32), |
| 209 | TensorInfo(TensorShape(5U, 1U, 16U, 3U), 1, DataType::F32), |
| 210 | TensorInfo(TensorShape(4U, 442U, 16U), 1, DataType::F32), |
| 211 | TensorInfo(TensorShape(7U, 320U, 16U, 3U), 1, DataType::F32), |
| 212 | TensorInfo(TensorShape(37U, 304U, 16U), 1, DataType::F32) |
| 213 | })), |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 214 | framework::dataset::make("WinogradInfo", { |
| 215 | WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(53U, 21U), PadStrideInfo(1, 1, 1, 0), DataLayout::NCHW), |
| 216 | WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(53U, 21U), PadStrideInfo(1, 1, 0, 0), DataLayout::NCHW), |
| 217 | WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(53U, 21U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), |
| 218 | WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(53U, 21U), PadStrideInfo(2, 1, 1, 1), DataLayout::NCHW), |
| 219 | WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(53U, 33U), PadStrideInfo(1, 1, 0, 1), DataLayout::NCHW), |
| 220 | WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(34U, 42U), PadStrideInfo(1, 1, 0, 0), DataLayout::NCHW), |
| 221 | WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(31U, 37U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW) |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 222 | })), |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 223 | framework::dataset::make("Expected", { false, false, false, false, false, false, false })), |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 224 | input_info, output_info, winograd_info, expected) |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 225 | { |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 226 | ARM_COMPUTE_EXPECT(bool(CLWinogradInputTransform::validate(&input_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), winograd_info)) == expected, framework::LogLevel::ERRORS); |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 227 | } |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 228 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 229 | using CLWinogradInputTransformFixtureFP32 = WinogradInputTransformValidationFixture<CLTensor, CLAccessor, CLWinogradInputTransform, float>; |
| 230 | using CLWinogradInputTransformFixtureFP16 = WinogradInputTransformValidationFixture<CLTensor, CLAccessor, CLWinogradInputTransform, half>; |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 231 | |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 232 | TEST_SUITE(NCHW) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 233 | TEST_SUITE(FP32) |
| 234 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradInputTransformFixtureFP32, framework::DatasetMode::PRECOMMIT, combine(combine(SmallWinogradInputTransformDatasetNCHW, |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 235 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 236 | framework::dataset::make("DataType", { DataType::F32 }))) |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 237 | { |
Giorgio Arena | fe5ef38 | 2018-04-17 10:14:10 +0100 | [diff] [blame] | 238 | validate(CLAccessor(_target), _reference, tolerance_f32); |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 239 | } |
| 240 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 241 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradInputTransformFixtureFP32, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradInputTransformDatasetNCHW, |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 242 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 243 | framework::dataset::make("DataType", { DataType::F32 }))) |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 244 | { |
Giorgio Arena | fe5ef38 | 2018-04-17 10:14:10 +0100 | [diff] [blame] | 245 | validate(CLAccessor(_target), _reference, tolerance_f32); |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 246 | } |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 247 | TEST_SUITE_END() // FP32 |
| 248 | |
| 249 | TEST_SUITE(FP16) |
| 250 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradInputTransformFixtureFP16, framework::DatasetMode::PRECOMMIT, combine(combine(SmallWinogradInputTransformDatasetNCHW, |
| 251 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 252 | framework::dataset::make("DataType", { DataType::F16 }))) |
| 253 | { |
| 254 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 255 | } |
| 256 | |
| 257 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradInputTransformFixtureFP16, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradInputTransformDatasetNCHW, |
| 258 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 259 | framework::dataset::make("DataType", { DataType::F16 }))) |
| 260 | { |
| 261 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 262 | } |
| 263 | TEST_SUITE_END() // FP16 |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 264 | TEST_SUITE_END() // NCHW |
| 265 | |
| 266 | TEST_SUITE(NHWC) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 267 | TEST_SUITE(FP16) |
| 268 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradInputTransformFixtureFP16, framework::DatasetMode::PRECOMMIT, combine(combine(SmallWinogradInputTransformDatasetNHWC, |
| 269 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 270 | framework::dataset::make("DataType", { DataType::F16 }))) |
| 271 | { |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 272 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 273 | } |
| 274 | |
| 275 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradInputTransformFixtureFP16, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradInputTransformDatasetNHWC, |
| 276 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 277 | framework::dataset::make("DataType", { DataType::F16 }))) |
| 278 | { |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 279 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 280 | } |
| 281 | TEST_SUITE_END() // FP16 |
| 282 | TEST_SUITE(FP32) |
Michele Di Giorgio | f955d51 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 283 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradInputTransformFixtureFP32, framework::DatasetMode::PRECOMMIT, combine(combine(SmallWinogradInputTransformDatasetNHWC_FP32, |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 284 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 285 | framework::dataset::make("DataType", { DataType::F32 }))) |
| 286 | { |
| 287 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 288 | } |
| 289 | |
Michele Di Giorgio | f955d51 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 290 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradInputTransformFixtureFP32, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradInputTransformDatasetNHWC_FP32, |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 291 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 292 | framework::dataset::make("DataType", { DataType::F32 }))) |
| 293 | { |
| 294 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 295 | } |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 296 | TEST_SUITE_END() // FP32 |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 297 | TEST_SUITE_END() // NHWC |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 298 | TEST_SUITE_END() // InputTransform |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 299 | |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 300 | TEST_SUITE(FilterTransform) |
Giorgio Arena | 2d9de0a | 2018-03-15 17:58:20 +0000 | [diff] [blame] | 301 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 302 | framework::dataset::make("InputInfo",{ |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 303 | TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::F16), // F16 supported |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 304 | TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::QASYMM8), // QASYMM8 not supported |
| 305 | TensorInfo(TensorShape(5U, 5U, 5U, 3U), 1, DataType::F32), // Kernel size not supported |
Giorgio Arena | 2d9de0a | 2018-03-15 17:58:20 +0000 | [diff] [blame] | 306 | TensorInfo(TensorShape(3U, 3U), 1, DataType::F32), // Output tile not supported |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 307 | TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::F32), // valid |
| 308 | TensorInfo(TensorShape(3U, 3U, 37U, 2U), 1, DataType::F32), // valid |
| 309 | TensorInfo(TensorShape(3U, 3U, 37U, 22U), 1, DataType::F32) // valid |
| 310 | }), |
| 311 | framework::dataset::make("OutputInfo", { |
| 312 | TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::F16), |
| 313 | TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::QASYMM8), |
| 314 | TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::F32), |
| 315 | TensorInfo(TensorShape(1U, 1U, 16U), 1, DataType::F32), |
| 316 | TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::F32), |
| 317 | TensorInfo(TensorShape(2U, 37U, 16U), 1, DataType::F32), |
Giorgio Arena | 2d9de0a | 2018-03-15 17:58:20 +0000 | [diff] [blame] | 318 | TensorInfo(TensorShape(22U, 37U, 36U), 1, DataType::F32) |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 319 | })), |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 320 | framework::dataset::make("WinogradInfo", { |
| 321 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ), |
| 322 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ), |
| 323 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ), |
| 324 | WinogradInfo(Size2D(3U, 3U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ), |
| 325 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ), |
| 326 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ), |
| 327 | WinogradInfo(Size2D(4U, 4U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ) |
| 328 | })), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 329 | framework::dataset::make("Expected", { true, false, false, false, true, true, true })), |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 330 | input_info, output_info, winograd_info, expected) |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 331 | { |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 332 | ARM_COMPUTE_EXPECT(bool(CLWinogradFilterTransformKernel::validate(&input_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), winograd_info)) == expected, framework::LogLevel::ERRORS); |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 333 | } |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 334 | |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 335 | using CLWinogradFilterTransform = CLSynthetizeFunctionWithZeroConstantBorder<CLWinogradFilterTransformKernel, 0>; |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 336 | using CLWinogradFilterTransformFixtureFP32 = WinogradFilterTransformValidationFixture<CLTensor, CLAccessor, CLWinogradFilterTransform, float>; |
| 337 | using CLWinogradFilterTransformFixtureFP16 = WinogradFilterTransformValidationFixture<CLTensor, CLAccessor, CLWinogradFilterTransform, half>; |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 338 | |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 339 | TEST_SUITE(NCHW) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 340 | TEST_SUITE(FP32) |
| 341 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradFilterTransformFixtureFP32, framework::DatasetMode::PRECOMMIT, |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 342 | combine(combine(SmallWinogradFilterTransformDatasetNCHW, |
| 343 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 344 | framework::dataset::make("DataType", { DataType::F32 }))) |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 345 | { |
| 346 | // Validate output |
| 347 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 348 | } |
| 349 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 350 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradFilterTransformFixtureFP32, framework::DatasetMode::NIGHTLY, |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 351 | combine(combine(LargeWinogradFilterTransformDatasetNCHW, |
| 352 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 353 | framework::dataset::make("DataType", { DataType::F32 }))) |
| 354 | { |
| 355 | // Validate output |
| 356 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 357 | } |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 358 | TEST_SUITE_END() // FP32 |
| 359 | TEST_SUITE(FP16) |
| 360 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradFilterTransformFixtureFP16, framework::DatasetMode::PRECOMMIT, |
| 361 | combine(combine(SmallWinogradFilterTransformDatasetNCHW, |
| 362 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 363 | framework::dataset::make("DataType", { DataType::F16 }))) |
| 364 | { |
| 365 | // Validate output |
| 366 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 367 | } |
| 368 | |
| 369 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradFilterTransformFixtureFP16, framework::DatasetMode::NIGHTLY, |
| 370 | combine(combine(LargeWinogradFilterTransformDatasetNCHW, |
| 371 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 372 | framework::dataset::make("DataType", { DataType::F16 }))) |
| 373 | { |
| 374 | // Validate output |
| 375 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 376 | } |
| 377 | TEST_SUITE_END() // FP16 |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 378 | TEST_SUITE_END() // NCHW |
| 379 | |
| 380 | TEST_SUITE(NHWC) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 381 | TEST_SUITE(FP16) |
| 382 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradFilterTransformFixtureFP16, framework::DatasetMode::PRECOMMIT, |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 383 | combine(combine(SmallWinogradFilterTransformDatasetNHWC_F16, |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 384 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 385 | framework::dataset::make("DataType", { DataType::F16 }))) |
| 386 | { |
| 387 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 388 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 389 | } |
| 390 | |
| 391 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradFilterTransformFixtureFP16, framework::DatasetMode::NIGHTLY, |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 392 | combine(combine(LargeWinogradFilterTransformDatasetNHWC_F16, |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 393 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 394 | framework::dataset::make("DataType", { DataType::F16 }))) |
| 395 | { |
| 396 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 397 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 398 | } |
| 399 | TEST_SUITE_END() // FP16 |
| 400 | TEST_SUITE(FP32) |
| 401 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradFilterTransformFixtureFP32, framework::DatasetMode::PRECOMMIT, |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 402 | combine(combine(SmallWinogradFilterTransformDatasetNHWC_F32, |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 403 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 404 | framework::dataset::make("DataType", { DataType::F32 }))) |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 405 | { |
| 406 | // Validate output |
| 407 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 408 | } |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 409 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 410 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradFilterTransformFixtureFP32, framework::DatasetMode::NIGHTLY, |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 411 | combine(combine(LargeWinogradFilterTransformDatasetNHWC_F32, |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 412 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 413 | framework::dataset::make("DataType", { DataType::F32 }))) |
| 414 | { |
| 415 | // Validate output |
| 416 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 417 | } |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 418 | TEST_SUITE_END() // FP32 |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 419 | TEST_SUITE_END() // NHWC |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 420 | TEST_SUITE_END() // FilterTransform |
| 421 | |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 422 | TEST_SUITE(OutputTransform) |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 423 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip( |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 424 | framework::dataset::make("InputInfo",{ |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 425 | TensorInfo(TensorShape(512U, 49U, 16U, 5U), 1, DataType::F16), // F16 supported |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 426 | TensorInfo(TensorShape(512U, 49U, 16U, 5U), 1, DataType::QASYMM8), // QASYMM8 not supported |
| 427 | TensorInfo(TensorShape(512U, 49U, 16U, 5U), 1, DataType::F32), // Kernel size not supported |
| 428 | TensorInfo(TensorShape(512U, 49U, 16U, 5U), 1, DataType::F32), // Valid |
| 429 | TensorInfo(TensorShape(13U, 108U, 16U, 4U), 1, DataType::F32), // Padding needed |
| 430 | TensorInfo(TensorShape(7U, 20U, 16U, 7U), 1, DataType::F32), // Valid |
Gian Marco Iodice | e52a300 | 2018-04-11 15:59:10 +0100 | [diff] [blame] | 431 | TensorInfo(TensorShape(7U, 20U, 16U, 7U), 1, DataType::F32), // Wrong WinogradInfo |
| 432 | TensorInfo(TensorShape(7U, 256U, 36U, 3U), 1, DataType::F32), // Valid |
| 433 | TensorInfo(TensorShape(7U, 256U, 16U, 3U), 1, DataType::F32) // Wrong number of batches |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 434 | }), |
| 435 | framework::dataset::make("BiasInfo", { |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 436 | TensorInfo(TensorShape(512U), 1, DataType::F16), |
| 437 | TensorInfo(TensorShape(512U), 1, DataType::QASYMM8), |
| 438 | TensorInfo(TensorShape(512U), 1, DataType::F32), |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 439 | TensorInfo(TensorShape(512U), 1, DataType::F32), |
| 440 | TensorInfo(TensorShape(13U), 1, DataType::F32), |
| 441 | TensorInfo(TensorShape(7U), 1, DataType::F32), |
Gian Marco Iodice | e52a300 | 2018-04-11 15:59:10 +0100 | [diff] [blame] | 442 | TensorInfo(TensorShape(7U), 1, DataType::F32), |
| 443 | TensorInfo(TensorShape(7U), 1, DataType::F32), |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 444 | TensorInfo(TensorShape(7U), 1, DataType::F32) |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 445 | })), |
| 446 | framework::dataset::make("OutputInfo", { |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 447 | TensorInfo(TensorShape(14U, 14U, 512U, 5U), 1, DataType::F16), |
| 448 | TensorInfo(TensorShape(14U, 14U, 512U, 5U), 1, DataType::QASYMM8), |
| 449 | TensorInfo(TensorShape(14U, 14U, 512U, 5U), 1, DataType::F32), |
| 450 | TensorInfo(TensorShape(14U, 14U, 512U, 5U), 1, DataType::F32), |
| 451 | TensorInfo(TensorShape(17U, 23U, 13U, 4U), 1, DataType::F32), |
| 452 | TensorInfo(TensorShape(8U, 10U, 7U, 7U), 1, DataType::F32), |
Gian Marco Iodice | e52a300 | 2018-04-11 15:59:10 +0100 | [diff] [blame] | 453 | TensorInfo(TensorShape(7U, 9U, 7U, 7U), 1, DataType::F32), |
| 454 | TensorInfo(TensorShape(64U, 64U, 7U, 3U), 1, DataType::F32), |
| 455 | TensorInfo(TensorShape(64U, 64U, 7U, 3U), 1, DataType::F32) |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 456 | })), |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 457 | framework::dataset::make("WinogradInfo", { |
| 458 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(14U, 14U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), |
| 459 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(14U, 14U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), |
| 460 | WinogradInfo(Size2D(2U, 2U), Size2D(5U, 5U), Size2D(14U, 14U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), |
| 461 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(14U, 14U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), |
| 462 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(17U, 23U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), |
| 463 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(8U, 10U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), |
| 464 | WinogradInfo(Size2D(2U, 3U), Size2D(3U, 3U), Size2D(8U, 10U), PadStrideInfo(1, 1, 0, 0), DataLayout::NCHW), |
Gian Marco Iodice | e52a300 | 2018-04-11 15:59:10 +0100 | [diff] [blame] | 465 | WinogradInfo(Size2D(4U, 4U), Size2D(3U, 3U), Size2D(64U, 64U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), |
| 466 | WinogradInfo(Size2D(4U, 4U), Size2D(3U, 3U), Size2D(64U, 64U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW) |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 467 | })), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 468 | framework::dataset::make("Expected", { true, false, false, true, false, true, false, true, false })), |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 469 | input_info, bias_info, output_info, winograd_info, expected) |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 470 | { |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 471 | ARM_COMPUTE_EXPECT(bool(CLWinogradOutputTransformKernel::validate(&input_info.clone()->set_is_resizable(false), &bias_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), winograd_info)) == expected, framework::LogLevel::ERRORS); |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 472 | } |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 473 | |
| 474 | using CLWinogradOutputTransform = CLSynthetizeFunctionWithZeroConstantBorder<CLWinogradOutputTransformKernel, 0>; |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 475 | using CLWinogradOutputTransformFixtureFP32 = WinogradOutputTransformValidationFixture<CLTensor, CLAccessor, CLWinogradOutputTransform, float>; |
| 476 | using CLWinogradOutputTransformFixtureFP16 = WinogradOutputTransformValidationFixture<CLTensor, CLAccessor, CLWinogradOutputTransform, half>; |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 477 | |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 478 | TEST_SUITE(NCHW) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 479 | TEST_SUITE(FP16) |
| 480 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradOutputTransformFixtureFP16, framework::DatasetMode::ALL, |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 481 | combine(combine(SmallWinogradOutputTransformDatasetNCHW, |
| 482 | framework::dataset::make("DataType", { DataType::F16 })), |
| 483 | framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 484 | { |
| 485 | // Validate output |
| 486 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 487 | } |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 488 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 489 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradOutputTransformFixtureFP16, framework::DatasetMode::NIGHTLY, |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 490 | combine(combine(LargeWinogradOutputTransformDatasetNCHW, |
| 491 | framework::dataset::make("DataType", { DataType::F16 })), |
| 492 | framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 493 | { |
| 494 | // Validate output |
| 495 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 496 | } |
| 497 | TEST_SUITE_END() // FP16 |
| 498 | TEST_SUITE(FP32) |
| 499 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradOutputTransformFixtureFP32, framework::DatasetMode::ALL, |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 500 | combine(combine(SmallWinogradOutputTransformDatasetNCHW, |
| 501 | framework::dataset::make("DataType", { DataType::F32 })), |
| 502 | framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 503 | { |
| 504 | // Validate output |
| 505 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 506 | } |
| 507 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 508 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradOutputTransformFixtureFP32, framework::DatasetMode::NIGHTLY, |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 509 | combine(combine(LargeWinogradOutputTransformDatasetNCHW, |
| 510 | framework::dataset::make("DataType", { DataType::F32 })), |
| 511 | framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 512 | { |
| 513 | // Validate output |
| 514 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 515 | } |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 516 | TEST_SUITE_END() // FP32 |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 517 | TEST_SUITE_END() // NCHW |
| 518 | |
| 519 | TEST_SUITE(NHWC) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 520 | TEST_SUITE(FP16) |
| 521 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradOutputTransformFixtureFP16, framework::DatasetMode::ALL, |
giuros01 | 3bfacb2 | 2019-04-01 12:07:02 +0100 | [diff] [blame] | 522 | combine(combine(SmallWinogradOutputTransformDatasetNHWC_F16, |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 523 | framework::dataset::make("DataType", { DataType::F16 })), |
| 524 | framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 525 | { |
| 526 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 527 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 528 | } |
| 529 | |
| 530 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradOutputTransformFixtureFP16, framework::DatasetMode::NIGHTLY, |
giuros01 | 3bfacb2 | 2019-04-01 12:07:02 +0100 | [diff] [blame] | 531 | combine(combine(LargeWinogradOutputTransformDatasetNHWC_F16, |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 532 | framework::dataset::make("DataType", { DataType::F16 })), |
| 533 | framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 534 | { |
| 535 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 536 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 537 | } |
| 538 | TEST_SUITE_END() // FP16 |
| 539 | TEST_SUITE(FP32) |
| 540 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradOutputTransformFixtureFP32, framework::DatasetMode::ALL, |
giuros01 | 3bfacb2 | 2019-04-01 12:07:02 +0100 | [diff] [blame] | 541 | combine(combine(SmallWinogradOutputTransformDatasetNHWC_F32, |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 542 | framework::dataset::make("DataType", { DataType::F32 })), |
| 543 | framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 544 | { |
| 545 | // Validate output |
| 546 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 547 | } |
| 548 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 549 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradOutputTransformFixtureFP32, framework::DatasetMode::NIGHTLY, |
giuros01 | 3bfacb2 | 2019-04-01 12:07:02 +0100 | [diff] [blame] | 550 | combine(combine(LargeWinogradOutputTransformDatasetNHWC_F32, |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 551 | framework::dataset::make("DataType", { DataType::F32 })), |
| 552 | framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 553 | { |
| 554 | // Validate output |
| 555 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 556 | } |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 557 | TEST_SUITE_END() // FP32 |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 558 | TEST_SUITE_END() // NHWC |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 559 | TEST_SUITE_END() // OutputTransform |
| 560 | |
| 561 | TEST_SUITE(ConvolutionLayer) |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 562 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip( |
| 563 | framework::dataset::make("InputInfo", { |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 564 | TensorInfo(TensorShape(17U, 31U, 2U), 1, DataType::F16), // Insufficient padding |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 565 | TensorInfo(TensorShape(17U, 31U, 2U), 1, DataType::F32), // Datatype mismatch |
| 566 | TensorInfo(TensorShape(23U, 27U, 5U, 4U), 1, DataType::F32), // Stride y not supported |
| 567 | TensorInfo(TensorShape(16U, 16U, 8U), 1, DataType::F32), // Padding needed |
| 568 | TensorInfo(TensorShape(33U, 27U, 7U, 4U), 1, DataType::F32) // Kernel size not supported |
| 569 | }), |
| 570 | framework::dataset::make("WeightsInfo", { |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 571 | TensorInfo(TensorShape(3U, 3U, 2U, 19U), 1, DataType::F16), |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 572 | TensorInfo(TensorShape(3U, 3U, 2U, 19U), 1, DataType::QASYMM8), |
| 573 | TensorInfo(TensorShape(3U, 3U, 5U, 21U), 1, DataType::F32), |
| 574 | TensorInfo(TensorShape(3U, 3U, 8U, 16U), 1, DataType::F32), |
| 575 | TensorInfo(TensorShape(5U, 5U, 7U, 16U), 1, DataType::F16) |
| 576 | })), |
| 577 | framework::dataset::make("BiasesInfo", { |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 578 | TensorInfo(TensorShape(19U), 1, DataType::F16), |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 579 | TensorInfo(TensorShape(19U), 1, DataType::F32), |
| 580 | TensorInfo(TensorShape(21U), 1, DataType::F32), |
| 581 | TensorInfo(TensorShape(16U), 1, DataType::F32), |
| 582 | TensorInfo(TensorShape(16U), 1, DataType::F32) |
| 583 | })), |
| 584 | framework::dataset::make("OutputInfo", { |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 585 | TensorInfo(TensorShape(17U, 31U, 19U), 1, DataType::F16), |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 586 | TensorInfo(TensorShape(15U, 15U, 19U), 1, DataType::F32), |
| 587 | TensorInfo(TensorShape(21U, 25U, 21U, 4U), 1, DataType::F32), |
| 588 | TensorInfo(TensorShape(16U, 16U, 16U), 1, DataType::F32), |
| 589 | TensorInfo(TensorShape(11U, 12U, 16U, 4U), 1, DataType::F32) |
| 590 | })), |
| 591 | framework::dataset::make("ConvInfo", { |
| 592 | PadStrideInfo(1, 1, 1, 1), |
| 593 | PadStrideInfo(1, 1, 1, 1), |
| 594 | PadStrideInfo(1, 2, 0, 0), |
| 595 | PadStrideInfo(1, 1, 1, 1), |
| 596 | PadStrideInfo(1, 1, 1, 0) |
| 597 | })), |
| 598 | framework::dataset::make("Expected", { false, false, false, false, false })), |
| 599 | input_info, weights_info, bias_info, output_info, conv_info, expected) |
| 600 | { |
| 601 | ARM_COMPUTE_EXPECT(bool(CLWinogradConvolutionLayer::validate(&input_info.clone()->set_is_resizable(false), &weights_info.clone()->set_is_resizable(false), &bias_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), conv_info)) == expected, framework::LogLevel::ERRORS); |
| 602 | } |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 603 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 604 | TEST_SUITE(FP32) |
Gian Marco Iodice | 2213d4b | 2018-04-27 10:39:06 +0100 | [diff] [blame] | 605 | using CLWinogradConvolutionLayerFastMathFixture = WinogradConvolutionLayerFastMathValidationFixture<CLTensor, CLAccessor, CLWinogradConvolutionLayer, float>; |
Gian Marco Iodice | 6cf188c | 2018-05-04 16:36:50 +0100 | [diff] [blame] | 606 | TEST_SUITE(Conv3x3) |
Gian Marco Iodice | 2213d4b | 2018-04-27 10:39:06 +0100 | [diff] [blame] | 607 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::PRECOMMIT, |
Pablo Tello | 7282d56 | 2018-06-14 15:35:49 +0100 | [diff] [blame] | 608 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer3x3Dataset(), |
| 609 | framework::dataset::make("DataType", { DataType::F32 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 610 | ActivationFunctionsSmallDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 611 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | 2213d4b | 2018-04-27 10:39:06 +0100 | [diff] [blame] | 612 | { |
| 613 | // Validate output |
Gian Marco Iodice | 4497e81 | 2018-05-08 16:36:52 +0100 | [diff] [blame] | 614 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
Gian Marco Iodice | 2213d4b | 2018-04-27 10:39:06 +0100 | [diff] [blame] | 615 | } |
| 616 | |
| 617 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::NIGHTLY, |
Pablo Tello | 7282d56 | 2018-06-14 15:35:49 +0100 | [diff] [blame] | 618 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer3x3Dataset(), |
| 619 | framework::dataset::make("DataType", { DataType::F32 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 620 | ActivationFunctionsDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 621 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | 2213d4b | 2018-04-27 10:39:06 +0100 | [diff] [blame] | 622 | { |
| 623 | // Validate output |
Gian Marco Iodice | 4497e81 | 2018-05-08 16:36:52 +0100 | [diff] [blame] | 624 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
Gian Marco Iodice | 2213d4b | 2018-04-27 10:39:06 +0100 | [diff] [blame] | 625 | } |
Gian Marco Iodice | 6cf188c | 2018-05-04 16:36:50 +0100 | [diff] [blame] | 626 | TEST_SUITE_END() // Conv3x3 |
| 627 | |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 628 | TEST_SUITE(Conv3x1) |
| 629 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::PRECOMMIT, |
| 630 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer3x1Dataset(), |
| 631 | framework::dataset::make("DataType", { DataType::F32 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 632 | ActivationFunctionsSmallDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 633 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 634 | { |
| 635 | // Validate output |
| 636 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
| 637 | } |
| 638 | |
| 639 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::NIGHTLY, |
| 640 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer3x1Dataset(), |
| 641 | framework::dataset::make("DataType", { DataType::F32 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 642 | ActivationFunctionsDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 643 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 644 | { |
| 645 | // Validate output |
| 646 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
| 647 | } |
| 648 | TEST_SUITE_END() // Conv3x1 |
| 649 | |
| 650 | TEST_SUITE(Conv1x3) |
| 651 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::PRECOMMIT, |
| 652 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer1x3Dataset(), |
| 653 | framework::dataset::make("DataType", { DataType::F32 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 654 | ActivationFunctionsSmallDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 655 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 656 | { |
| 657 | // Validate output |
| 658 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
| 659 | } |
| 660 | |
| 661 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::NIGHTLY, |
| 662 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer1x3Dataset(), |
| 663 | framework::dataset::make("DataType", { DataType::F32 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 664 | ActivationFunctionsDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 665 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 666 | { |
| 667 | // Validate output |
| 668 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
| 669 | } |
| 670 | TEST_SUITE_END() // Conv1x3 |
| 671 | |
Gian Marco Iodice | 6cf188c | 2018-05-04 16:36:50 +0100 | [diff] [blame] | 672 | TEST_SUITE(Conv5x5) |
| 673 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::PRECOMMIT, |
Pablo Tello | 7282d56 | 2018-06-14 15:35:49 +0100 | [diff] [blame] | 674 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer5x5Dataset(), |
| 675 | framework::dataset::make("DataType", { DataType::F32 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 676 | ActivationFunctionsSmallDataset ), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 677 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Pablo Tello | 7282d56 | 2018-06-14 15:35:49 +0100 | [diff] [blame] | 678 | |
Gian Marco Iodice | 6cf188c | 2018-05-04 16:36:50 +0100 | [diff] [blame] | 679 | { |
| 680 | // Validate output |
Gian Marco Iodice | 4497e81 | 2018-05-08 16:36:52 +0100 | [diff] [blame] | 681 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
Gian Marco Iodice | 6cf188c | 2018-05-04 16:36:50 +0100 | [diff] [blame] | 682 | } |
| 683 | |
| 684 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::NIGHTLY, |
Pablo Tello | 7282d56 | 2018-06-14 15:35:49 +0100 | [diff] [blame] | 685 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer5x5Dataset(), |
| 686 | framework::dataset::make("DataType", { DataType::F32 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 687 | ActivationFunctionsDataset ), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 688 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Pablo Tello | 7282d56 | 2018-06-14 15:35:49 +0100 | [diff] [blame] | 689 | |
Gian Marco Iodice | 6cf188c | 2018-05-04 16:36:50 +0100 | [diff] [blame] | 690 | { |
| 691 | // Validate output |
Gian Marco Iodice | 4497e81 | 2018-05-08 16:36:52 +0100 | [diff] [blame] | 692 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
Gian Marco Iodice | 6cf188c | 2018-05-04 16:36:50 +0100 | [diff] [blame] | 693 | } |
| 694 | TEST_SUITE_END() // Conv5x5 |
Gian Marco Iodice | 2213d4b | 2018-04-27 10:39:06 +0100 | [diff] [blame] | 695 | |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 696 | TEST_SUITE(Conv5x1) |
| 697 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::PRECOMMIT, |
| 698 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer5x1Dataset(), |
| 699 | framework::dataset::make("DataType", { DataType::F32 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 700 | ActivationFunctionsSmallDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 701 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 702 | |
| 703 | { |
| 704 | // Validate output |
| 705 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
| 706 | } |
| 707 | |
| 708 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::NIGHTLY, |
| 709 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer5x1Dataset(), |
| 710 | framework::dataset::make("DataType", { DataType::F32 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 711 | ActivationFunctionsDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 712 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 713 | |
| 714 | { |
| 715 | // Validate output |
| 716 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
| 717 | } |
| 718 | TEST_SUITE_END() // Conv5x1 |
| 719 | |
| 720 | TEST_SUITE(Conv1x5) |
| 721 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::PRECOMMIT, |
| 722 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer1x5Dataset(), |
| 723 | framework::dataset::make("DataType", { DataType::F32 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 724 | ActivationFunctionsSmallDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 725 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 726 | |
| 727 | { |
| 728 | // Validate output |
| 729 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
| 730 | } |
| 731 | |
| 732 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::NIGHTLY, |
| 733 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer1x5Dataset(), |
| 734 | framework::dataset::make("DataType", { DataType::F32 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 735 | ActivationFunctionsDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 736 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 737 | |
| 738 | { |
| 739 | // Validate output |
| 740 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
| 741 | } |
| 742 | TEST_SUITE_END() // Conv1x5 |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 743 | TEST_SUITE_END() // FP32 |
| 744 | |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 745 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 746 | TEST_SUITE(FP16) |
| 747 | |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 748 | using CLWinogradConvolutionLayerFastMathFixture16 = WinogradConvolutionLayerFastMathValidationFixture<CLTensor, CLAccessor, CLWinogradConvolutionLayer, half, float>; |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 749 | TEST_SUITE(Conv3x3) |
| 750 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, |
| 751 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer3x3Dataset(), |
| 752 | framework::dataset::make("DataType", { DataType::F16 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 753 | ActivationFunctionsSmallDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 754 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 755 | { |
| 756 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 757 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 758 | } |
| 759 | |
| 760 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, |
| 761 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer3x3Dataset(), |
| 762 | framework::dataset::make("DataType", { DataType::F16 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 763 | ActivationFunctionsDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 764 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 765 | { |
| 766 | // Validate output |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 767 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 768 | } |
| 769 | TEST_SUITE_END() // Conv3x3 |
| 770 | |
| 771 | TEST_SUITE(Conv3x1) |
| 772 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, |
| 773 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer3x1Dataset(), |
| 774 | framework::dataset::make("DataType", { DataType::F16 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 775 | ActivationFunctionsSmallDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 776 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 777 | { |
| 778 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 779 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 780 | } |
| 781 | |
| 782 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, |
| 783 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer3x1Dataset(), |
| 784 | framework::dataset::make("DataType", { DataType::F16 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 785 | ActivationFunctionsDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 786 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 787 | { |
| 788 | // Validate output |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 789 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 790 | } |
| 791 | TEST_SUITE_END() // Conv3x1 |
| 792 | |
| 793 | TEST_SUITE(Conv1x3) |
| 794 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, |
| 795 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer1x3Dataset(), |
| 796 | framework::dataset::make("DataType", { DataType::F16 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 797 | ActivationFunctionsSmallDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 798 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 799 | { |
| 800 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 801 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 802 | } |
| 803 | |
| 804 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, |
| 805 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer1x3Dataset(), |
| 806 | framework::dataset::make("DataType", { DataType::F16 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 807 | ActivationFunctionsDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 808 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 809 | { |
| 810 | // Validate output |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 811 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 812 | } |
| 813 | TEST_SUITE_END() // Conv1x3 |
| 814 | |
| 815 | TEST_SUITE(Conv5x5) |
| 816 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, |
| 817 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer5x5Dataset(), |
| 818 | framework::dataset::make("DataType", { DataType::F16 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 819 | ActivationFunctionsSmallDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 820 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 821 | |
| 822 | { |
| 823 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 824 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 825 | } |
| 826 | |
| 827 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, |
| 828 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer5x5Dataset(), |
| 829 | framework::dataset::make("DataType", { DataType::F16 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 830 | ActivationFunctionsDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 831 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 832 | |
| 833 | { |
| 834 | // Validate output |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 835 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 836 | } |
| 837 | TEST_SUITE_END() // Conv5x5 |
| 838 | |
| 839 | TEST_SUITE(Conv5x1) |
| 840 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, |
| 841 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer5x1Dataset(), |
| 842 | framework::dataset::make("DataType", { DataType::F16 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 843 | ActivationFunctionsSmallDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 844 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 845 | |
| 846 | { |
| 847 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 848 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 849 | } |
| 850 | |
| 851 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, |
| 852 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer5x1Dataset(), |
| 853 | framework::dataset::make("DataType", { DataType::F16 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 854 | ActivationFunctionsDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 855 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 856 | |
| 857 | { |
| 858 | // Validate output |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 859 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 860 | } |
| 861 | TEST_SUITE_END() // Conv5x1 |
| 862 | |
| 863 | TEST_SUITE(Conv1x5) |
| 864 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, |
| 865 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer1x5Dataset(), |
| 866 | framework::dataset::make("DataType", { DataType::F16 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 867 | ActivationFunctionsSmallDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 868 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 869 | |
| 870 | { |
| 871 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 872 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 873 | } |
| 874 | |
| 875 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, |
| 876 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer1x5Dataset(), |
| 877 | framework::dataset::make("DataType", { DataType::F16 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 878 | ActivationFunctionsDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 879 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 880 | |
| 881 | { |
| 882 | // Validate output |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 883 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 884 | } |
| 885 | TEST_SUITE_END() // Conv1x5 |
| 886 | |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 887 | TEST_SUITE(Conv1x7) |
| 888 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, |
| 889 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer1x7Dataset(), |
| 890 | framework::dataset::make("DataType", { DataType::F16 })), |
| 891 | ActivationFunctionsSmallDataset), |
| 892 | framework::dataset::make("DataLayout", { DataLayout::NHWC }))) |
| 893 | |
| 894 | { |
| 895 | // Validate output |
| 896 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_f16); |
| 897 | } |
| 898 | |
| 899 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, |
| 900 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer1x7Dataset(), |
| 901 | framework::dataset::make("DataType", { DataType::F16 })), |
| 902 | ActivationFunctionsDataset), |
| 903 | framework::dataset::make("DataLayout", { DataLayout::NHWC }))) |
| 904 | |
| 905 | { |
| 906 | // Validate output |
| 907 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); |
| 908 | } |
| 909 | TEST_SUITE_END() // Conv1x7 |
| 910 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 911 | TEST_SUITE_END() // FP16 |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 912 | |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 913 | TEST_SUITE_END() // ConvolutionLayer |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 914 | TEST_SUITE_END() // Winograd |
| 915 | TEST_SUITE_END() // CL |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 916 | } // namespace validation |
| 917 | } // namespace test |
| 918 | } // namespace arm_compute |