blob: 29608efc131c614a414a8bb5c5c97e8c89a02df3 [file] [log] [blame]
Moritz Pflanzer7655a672017-09-23 11:57:33 +01001/*
Michalis Spyrou80943252019-01-10 17:19:50 +00002 * Copyright (c) 2017-2019 ARM Limited.
Moritz Pflanzer7655a672017-09-23 11:57:33 +01003 *
4 * SPDX-License-Identifier: MIT
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to
8 * deal in the Software without restriction, including without limitation the
9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 * sell copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in all
14 * copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24#include "arm_compute/core/Types.h"
25#include "arm_compute/runtime/CL/CLTensor.h"
26#include "arm_compute/runtime/CL/CLTensorAllocator.h"
27#include "arm_compute/runtime/CL/functions/CLSobel3x3.h"
28#include "arm_compute/runtime/CL/functions/CLSobel5x5.h"
29#include "arm_compute/runtime/CL/functions/CLSobel7x7.h"
30#include "tests/CL/CLAccessor.h"
31#include "tests/PaddingCalculator.h"
32#include "tests/datasets/BorderModeDataset.h"
33#include "tests/datasets/ShapeDatasets.h"
34#include "tests/framework/Asserts.h"
35#include "tests/framework/Macros.h"
36#include "tests/framework/datasets/Datasets.h"
37#include "tests/validation/Validation.h"
38#include "tests/validation/fixtures/SobelFixture.h"
39
40namespace arm_compute
41{
42namespace test
43{
44namespace validation
45{
46TEST_SUITE(CL)
47TEST_SUITE(Sobel)
48
49TEST_SUITE(W3x3)
50using CLSobel3x3Fixture = SobelValidationFixture<CLTensor, CLAccessor, CLSobel3x3, uint8_t, int16_t>;
51
Michalis Spyrou80943252019-01-10 17:19:50 +000052DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
Moritz Pflanzer7655a672017-09-23 11:57:33 +010053 Format::U8)),
54 shape, border_mode, format)
55{
56 // Generate a random constant value
57 std::mt19937 gen(library->seed());
58 std::uniform_int_distribution<uint8_t> int_dist(0, 255);
59 const uint8_t constant_border_value = int_dist(gen);
60
61 // Create tensors
62 CLTensor src = create_tensor<CLTensor>(shape, data_type_from_format(format));
63 CLTensor dst_x = create_tensor<CLTensor>(shape, DataType::S16);
64 CLTensor dst_y = create_tensor<CLTensor>(shape, DataType::S16);
65
66 src.info()->set_format(format);
67 dst_x.info()->set_format(Format::S16);
68 dst_y.info()->set_format(Format::S16);
69
70 ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
71 ARM_COMPUTE_EXPECT(dst_x.info()->is_resizable(), framework::LogLevel::ERRORS);
72 ARM_COMPUTE_EXPECT(dst_y.info()->is_resizable(), framework::LogLevel::ERRORS);
73
74 // Create sobel 3x3 configure function
75 CLSobel3x3 sobel;
76 sobel.configure(&src, &dst_x, &dst_y, border_mode, constant_border_value);
77
78 // Validate valid region
79 constexpr BorderSize border_size{ 1 };
80 const ValidRegion dst_valid_region = shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, border_size);
81
82 validate(dst_x.info()->valid_region(), dst_valid_region);
83 validate(dst_y.info()->valid_region(), dst_valid_region);
84
85 // Validate padding
86 PaddingCalculator calculator(shape.x(), 8);
87
88 calculator.set_border_mode(border_mode);
89 calculator.set_border_size(1);
90
91 const PaddingSize dst_padding = calculator.required_padding();
92
93 calculator.set_accessed_elements(16);
94 calculator.set_access_offset(-1);
95
96 const PaddingSize src_padding = calculator.required_padding();
97
98 validate(src.info()->padding(), src_padding);
99 validate(dst_x.info()->padding(), dst_padding);
100 validate(dst_y.info()->padding(), dst_padding);
101}
102
Isabella Gottardi43ce8982017-11-08 11:13:23 +0000103TEST_SUITE(X)
104FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel3x3Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
105 Format::U8)),
106 framework::dataset::make("GradientDimension", GradientDimension::GRAD_X)))
107{
108 // Validate output
109 ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
110 validate(CLAccessor(_target.first), _reference.first, valid_region_x);
111}
112
113FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel3x3Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
114 Format::U8)),
115 framework::dataset::make("GradientDimension", GradientDimension::GRAD_X)))
116{
117 // Validate output
118 ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
119 validate(CLAccessor(_target.first), _reference.first, valid_region_x);
120}
121TEST_SUITE_END()
122
123TEST_SUITE(Y)
124FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel3x3Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
125 Format::U8)),
126 framework::dataset::make("GradientDimension", GradientDimension::GRAD_Y)))
127{
128 // Validate output
129 ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
130 validate(CLAccessor(_target.second), _reference.second, valid_region_y);
131}
132
133FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel3x3Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
134 Format::U8)),
135 framework::dataset::make("GradientDimension", GradientDimension::GRAD_Y)))
136{
137 // Validate output
138 ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
139 validate(CLAccessor(_target.second), _reference.second, valid_region_y);
140}
141TEST_SUITE_END()
142
143TEST_SUITE(XY)
144FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel3x3Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
145 Format::U8)),
146 framework::dataset::make("GradientDimension", GradientDimension::GRAD_XY)))
Moritz Pflanzer7655a672017-09-23 11:57:33 +0100147{
148 // Validate output
149 ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
150 validate(CLAccessor(_target.first), _reference.first, valid_region_x);
151
152 ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
153 validate(CLAccessor(_target.second), _reference.second, valid_region_y);
154}
155
Isabella Gottardi43ce8982017-11-08 11:13:23 +0000156FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel3x3Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
157 Format::U8)),
158 framework::dataset::make("GradientDimension", GradientDimension::GRAD_XY)))
Moritz Pflanzer7655a672017-09-23 11:57:33 +0100159{
160 // Validate output
161 ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
162 validate(CLAccessor(_target.first), _reference.first, valid_region_x);
163
164 ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
165 validate(CLAccessor(_target.second), _reference.second, valid_region_y);
166}
167TEST_SUITE_END()
Isabella Gottardi43ce8982017-11-08 11:13:23 +0000168TEST_SUITE_END()
Moritz Pflanzer7655a672017-09-23 11:57:33 +0100169
170TEST_SUITE(W5x5)
171using CLSobel5x5Fixture = SobelValidationFixture<CLTensor, CLAccessor, CLSobel5x5, uint8_t, int16_t>;
172
Michalis Spyrou80943252019-01-10 17:19:50 +0000173DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
Moritz Pflanzer7655a672017-09-23 11:57:33 +0100174 Format::U8)),
175 shape, border_mode, format)
176{
177 // Generate a random constant value
178 std::mt19937 gen(library->seed());
179 std::uniform_int_distribution<uint8_t> int_dist(0, 255);
180 const uint8_t constant_border_value = int_dist(gen);
181
182 // Create tensors
183 CLTensor src = create_tensor<CLTensor>(shape, data_type_from_format(format));
184 CLTensor dst_x = create_tensor<CLTensor>(shape, DataType::S16);
185 CLTensor dst_y = create_tensor<CLTensor>(shape, DataType::S16);
186
187 src.info()->set_format(format);
188 dst_x.info()->set_format(Format::S16);
189 dst_y.info()->set_format(Format::S16);
190
191 ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
192 ARM_COMPUTE_EXPECT(dst_x.info()->is_resizable(), framework::LogLevel::ERRORS);
193 ARM_COMPUTE_EXPECT(dst_y.info()->is_resizable(), framework::LogLevel::ERRORS);
194
195 // Create sobel 5x5 configure function
196 CLSobel5x5 sobel;
197 sobel.configure(&src, &dst_x, &dst_y, border_mode, constant_border_value);
198
199 // Validate valid region
200 constexpr BorderSize border_size{ 2 };
201 const ValidRegion dst_valid_region = shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, border_size);
202
203 validate(dst_x.info()->valid_region(), dst_valid_region);
204 validate(dst_y.info()->valid_region(), dst_valid_region);
205
206 // Validate padding
207 PaddingCalculator calculator(shape.x(), 8);
208 calculator.set_border_mode(border_mode);
209 calculator.set_border_size(2);
210
211 const PaddingSize dst_padding = calculator.required_padding();
212
213 calculator.set_accessed_elements(16);
214 calculator.set_access_offset(-2);
215
216 const PaddingSize src_padding = calculator.required_padding();
217
218 validate(src.info()->padding(), src_padding);
219 validate(dst_x.info()->padding(), dst_padding);
220 validate(dst_y.info()->padding(), dst_padding);
221}
222
Isabella Gottardi43ce8982017-11-08 11:13:23 +0000223TEST_SUITE(X)
224FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel5x5Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
225 Format::U8)),
226 framework::dataset::make("GradientDimension", GradientDimension::GRAD_X)))
227{
228 // Validate output
229 ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
230 validate(CLAccessor(_target.first), _reference.first, valid_region_x);
231}
232
233FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel5x5Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
234 Format::U8)),
235 framework::dataset::make("GradientDimension", GradientDimension::GRAD_X)))
236{
237 // Validate output
238 ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
239 validate(CLAccessor(_target.first), _reference.first, valid_region_x);
240}
241TEST_SUITE_END()
242TEST_SUITE(Y)
243FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel5x5Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
244 Format::U8)),
245 framework::dataset::make("GradientDimension", GradientDimension::GRAD_Y)))
246{
247 // Validate output
248 ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
249 validate(CLAccessor(_target.second), _reference.second, valid_region_y);
250}
251
252FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel5x5Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
253 Format::U8)),
254 framework::dataset::make("GradientDimension", GradientDimension::GRAD_Y)))
255{
256 // Validate output
257 ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
258 validate(CLAccessor(_target.second), _reference.second, valid_region_y);
259}
260TEST_SUITE_END()
261TEST_SUITE(XY)
262FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel5x5Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
263 Format::U8)),
264 framework::dataset::make("GradientDimension", GradientDimension::GRAD_XY)))
Moritz Pflanzer7655a672017-09-23 11:57:33 +0100265{
266 // Validate output
267 ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
268 validate(CLAccessor(_target.first), _reference.first, valid_region_x);
269
270 ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
271 validate(CLAccessor(_target.second), _reference.second, valid_region_y);
272}
273
Isabella Gottardi43ce8982017-11-08 11:13:23 +0000274FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel5x5Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
275 Format::U8)),
276 framework::dataset::make("GradientDimension", GradientDimension::GRAD_XY)))
Moritz Pflanzer7655a672017-09-23 11:57:33 +0100277{
278 // Validate output
279 ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
280 validate(CLAccessor(_target.first), _reference.first, valid_region_x);
281
282 ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
283 validate(CLAccessor(_target.second), _reference.second, valid_region_y);
284}
285TEST_SUITE_END()
Isabella Gottardi43ce8982017-11-08 11:13:23 +0000286TEST_SUITE_END()
Moritz Pflanzer7655a672017-09-23 11:57:33 +0100287
288TEST_SUITE(W7x7)
289using CLSobel7x7Fixture = SobelValidationFixture<CLTensor, CLAccessor, CLSobel7x7, uint8_t, int32_t>;
290
Michalis Spyrou80943252019-01-10 17:19:50 +0000291DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
Moritz Pflanzer7655a672017-09-23 11:57:33 +0100292 Format::U8)),
293 shape, border_mode, format)
294{
295 // Generate a random constant value
296 std::mt19937 gen(library->seed());
297 std::uniform_int_distribution<uint8_t> int_dist(0, 255);
298 const uint8_t constant_border_value = int_dist(gen);
299
300 // Create tensors
301 CLTensor src = create_tensor<CLTensor>(shape, data_type_from_format(format));
302 CLTensor dst_x = create_tensor<CLTensor>(shape, DataType::S32);
303 CLTensor dst_y = create_tensor<CLTensor>(shape, DataType::S32);
304
305 src.info()->set_format(format);
306 dst_x.info()->set_format(Format::S32);
307 dst_y.info()->set_format(Format::S32);
308
309 ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
310 ARM_COMPUTE_EXPECT(dst_x.info()->is_resizable(), framework::LogLevel::ERRORS);
311 ARM_COMPUTE_EXPECT(dst_y.info()->is_resizable(), framework::LogLevel::ERRORS);
312
313 // Create sobel 7x7 configure function
314 CLSobel7x7 sobel;
315 sobel.configure(&src, &dst_x, &dst_y, border_mode, constant_border_value);
316
317 // Validate valid region
318 constexpr BorderSize border_size{ 3 };
319 const ValidRegion dst_valid_region = shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, border_size);
320
321 validate(dst_x.info()->valid_region(), dst_valid_region);
322 validate(dst_y.info()->valid_region(), dst_valid_region);
323
324 // Validate padding
325 PaddingCalculator calculator(shape.x(), 8);
326
327 calculator.set_border_mode(border_mode);
328 calculator.set_border_size(3);
329
330 const PaddingSize dst_padding = calculator.required_padding();
331
332 calculator.set_accessed_elements(16);
333 calculator.set_access_offset(-3);
334
335 const PaddingSize src_padding = calculator.required_padding();
336
337 validate(src.info()->padding(), src_padding);
338 validate(dst_x.info()->padding(), dst_padding);
339 validate(dst_y.info()->padding(), dst_padding);
340}
Isabella Gottardi43ce8982017-11-08 11:13:23 +0000341TEST_SUITE(X)
342FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel7x7Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
343 Format::U8)),
344 framework::dataset::make("GradientDimension", GradientDimension::GRAD_X)))
345{
346 // Validate output
347 ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
348 validate(CLAccessor(_target.first), _reference.first, valid_region_x);
349}
Moritz Pflanzer7655a672017-09-23 11:57:33 +0100350
Isabella Gottardi43ce8982017-11-08 11:13:23 +0000351FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel7x7Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
352 Format::U8)),
353 framework::dataset::make("GradientDimension", GradientDimension::GRAD_X)))
354{
355 // Validate output
356 ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
357 validate(CLAccessor(_target.first), _reference.first, valid_region_x);
358}
359TEST_SUITE_END()
360TEST_SUITE(Y)
361FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel7x7Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
362 Format::U8)),
363 framework::dataset::make("GradientDimension", GradientDimension::GRAD_Y)))
364{
365 // Validate output
366 ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
367 validate(CLAccessor(_target.second), _reference.second, valid_region_y);
368}
369
370FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel7x7Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
371 Format::U8)),
372 framework::dataset::make("GradientDimension", GradientDimension::GRAD_Y)))
373{
374 // Validate output
375 ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
376 validate(CLAccessor(_target.second), _reference.second, valid_region_y);
377}
378TEST_SUITE_END()
379TEST_SUITE(XY)
380FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel7x7Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
381 Format::U8)),
382 framework::dataset::make("GradientDimension", GradientDimension::GRAD_XY)))
Moritz Pflanzer7655a672017-09-23 11:57:33 +0100383{
384 // Validate output
385 ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
386 validate(CLAccessor(_target.first), _reference.first, valid_region_x);
387
388 ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
389 validate(CLAccessor(_target.second), _reference.second, valid_region_y);
390}
391
Isabella Gottardi43ce8982017-11-08 11:13:23 +0000392FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel7x7Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
393 Format::U8)),
394 framework::dataset::make("GradientDimension", GradientDimension::GRAD_XY)))
Moritz Pflanzer7655a672017-09-23 11:57:33 +0100395{
396 // Validate output
397 ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
398 validate(CLAccessor(_target.first), _reference.first, valid_region_x);
399
400 ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
401 validate(CLAccessor(_target.second), _reference.second, valid_region_y);
402}
403TEST_SUITE_END()
Isabella Gottardi43ce8982017-11-08 11:13:23 +0000404TEST_SUITE_END()
Moritz Pflanzer7655a672017-09-23 11:57:33 +0100405
406TEST_SUITE_END()
407TEST_SUITE_END()
408} // namespace validation
409} // namespace test
410} // namespace arm_compute