diff options
Diffstat (limited to 'tests/benchmark')
-rw-r--r-- | tests/benchmark/CMakeLists.txt | 23 | ||||
-rw-r--r-- | tests/benchmark/GLES_COMPUTE/Scale.cpp | 58 | ||||
-rw-r--r-- | tests/benchmark/NEON/Scale.cpp | 4 | ||||
-rw-r--r-- | tests/benchmark/fixtures/ScaleFixture.h | 3 | ||||
-rw-r--r-- | tests/benchmark/fixtures/ScaleLayerFixture.h | 9 |
5 files changed, 30 insertions, 67 deletions
diff --git a/tests/benchmark/CMakeLists.txt b/tests/benchmark/CMakeLists.txt new file mode 100644 index 0000000000..a3a352681e --- /dev/null +++ b/tests/benchmark/CMakeLists.txt @@ -0,0 +1,23 @@ +# Copyright (c) 2023 Arm Limited. +# +# SPDX-License-Identifier: MIT +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +target_sources(arm_compute_benchmark PRIVATE NEON/Scale.cpp) diff --git a/tests/benchmark/GLES_COMPUTE/Scale.cpp b/tests/benchmark/GLES_COMPUTE/Scale.cpp deleted file mode 100644 index b3b2735a93..0000000000 --- a/tests/benchmark/GLES_COMPUTE/Scale.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#include "arm_compute/core/TensorShape.h" -#include "arm_compute/core/Types.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCTensor.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCTensorAllocator.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCScale.h" -#include "tests/GLES_COMPUTE/GCAccessor.h" -#include "tests/benchmark/fixtures/ScaleLayerFixture.h" -#include "tests/datasets/ScaleLayerDataset.h" -#include "tests/framework/Macros.h" -#include "tests/framework/datasets/Datasets.h" -#include "utils/TypePrinter.h" - -namespace arm_compute -{ -namespace test -{ -namespace benchmark -{ -namespace -{ -const auto data_types = framework::dataset::make("DataType", { DataType::F16 }); -} // namespace - -template <typename T> -using GCScaleLayerFixture = ScaleLayerFixture<GCTensor, GCScale, GCAccessor, T>; - -TEST_SUITE(GC) - -REGISTER_FIXTURE_DATA_TEST_CASE(SmallScaleLayer, GCScaleLayerFixture<half>, framework::DatasetMode::ALL, - framework::dataset::combine(datasets::SmallScaleLayerShapes(), data_types)); - -TEST_SUITE_END() -} // namespace benchmark -} // namespace test -} // namespace arm_compute diff --git a/tests/benchmark/NEON/Scale.cpp b/tests/benchmark/NEON/Scale.cpp index 7da1b892f7..85a9e68fee 100644 --- a/tests/benchmark/NEON/Scale.cpp +++ b/tests/benchmark/NEON/Scale.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -55,7 +55,7 @@ REGISTER_FIXTURE_DATA_TEST_CASE(RunSmall, NEScaleFixture, framework::DatasetMode datasets::BorderModes()), framework::dataset::make("SamplingPolicy", { SamplingPolicy::CENTER }))); TEST_SUITE_END() // Scale -TEST_SUITE_END() // NEON +TEST_SUITE_END() // Neon } // namespace benchmark } // namespace test } // namespace arm_compute diff --git a/tests/benchmark/fixtures/ScaleFixture.h b/tests/benchmark/fixtures/ScaleFixture.h index 953872ea64..81f34bd538 100644 --- a/tests/benchmark/fixtures/ScaleFixture.h +++ b/tests/benchmark/fixtures/ScaleFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2020, 2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -40,7 +40,6 @@ template <typename TensorType, typename Function, typename Accessor> class ScaleFixture : public framework::Fixture { public: - template <typename...> void setup(TensorShape shape, DataType data_type, DataLayout data_layout, InterpolationPolicy policy, BorderMode border_mode, SamplingPolicy sampling_policy) { constexpr float max_width = 8192.0f; diff --git a/tests/benchmark/fixtures/ScaleLayerFixture.h b/tests/benchmark/fixtures/ScaleLayerFixture.h index f69b918f4a..59cc12c77d 100644 --- a/tests/benchmark/fixtures/ScaleLayerFixture.h +++ b/tests/benchmark/fixtures/ScaleLayerFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021, 2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -35,12 +35,11 @@ namespace arm_compute { namespace test { -/** Fixture that can be used for NEON, CL and OpenGL ES */ +/** Fixture that can be used for Neon, CL and OpenGL ES */ template <typename TensorType, typename Function, typename Accessor, typename T> class ScaleLayerFixture : public framework::Fixture { public: - template <typename...> void setup(TensorShape shape, InterpolationPolicy policy, BorderMode border_mode, SamplingPolicy sampling_policy, float sx, float sy, DataType data_type) { constexpr float max_width = 8192.0f; @@ -63,8 +62,8 @@ public: scale_layer.configure(&src, &dst, ScaleKernelInfo{ policy, border_mode, constant_border_value, sampling_policy }); - ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); - ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); + ARM_COMPUTE_ASSERT(src.info()->is_resizable()); + ARM_COMPUTE_ASSERT(dst.info()->is_resizable()); // Allocate tensors src.allocator()->allocate(); |