Compute Library
 19.08
Winograd.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2019 ARM Limited.
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  */
27 #include "arm_compute/core/Types.h"
33 #include "tests/CL/CLAccessor.h"
34 #include "tests/CL/Helper.h"
36 #include "tests/datasets/LargeConvolutionLayerDataset.h"
37 #include "tests/datasets/ShapeDatasets.h"
38 #include "tests/datasets/SmallConvolutionLayerDataset.h"
39 #include "tests/datasets/WinogradInputTransformDataset.h"
40 #include "tests/datasets/WinogradOutputTransformDataset.h"
42 #include "tests/framework/Macros.h"
45 #include "tests/validation/fixtures/WinogradConvolutionLayerFixture.h"
46 
47 namespace arm_compute
48 {
49 namespace test
50 {
51 namespace validation
52 {
53 namespace
54 {
55 // *INDENT-OFF*
56 // clang-format off
57 constexpr AbsoluteTolerance<float> tolerance_f32(0.002f);
58 const AbsoluteTolerance<half> tolerance_f16(half(0.5f));
59 constexpr AbsoluteTolerance<float> tolerance_convolution_layer_f32(0.1f);
60 const AbsoluteTolerance<half> tolerance_convolution_layer_f16(half(0.4f));
61 RelativeTolerance<half_float::half> rel_tolerance_f16(half(0.2));
62 constexpr float tolerance_num = 0.05f;
63 constexpr float abs_tolerance_convolution_layer_f16 = 2.5f;
64 constexpr float tolerance_num_convolution_f16 = 0.15f;
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(),
74  framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x4_5x5(),
75  framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x1_5x1(),
76  datasets::SmallWinogradInputTransformDataset1x4_1x5()))))))));
77 
78 const auto SmallWinogradInputTransformDatasetNHWC = framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x4_3x3(),
79  framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x1_3x1(),
80  framework::dataset::concat(datasets::SmallWinogradInputTransformDataset1x4_1x3(),
81  framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x4_5x5(),
82  framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x1_5x1(),
83  datasets::SmallWinogradInputTransformDataset1x4_1x5())))));
84 
85 const auto SmallWinogradInputTransformDatasetNHWC_FP32 = framework::dataset::concat(SmallWinogradInputTransformDatasetNHWC,
86  framework::dataset::concat(datasets::SmallWinogradInputTransformDataset1x2_1x7(),
87  framework::dataset::concat(datasets::SmallWinogradInputTransformDataset2x1_7x1(),
88  datasets::SmallWinogradInputTransformDataset2x2_7x7())));
89 
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(),
97  framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x4_5x5(),
98  framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x1_5x1(),
99  datasets::LargeWinogradInputTransformDataset1x4_1x5()))))))));
100 
101 const auto LargeWinogradInputTransformDatasetNHWC =
102  framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x4_3x3(),
103  framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x4_5x5(),
104  framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x1_5x1(),
105  datasets::LargeWinogradInputTransformDataset1x4_1x5())));
106 
107 const auto LargeWinogradInputTransformDatasetNHWC_FP32 =
108  framework::dataset::concat(LargeWinogradInputTransformDatasetNHWC,
109  framework::dataset::concat(datasets::LargeWinogradInputTransformDataset1x2_1x7(),
110  framework::dataset::concat(datasets::LargeWinogradInputTransformDataset2x1_7x1(),
111  (datasets::LargeWinogradInputTransformDataset2x2_7x7()))));
112 
113 // Filter transform
114 const auto SmallWinogradFilterTransformDatasetNCHW =
115  framework::dataset::concat(combine(datasets::Small3x3Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 2U), Size2D(4U, 4U) })),
116  framework::dataset::concat(combine(datasets::Small3x1Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 1U), Size2D(4U, 1U) })),
117  framework::dataset::concat(combine(datasets::Small1x3Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 2U), Size2D(1U, 4U) })),
118  framework::dataset::concat(combine(datasets::Small5x5Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })),
119  framework::dataset::concat(combine(datasets::Small5x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })),
120  combine(datasets::Small1x5Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) })))))));
121 
122 const auto SmallWinogradFilterTransformDatasetNHWC_F16 =
123  framework::dataset::concat(combine(datasets::Small3x3Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })),
124  framework::dataset::concat(combine(datasets::Small3x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })),
125  framework::dataset::concat(combine(datasets::Small1x3Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) })),
126  framework::dataset::concat(combine(datasets::Small5x5Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })),
127  framework::dataset::concat(combine(datasets::Small5x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })),
128  (combine(datasets::Small1x5Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) }))))))));
129 
130 const auto SmallWinogradFilterTransformDatasetNHWC_F32 =
131  framework::dataset::concat(SmallWinogradFilterTransformDatasetNHWC_F16,
132  framework::dataset::concat(combine(datasets::Small7x7Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 2U) })),
133  framework::dataset::concat(combine(datasets::Small7x1Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 1U) })),
134  combine(datasets::Small1x7Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 2U) })))));
135 
136 const auto LargeWinogradFilterTransformDatasetNCHW =
137  framework::dataset::concat(combine(datasets::Large3x3Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 2U), Size2D(4U, 4U) })),
138  framework::dataset::concat(combine(datasets::Large3x1Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 1U), Size2D(4U, 1U) })),
139  framework::dataset::concat(combine(datasets::Large1x3Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 2U), Size2D(1U, 4U) })),
140  framework::dataset::concat(combine(datasets::Large5x5Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })),
141  framework::dataset::concat(combine(datasets::Large5x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })),
142  combine(datasets::Large1x5Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) })))))));
143 
144 const auto LargeWinogradFilterTransformDatasetNHWC_F16 =
145  framework::dataset::concat(combine(datasets::Large3x3Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })),
146  framework::dataset::concat(combine(datasets::Large3x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })),
147  framework::dataset::concat(combine(datasets::Large1x3Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) })),
148  framework::dataset::concat(combine(datasets::Large5x5Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })),
149  framework::dataset::concat(combine(datasets::Large5x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })),
150  combine(datasets::Large1x5Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) })))))));
151 
152 const auto LargeWinogradFilterTransformDatasetNHWC_F32 =
153  framework::dataset::concat(LargeWinogradFilterTransformDatasetNHWC_F16,
154  framework::dataset::concat(combine(datasets::Large7x7Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 2U) })),
155  framework::dataset::concat(combine(datasets::Large7x1Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 1U) })),
156  combine(datasets::Large1x7Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 2U) })))));
157 
158 // Output transform
159 const auto SmallWinogradOutputTransformDatasetNCHW = datasets::SmallWinogradOutputTransformDatasetNCHW();
160 
161 const auto SmallWinogradOutputTransformDatasetNHWC_F16 = datasets::SmallWinogradOutputTransformDatasetNHWC_F16();
162 
163 const auto SmallWinogradOutputTransformDatasetNHWC_F32 = datasets::SmallWinogradOutputTransformDatasetNHWC_F32();
164 
165 const auto LargeWinogradOutputTransformDatasetNCHW = datasets::LargeWinogradOutputTransformDatasetNCHW();
166 
167 const auto LargeWinogradOutputTransformDatasetNHWC_F16 = datasets::LargeWinogradOutputTransformDatasetNHWC_F16();
168 
169 const auto LargeWinogradOutputTransformDatasetNHWC_F32 = datasets::LargeWinogradOutputTransformDatasetNHWC_F32();
170 
171 //Activation Functions
172 const auto ActivationFunctionsDataset = framework::dataset::make("ActivationInfo",
173 {
174  ActivationLayerInfo(),
179 });
180 const auto ActivationFunctionsSmallDataset = framework::dataset::make("ActivationInfo",
181 {
182  ActivationLayerInfo(),
186 });
187 } // namespace
188 
190 
191 TEST_SUITE(CL)
192 TEST_SUITE(Winograd)
193 
194 TEST_SUITE(InputTransform)
195 DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(
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
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
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  })),
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)
222  })),
223  framework::dataset::make("Expected", { false, false, false, false, false, false, false })),
225 {
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);
227 }
228 
229 using CLWinogradInputTransformFixtureFP32 = WinogradInputTransformValidationFixture<CLTensor, CLAccessor, CLWinogradInputTransform, float>;
230 using CLWinogradInputTransformFixtureFP16 = WinogradInputTransformValidationFixture<CLTensor, CLAccessor, CLWinogradInputTransform, half>;
231 
232 TEST_SUITE(NCHW)
233 TEST_SUITE(FP32)
234 FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradInputTransformFixtureFP32, framework::DatasetMode::PRECOMMIT, combine(combine(SmallWinogradInputTransformDatasetNCHW,
235  framework::dataset::make("DataLayout", { DataLayout::NCHW })),
236  framework::dataset::make("DataType", { DataType::F32 })))
237 {
238  validate(CLAccessor(_target), _reference, tolerance_f32);
239 }
240 
242  framework::dataset::make("DataLayout", { DataLayout::NCHW })),
243  framework::dataset::make("DataType", { DataType::F32 })))
244 {
245  validate(CLAccessor(_target), _reference, tolerance_f32);
246 }
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 
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
264 TEST_SUITE_END() // NCHW
265 
266 TEST_SUITE(NHWC)
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 {
272  validate(CLAccessor(_target), _reference, tolerance_f16);
273 }
274 
276  framework::dataset::make("DataLayout", { DataLayout::NHWC })),
277  framework::dataset::make("DataType", { DataType::F16 })))
278 {
279  validate(CLAccessor(_target), _reference, tolerance_f16);
280 }
281 TEST_SUITE_END() // FP16
282 TEST_SUITE(FP32)
283 FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradInputTransformFixtureFP32, framework::DatasetMode::PRECOMMIT, combine(combine(SmallWinogradInputTransformDatasetNHWC_FP32,
284  framework::dataset::make("DataLayout", { DataLayout::NHWC })),
285  framework::dataset::make("DataType", { DataType::F32 })))
286 {
287  validate(CLAccessor(_target), _reference, tolerance_f32);
288 }
289 
291  framework::dataset::make("DataLayout", { DataLayout::NHWC })),
292  framework::dataset::make("DataType", { DataType::F32 })))
293 {
294  validate(CLAccessor(_target), _reference, tolerance_f32);
295 }
296 TEST_SUITE_END() // FP32
297 TEST_SUITE_END() // NHWC
298 TEST_SUITE_END() // InputTransform
299 
300 TEST_SUITE(FilterTransform)
301 DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(
302  framework::dataset::make("InputInfo",{
303  TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::F16), // F16 supported
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
306  TensorInfo(TensorShape(3U, 3U), 1, DataType::F32), // Output tile not supported
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),
318  TensorInfo(TensorShape(22U, 37U, 36U), 1, DataType::F32)
319  })),
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  })),
329  framework::dataset::make("Expected", { true, false, false, false, true, true, true })),
331 {
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);
333 }
334 
336 using CLWinogradFilterTransformFixtureFP32 = WinogradFilterTransformValidationFixture<CLTensor, CLAccessor, CLWinogradFilterTransform, float>;
337 using CLWinogradFilterTransformFixtureFP16 = WinogradFilterTransformValidationFixture<CLTensor, CLAccessor, CLWinogradFilterTransform, half>;
338 
339 TEST_SUITE(NCHW)
340 TEST_SUITE(FP32)
342  combine(combine(SmallWinogradFilterTransformDatasetNCHW,
343  framework::dataset::make("DataLayout", { DataLayout::NCHW })),
344  framework::dataset::make("DataType", { DataType::F32 })))
345 {
346  // Validate output
347  validate(CLAccessor(_target), _reference, tolerance_f32);
348 }
349 
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 }
358 TEST_SUITE_END() // FP32
359 TEST_SUITE(FP16)
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 
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
378 TEST_SUITE_END() // NCHW
379 
380 TEST_SUITE(NHWC)
381 TEST_SUITE(FP16)
383  combine(combine(SmallWinogradFilterTransformDatasetNHWC_F16,
384  framework::dataset::make("DataLayout", { DataLayout::NHWC })),
385  framework::dataset::make("DataType", { DataType::F16 })))
386 {
387  // Validate output
388  validate(CLAccessor(_target), _reference, tolerance_f16);
389 }
390 
392  combine(combine(LargeWinogradFilterTransformDatasetNHWC_F16,
393  framework::dataset::make("DataLayout", { DataLayout::NHWC })),
394  framework::dataset::make("DataType", { DataType::F16 })))
395 {
396  // Validate output
397  validate(CLAccessor(_target), _reference, tolerance_f16);
398 }
399 TEST_SUITE_END() // FP16
400 TEST_SUITE(FP32)
402  combine(combine(SmallWinogradFilterTransformDatasetNHWC_F32,
403  framework::dataset::make("DataLayout", { DataLayout::NHWC })),
404  framework::dataset::make("DataType", { DataType::F32 })))
405 {
406  // Validate output
407  validate(CLAccessor(_target), _reference, tolerance_f32);
408 }
409 
411  combine(combine(LargeWinogradFilterTransformDatasetNHWC_F32,
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 }
418 TEST_SUITE_END() // FP32
419 TEST_SUITE_END() // NHWC
420 TEST_SUITE_END() // FilterTransform
421 
422 TEST_SUITE(OutputTransform)
423 DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(
424  framework::dataset::make("InputInfo",{
425  TensorInfo(TensorShape(512U, 49U, 16U, 5U), 1, DataType::F16), // F16 supported
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
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
434  }),
435  framework::dataset::make("BiasInfo", {
436  TensorInfo(TensorShape(512U), 1, DataType::F16),
437  TensorInfo(TensorShape(512U), 1, DataType::QASYMM8),
438  TensorInfo(TensorShape(512U), 1, DataType::F32),
439  TensorInfo(TensorShape(512U), 1, DataType::F32),
440  TensorInfo(TensorShape(13U), 1, DataType::F32),
441  TensorInfo(TensorShape(7U), 1, DataType::F32),
442  TensorInfo(TensorShape(7U), 1, DataType::F32),
443  TensorInfo(TensorShape(7U), 1, DataType::F32),
444  TensorInfo(TensorShape(7U), 1, DataType::F32)
445  })),
446  framework::dataset::make("OutputInfo", {
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),
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)
456  })),
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),
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)
467  })),
468  framework::dataset::make("Expected", { true, false, false, true, false, true, false, true, false })),
470 {
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);
472 }
473 
475 using CLWinogradOutputTransformFixtureFP32 = WinogradOutputTransformValidationFixture<CLTensor, CLAccessor, CLWinogradOutputTransform, float>;
476 using CLWinogradOutputTransformFixtureFP16 = WinogradOutputTransformValidationFixture<CLTensor, CLAccessor, CLWinogradOutputTransform, half>;
477 
478 TEST_SUITE(NCHW)
479 TEST_SUITE(FP16)
481  combine(combine(SmallWinogradOutputTransformDatasetNCHW,
482  framework::dataset::make("DataType", { DataType::F16 })),
483  framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) ))
484 {
485  // Validate output
486  validate(CLAccessor(_target), _reference, tolerance_f16);
487 }
488 
490  combine(combine(LargeWinogradOutputTransformDatasetNCHW,
491  framework::dataset::make("DataType", { DataType::F16 })),
492  framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) ))
493 {
494  // Validate output
495  validate(CLAccessor(_target), _reference, tolerance_f16);
496 }
497 TEST_SUITE_END() // FP16
498 TEST_SUITE(FP32)
500  combine(combine(SmallWinogradOutputTransformDatasetNCHW,
501  framework::dataset::make("DataType", { DataType::F32 })),
502  framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) ))
503 {
504  // Validate output
505  validate(CLAccessor(_target), _reference, tolerance_f32);
506 }
507 
509  combine(combine(LargeWinogradOutputTransformDatasetNCHW,
510  framework::dataset::make("DataType", { DataType::F32 })),
511  framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) ))
512 {
513  // Validate output
514  validate(CLAccessor(_target), _reference, tolerance_f32);
515 }
516 TEST_SUITE_END() // FP32
517 TEST_SUITE_END() // NCHW
518 
519 TEST_SUITE(NHWC)
520 TEST_SUITE(FP16)
522  combine(combine(SmallWinogradOutputTransformDatasetNHWC_F16,
523  framework::dataset::make("DataType", { DataType::F16 })),
524  framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) ))
525 {
526  // Validate output
527  validate(CLAccessor(_target), _reference, tolerance_f16);
528 }
529 
531  combine(combine(LargeWinogradOutputTransformDatasetNHWC_F16,
532  framework::dataset::make("DataType", { DataType::F16 })),
533  framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) ))
534 {
535  // Validate output
536  validate(CLAccessor(_target), _reference, tolerance_f16);
537 }
538 TEST_SUITE_END() // FP16
539 TEST_SUITE(FP32)
541  combine(combine(SmallWinogradOutputTransformDatasetNHWC_F32,
542  framework::dataset::make("DataType", { DataType::F32 })),
543  framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) ))
544 {
545  // Validate output
546  validate(CLAccessor(_target), _reference, tolerance_f32);
547 }
548 
550  combine(combine(LargeWinogradOutputTransformDatasetNHWC_F32,
551  framework::dataset::make("DataType", { DataType::F32 })),
552  framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) ))
553 {
554  // Validate output
555  validate(CLAccessor(_target), _reference, tolerance_f32);
556 }
557 TEST_SUITE_END() // FP32
558 TEST_SUITE_END() // NHWC
559 TEST_SUITE_END() // OutputTransform
560 
561 TEST_SUITE(ConvolutionLayer)
562 DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(
563  framework::dataset::make("InputInfo", {
564  TensorInfo(TensorShape(17U, 31U, 2U), 1, DataType::F16), // Insufficient padding
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", {
571  TensorInfo(TensorShape(3U, 3U, 2U, 19U), 1, DataType::F16),
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", {
578  TensorInfo(TensorShape(19U), 1, DataType::F16),
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", {
585  TensorInfo(TensorShape(17U, 31U, 19U), 1, DataType::F16),
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 })),
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 }
603 
604 TEST_SUITE(FP32)
605 using CLWinogradConvolutionLayerFastMathFixture = WinogradConvolutionLayerFastMathValidationFixture<CLTensor, CLAccessor, CLWinogradConvolutionLayer, float>;
606 TEST_SUITE(Conv3x3)
608  combine(combine(combine(datasets::SmallWinogradConvolutionLayer3x3Dataset(),
609  framework::dataset::make("DataType", { DataType::F32 })),
610  ActivationFunctionsSmallDataset),
612 {
613  // Validate output
614  validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
615 }
616 
618  combine(combine(combine(datasets::LargeWinogradConvolutionLayer3x3Dataset(),
619  framework::dataset::make("DataType", { DataType::F32 })),
620  ActivationFunctionsDataset),
622 {
623  // Validate output
624  validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
625 }
626 TEST_SUITE_END() // Conv3x3
627 
628 TEST_SUITE(Conv3x1)
630  combine(combine(combine(datasets::SmallWinogradConvolutionLayer3x1Dataset(),
631  framework::dataset::make("DataType", { DataType::F32 })),
632  ActivationFunctionsSmallDataset),
634 {
635  // Validate output
636  validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
637 }
638 
640  combine(combine(combine(datasets::LargeWinogradConvolutionLayer3x1Dataset(),
641  framework::dataset::make("DataType", { DataType::F32 })),
642  ActivationFunctionsDataset),
644 {
645  // Validate output
646  validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
647 }
648 TEST_SUITE_END() // Conv3x1
649 
650 TEST_SUITE(Conv1x3)
652  combine(combine(combine(datasets::SmallWinogradConvolutionLayer1x3Dataset(),
653  framework::dataset::make("DataType", { DataType::F32 })),
654  ActivationFunctionsSmallDataset),
656 {
657  // Validate output
658  validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
659 }
660 
662  combine(combine(combine(datasets::LargeWinogradConvolutionLayer1x3Dataset(),
663  framework::dataset::make("DataType", { DataType::F32 })),
664  ActivationFunctionsDataset),
666 {
667  // Validate output
668  validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
669 }
670 TEST_SUITE_END() // Conv1x3
671 
672 TEST_SUITE(Conv5x5)
674  combine(combine(combine(datasets::SmallWinogradConvolutionLayer5x5Dataset(),
675  framework::dataset::make("DataType", { DataType::F32 })),
676  ActivationFunctionsSmallDataset ),
678 
679 {
680  // Validate output
681  validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
682 }
683 
685  combine(combine(combine(datasets::LargeWinogradConvolutionLayer5x5Dataset(),
686  framework::dataset::make("DataType", { DataType::F32 })),
687  ActivationFunctionsDataset ),
689 
690 {
691  // Validate output
692  validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
693 }
694 TEST_SUITE_END() // Conv5x5
695 
696 TEST_SUITE(Conv5x1)
698  combine(combine(combine(datasets::SmallWinogradConvolutionLayer5x1Dataset(),
699  framework::dataset::make("DataType", { DataType::F32 })),
700  ActivationFunctionsSmallDataset),
702 
703 {
704  // Validate output
705  validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
706 }
707 
709  combine(combine(combine(datasets::LargeWinogradConvolutionLayer5x1Dataset(),
710  framework::dataset::make("DataType", { DataType::F32 })),
711  ActivationFunctionsDataset),
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)
722  combine(combine(combine(datasets::SmallWinogradConvolutionLayer1x5Dataset(),
723  framework::dataset::make("DataType", { DataType::F32 })),
724  ActivationFunctionsSmallDataset),
726 
727 {
728  // Validate output
729  validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
730 }
731 
733  combine(combine(combine(datasets::LargeWinogradConvolutionLayer1x5Dataset(),
734  framework::dataset::make("DataType", { DataType::F32 })),
735  ActivationFunctionsDataset),
737 
738 {
739  // Validate output
740  validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32);
741 }
742 TEST_SUITE_END() // Conv1x5
743 TEST_SUITE_END() // FP32
744 
745 
746 TEST_SUITE(FP16)
747 
748 using CLWinogradConvolutionLayerFastMathFixture16 = WinogradConvolutionLayerFastMathValidationFixture<CLTensor, CLAccessor, CLWinogradConvolutionLayer, half, float>;
749 TEST_SUITE(Conv3x3)
751  combine(combine(combine(datasets::SmallWinogradConvolutionLayer3x3Dataset(),
752  framework::dataset::make("DataType", { DataType::F16 })),
753  ActivationFunctionsSmallDataset),
755 {
756  // Validate output
757  validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_convolution_f16);
758 }
759 
761  combine(combine(combine(datasets::LargeWinogradConvolutionLayer3x3Dataset(),
762  framework::dataset::make("DataType", { DataType::F16 })),
763  ActivationFunctionsDataset),
765 {
766  // Validate output
767  validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16);
768 }
769 TEST_SUITE_END() // Conv3x3
770 
771 TEST_SUITE(Conv3x1)
773  combine(combine(combine(datasets::SmallWinogradConvolutionLayer3x1Dataset(),
774  framework::dataset::make("DataType", { DataType::F16 })),
775  ActivationFunctionsSmallDataset),
777 {
778  // Validate output
779  validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_convolution_f16);
780 }
781 
783  combine(combine(combine(datasets::LargeWinogradConvolutionLayer3x1Dataset(),
784  framework::dataset::make("DataType", { DataType::F16 })),
785  ActivationFunctionsDataset),
787 {
788  // Validate output
789  validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16);
790 }
791 TEST_SUITE_END() // Conv3x1
792 
793 TEST_SUITE(Conv1x3)
795  combine(combine(combine(datasets::SmallWinogradConvolutionLayer1x3Dataset(),
796  framework::dataset::make("DataType", { DataType::F16 })),
797  ActivationFunctionsSmallDataset),
799 {
800  // Validate output
801  validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_convolution_f16);
802 }
803 
805  combine(combine(combine(datasets::LargeWinogradConvolutionLayer1x3Dataset(),
806  framework::dataset::make("DataType", { DataType::F16 })),
807  ActivationFunctionsDataset),
809 {
810  // Validate output
811  validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16);
812 }
813 TEST_SUITE_END() // Conv1x3
814 
815 TEST_SUITE(Conv5x5)
817  combine(combine(combine(datasets::SmallWinogradConvolutionLayer5x5Dataset(),
818  framework::dataset::make("DataType", { DataType::F16 })),
819  ActivationFunctionsSmallDataset),
821 
822 {
823  // Validate output
824  validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_convolution_f16);
825 }
826 
828  combine(combine(combine(datasets::LargeWinogradConvolutionLayer5x5Dataset(),
829  framework::dataset::make("DataType", { DataType::F16 })),
830  ActivationFunctionsDataset),
832 
833 {
834  // Validate output
835  validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16);
836 }
837 TEST_SUITE_END() // Conv5x5
838 
839 TEST_SUITE(Conv5x1)
841  combine(combine(combine(datasets::SmallWinogradConvolutionLayer5x1Dataset(),
842  framework::dataset::make("DataType", { DataType::F16 })),
843  ActivationFunctionsSmallDataset),
845 
846 {
847  // Validate output
848  validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_convolution_f16);
849 }
850 
852  combine(combine(combine(datasets::LargeWinogradConvolutionLayer5x1Dataset(),
853  framework::dataset::make("DataType", { DataType::F16 })),
854  ActivationFunctionsDataset),
856 
857 {
858  // Validate output
859  validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16);
860 }
861 TEST_SUITE_END() // Conv5x1
862 
863 TEST_SUITE(Conv1x5)
865  combine(combine(combine(datasets::SmallWinogradConvolutionLayer1x5Dataset(),
866  framework::dataset::make("DataType", { DataType::F16 })),
867  ActivationFunctionsSmallDataset),
869 
870 {
871  // Validate output
872  validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_convolution_f16);
873 }
874 
876  combine(combine(combine(datasets::LargeWinogradConvolutionLayer1x5Dataset(),
877  framework::dataset::make("DataType", { DataType::F16 })),
878  ActivationFunctionsDataset),
880 
881 {
882  // Validate output
883  validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16);
884 }
885 TEST_SUITE_END() // Conv1x5
886 
887 TEST_SUITE_END() // FP16
888 
889 TEST_SUITE_END() // ConvolutionLayer
890 TEST_SUITE_END() // Winograd
891 TEST_SUITE_END() // CL
892 } // namespace validation
893 } // namespace test
894 } // namespace arm_compute
WinogradFilterTransformValidationFixture< CLTensor, CLAccessor, CLWinogradFilterTransform, float > CLWinogradFilterTransformFixtureFP32
Definition: Winograd.cpp:336
Shape of a tensor.
Definition: TensorShape.h:39
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const WinogradInfo &winograd_info)
Static function to check if given info will lead to a valid configuration of CLWinogradFilterTransfor...
static Status validate(const ITensorInfo *input, const ITensorInfo *bias, const ITensorInfo *output, const WinogradInfo &winograd_info, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of CLWinogradOutputTransfor...
Winograd information.
Definition: Types.h:2043
half_float::half half
16-bit floating point type
Definition: Types.h:44
1 channel, 1 F32 per channel
ARM_COMPUTE_EXPECT(has_error==expected, framework::LogLevel::ERRORS)
WinogradConvolutionLayerFastMathValidationFixture< CLTensor, CLAccessor, CLWinogradConvolutionLayer, float > CLWinogradConvolutionLayerFastMathFixture
Definition: Winograd.cpp:605
As above but this also setups a Zero border on the input tensor of the specified bordersize.
Definition: Helper.h:82
std::enable_if< is_container< T >::value, ContainerDataset< T > >::type make(std::string name, T &&values)
Helper function to create a ContainerDataset.
Activation Layer Information class.
Definition: Types.h:1517
Copyright (c) 2017-2018 ARM Limited.
1 channel, 1 F16 per channel
WinogradInputTransformValidationFixture< CLTensor, CLAccessor, CLWinogradInputTransform, float > CLWinogradInputTransformFixtureFP32
Definition: Winograd.cpp:229
WinogradFilterTransformValidationFixture< CLTensor, CLAccessor, CLWinogradFilterTransform, half > CLWinogradFilterTransformFixtureFP16
Definition: Winograd.cpp:337
WinogradOutputTransformValidationFixture< CLTensor, CLAccessor, CLWinogradOutputTransform, float > CLWinogradOutputTransformFixtureFP32
Definition: Winograd.cpp:475
DatasetMode
Possible dataset modes.
Definition: DatasetModes.h:40
WinogradOutputTransformValidationFixture< CLTensor, CLAccessor, CLWinogradOutputTransform, half > CLWinogradOutputTransformFixtureFP16
Definition: Winograd.cpp:476
quantized, asymmetric fixed-point 8-bit number
Accessor implementation for CLTensor objects.
Definition: CLAccessor.h:35
Padding and stride information class.
Definition: Types.h:676
static Status validate(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *output, const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info=ActivationLayerInfo(), bool enable_fast_math=false)
Static function to check if given info will lead to a valid configuration of CLWinogradConvolutionLay...
Num samples, channels, height, width.
FIXTURE_DATA_TEST_CASE(RunSmall, CLAbsLayerFixture< half >, framework::DatasetMode::PRECOMMIT, combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F16)))
Definition: AbsLayer.cpp:50
validate(dst.info() ->valid_region(), valid_region)
Class for specifying the size of an image or rectangle.
Definition: Size2D.h:34
Num samples, height, width, channels.
WinogradInputTransformValidationFixture< CLTensor, CLAccessor, CLWinogradInputTransform, half > CLWinogradInputTransformFixtureFP16
Definition: Winograd.cpp:230
TEST_SUITE_END() FIXTURE_DATA_TEST_CASE(RunSmall
Input data sets.
Definition: Unstack.cpp:96
Store the tensor's metadata.
Definition: TensorInfo.h:45
JoinDataset< T, U > concat(T &&dataset1, U &&dataset2)
Helper function to create a JoinDataset.
Definition: JoinDataset.h:160
Basic function to execute Winograd-based convolution on OpenCL.
zip(zip(framework::dataset::make("Weights", { TensorInfo(TensorShape(32U, 13U, 2U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U, 2U), 1, DataType::F32), TensorInfo(TensorShape(32U, 13U, 2U, 1U), 1, DataType::F32), }), framework::dataset::make("MVBGInfo",{ TensorInfo(TensorShape(2U), 1, DataType::F32), TensorInfo(TensorShape(2U), 1, DataType::F16), TensorInfo(TensorShape(5U), 1, DataType::F32), })), framework::dataset::make("Expected", { true, false, false}))
DataType
Available data types.
Definition: Types.h:74
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const WinogradInfo &winograd_info)
Static function to check if given info will lead to a valid configuration of CLWinogradInputTransform...
DataLayout
[DataLayout enum definition]
Definition: Types.h:114
combine(datasets::SmallShapes(), framework::dataset::make("DataType", DataType::F32)))
Definition: AbsLayer.cpp:65
TEST_SUITE(U8_to_S8) DATA_TEST_CASE(Configuration
DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::SmallShapes(), AbsoluteDifferenceU8Dataset), shape, data_type0, data_type1, output_data_type)
Basic implementation of the OpenCL tensor interface.
Definition: CLTensor.h:40