blob: 90c657f8e43d2e35bb8e0a270268a5236aa77fab [file] [log] [blame]
Alex Gilday64856912018-01-05 10:10:28 +00001/*
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/CLArray.h"
26#include "arm_compute/runtime/CL/CLTensor.h"
27#include "arm_compute/runtime/CL/CLTensorAllocator.h"
28#include "arm_compute/runtime/CL/functions/CLHarrisCorners.h"
29#include "tests/CL/CLAccessor.h"
30#include "tests/benchmark/fixtures/HarrisCornersFixture.h"
31#include "tests/datasets/ShapeDatasets.h"
32#include "tests/framework/Macros.h"
33#include "tests/framework/datasets/Datasets.h"
34#include "utils/TypePrinter.h"
35
36namespace arm_compute
37{
38namespace test
39{
40namespace benchmark
41{
42namespace
43{
44const auto threshold = framework::dataset::make("Threshold", { 0.00115f });
45const auto min_dist = framework::dataset::make("MinDist", { 2.f });
46const auto sensitivity = framework::dataset::make("Sensitivity", { 0.04f });
47const auto gradient_size = framework::dataset::make("GradientSize", { 3, 5, 7 });
48const auto block_size = framework::dataset::make("BlockSize", { 3, 5, 7 });
49const auto border_mode = framework::dataset::make("BorderMode", { BorderMode::UNDEFINED, BorderMode::CONSTANT, BorderMode::REPLICATE });
50} // namespace
51
52using CLHarrisCornersFixture = HarrisCornersFixture<CLTensor, CLHarrisCorners, CLAccessor, CLKeyPointArray>;
53
54TEST_SUITE(CL)
55TEST_SUITE(HarrisCorners)
56
57REGISTER_FIXTURE_DATA_TEST_CASE(RunSmall, CLHarrisCornersFixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(combine(combine(datasets::SmallImageShapes(),
58 framework::dataset::make("Format", { Format::S16 })),
59 threshold),
60 min_dist),
61 sensitivity),
62 gradient_size),
63 block_size),
64 border_mode),
65 framework::dataset::make("UseFP16", { false })));
66
67REGISTER_FIXTURE_DATA_TEST_CASE(RunLarge, CLHarrisCornersFixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(combine(combine(datasets::LargeImageShapes(),
68 framework::dataset::make("Format", { Format::S16 })),
69 threshold),
70 min_dist),
71 sensitivity),
72 gradient_size),
73 block_size),
74 border_mode),
75 framework::dataset::make("UseFP16", { false })));
76
77TEST_SUITE_END() // HarrisCorners
78TEST_SUITE_END() // CL
79} // namespace benchmark
80} // namespace test
81} // namespace arm_compute