blob: 8afda38c01d48903341ee208a0677ebb752693ff [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/NEON/functions/NESobel3x3.h"
26#include "arm_compute/runtime/NEON/functions/NESobel5x5.h"
27#include "arm_compute/runtime/NEON/functions/NESobel7x7.h"
28#include "arm_compute/runtime/Tensor.h"
29#include "tests/NEON/Accessor.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 NESobel3x3Fixture = SobelFixture<Tensor, NESobel3x3, Accessor>;
45
46TEST_SUITE(NEON)
47TEST_SUITE(Sobel)
48
49// *INDENT-OFF*
50// clang-format off
51TEST_SUITE(W3x3)
52REGISTER_FIXTURE_DATA_TEST_CASE(RunSmall, NESobel3x3Fixture, 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, NESobel3x3Fixture, 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 NESobel5x5Fixture = SobelFixture<Tensor, NESobel5x5, Accessor>;
68
69TEST_SUITE(W5x5)
70REGISTER_FIXTURE_DATA_TEST_CASE(RunSmall, NESobel5x5Fixture, 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, NESobel5x5Fixture, 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 NESobel7x7Fixture = SobelFixture<Tensor, NESobel7x7, Accessor>;
86
87TEST_SUITE(W7x7)
88REGISTER_FIXTURE_DATA_TEST_CASE(RunSmall, NESobel7x7Fixture, 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, NESobel7x7Fixture, 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() // NEON
107} // namespace benchmark
108} // namespace test
109} // namespace arm_compute