blob: f0478b88e5cb8607eb59e71c5d3760865a4e8ea0 [file] [log] [blame]
John Richardson7d082312018-05-21 15:19:41 +01001/*
2 * Copyright (c) 2018 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 */
24#include "arm_compute/core/Types.h"
25#include "arm_compute/runtime/CL/CLTensor.h"
26#include "arm_compute/runtime/CL/functions/CLSobel3x3.h"
27#include "arm_compute/runtime/CL/functions/CLSobel5x5.h"
28#include "arm_compute/runtime/CL/functions/CLSobel7x7.h"
29#include "tests/CL/CLAccessor.h"
30#include "tests/benchmark/fixtures/SobelFixture.h"
31#include "tests/datasets/BorderModeDataset.h"
32#include "tests/datasets/GradientDimensionDataset.h"
33#include "tests/datasets/ShapeDatasets.h"
34#include "tests/framework/Macros.h"
35#include "tests/framework/datasets/Datasets.h"
36#include "utils/TypePrinter.h"
37
38namespace arm_compute
39{
40namespace test
41{
42namespace benchmark
43{
44using CLSobel3x3Fixture = SobelFixture<CLTensor, CLSobel3x3, CLAccessor>;
45
46TEST_SUITE(CL)
47TEST_SUITE(Sobel)
48
49// *INDENT-OFF*
50// clang-format off
51TEST_SUITE(W3x3)
52REGISTER_FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel3x3Fixture, framework::DatasetMode::PRECOMMIT,
53 combine(combine(combine(
54 datasets::Small2DShapes(),
55 datasets::BorderModes()),
56 datasets::GradientDimensions()),
57 framework::dataset::make("Format", Format::U8)));
58
59REGISTER_FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel3x3Fixture, framework::DatasetMode::NIGHTLY,
60 combine(combine(combine(
61 datasets::Large2DShapes(),
62 datasets::BorderModes()),
63 datasets::GradientDimensions()),
64 framework::dataset::make("Format", Format::U8)));
65TEST_SUITE_END() // W3x3
66
67using CLSobel5x5Fixture = SobelFixture<CLTensor, CLSobel5x5, CLAccessor>;
68
69TEST_SUITE(W5x5)
70REGISTER_FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel5x5Fixture, framework::DatasetMode::PRECOMMIT,
71 combine(combine(combine(
72 datasets::Small2DShapes(),
73 datasets::BorderModes()),
74 datasets::GradientDimensions()),
75 framework::dataset::make("Format", Format::U8)));
76
77REGISTER_FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel5x5Fixture, framework::DatasetMode::NIGHTLY,
78 combine(combine(combine(
79 datasets::Large2DShapes(),
80 datasets::BorderModes()),
81 datasets::GradientDimensions()),
82 framework::dataset::make("Format", Format::U8)));
83TEST_SUITE_END() // W5x5
84
85using CLSobel7x7Fixture = SobelFixture<CLTensor, CLSobel7x7, CLAccessor>;
86
87TEST_SUITE(W7x7)
88REGISTER_FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel7x7Fixture, framework::DatasetMode::PRECOMMIT,
89 combine(combine(combine(
90 datasets::Small2DShapes(),
91 datasets::BorderModes()),
92 datasets::GradientDimensions()),
93 framework::dataset::make("Format", Format::U8)));
94
95REGISTER_FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel7x7Fixture, framework::DatasetMode::NIGHTLY,
96 combine(combine(combine(
97 datasets::Large2DShapes(),
98 datasets::BorderModes()),
99 datasets::GradientDimensions()),
100 framework::dataset::make("Format", Format::U8)));
101TEST_SUITE_END() // W7x7
102// clang-format on
103// *INDENT-ON*
104
105TEST_SUITE_END() // Sobel
106TEST_SUITE_END() // CL
107} // namespace benchmark
108} // namespace test
109} // namespace arm_compute