John Richardson | 7d08231 | 2018-05-21 15:19:41 +0100 | [diff] [blame] | 1 | /* |
| 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 | |
| 38 | namespace arm_compute |
| 39 | { |
| 40 | namespace test |
| 41 | { |
| 42 | namespace benchmark |
| 43 | { |
| 44 | using CLSobel3x3Fixture = SobelFixture<CLTensor, CLSobel3x3, CLAccessor>; |
| 45 | |
| 46 | TEST_SUITE(CL) |
| 47 | TEST_SUITE(Sobel) |
| 48 | |
| 49 | // *INDENT-OFF* |
| 50 | // clang-format off |
| 51 | TEST_SUITE(W3x3) |
| 52 | REGISTER_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 | |
| 59 | REGISTER_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))); |
| 65 | TEST_SUITE_END() // W3x3 |
| 66 | |
| 67 | using CLSobel5x5Fixture = SobelFixture<CLTensor, CLSobel5x5, CLAccessor>; |
| 68 | |
| 69 | TEST_SUITE(W5x5) |
| 70 | REGISTER_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 | |
| 77 | REGISTER_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))); |
| 83 | TEST_SUITE_END() // W5x5 |
| 84 | |
| 85 | using CLSobel7x7Fixture = SobelFixture<CLTensor, CLSobel7x7, CLAccessor>; |
| 86 | |
| 87 | TEST_SUITE(W7x7) |
| 88 | REGISTER_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 | |
| 95 | REGISTER_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))); |
| 101 | TEST_SUITE_END() // W7x7 |
| 102 | // clang-format on |
| 103 | // *INDENT-ON* |
| 104 | |
| 105 | TEST_SUITE_END() // Sobel |
| 106 | TEST_SUITE_END() // CL |
| 107 | } // namespace benchmark |
| 108 | } // namespace test |
| 109 | } // namespace arm_compute |