From 09d3451b4caf8d5e0e7cf2c6097e50a1f815d027 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Thu, 30 Aug 2018 16:02:11 +0100 Subject: COMPMID-1548: NEON FP16 mismatches on CannyEdge and HarrisCorners. Removes FP16 from HarrisCorners and CannyEdge. Change-Id: I5e4f9205fdbe4de85f04f55ecf1568c837e56cc0 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/146247 Tested-by: Jenkins Reviewed-by: Michele DiGiorgio --- tests/benchmark/CL/CannyEdge.cpp | 3 +-- tests/benchmark/CL/HarrisCorners.cpp | 10 +++----- tests/benchmark/NEON/CannyEdge.cpp | 3 +-- tests/benchmark/NEON/HarrisCorners.cpp | 34 +++---------------------- tests/benchmark/fixtures/CannyEdgeFixture.h | 20 ++------------- tests/benchmark/fixtures/HarrisCornersFixture.h | 5 ++-- 6 files changed, 14 insertions(+), 61 deletions(-) (limited to 'tests/benchmark') diff --git a/tests/benchmark/CL/CannyEdge.cpp b/tests/benchmark/CL/CannyEdge.cpp index 7e327f3df3..8cc918f4c8 100644 --- a/tests/benchmark/CL/CannyEdge.cpp +++ b/tests/benchmark/CL/CannyEdge.cpp @@ -42,10 +42,9 @@ namespace { // *INDENT-OFF* // clang-format off -const auto use_fp16 = framework::dataset::make("UseFP16", { false }); const auto canny_edge_dataset = combine(framework::dataset::make("GradientSize", { 3, 5, 7 }), combine(framework::dataset::make("Normalization", { MagnitudeType::L1NORM, MagnitudeType::L2NORM }), - combine(datasets::BorderModes(), use_fp16))); + datasets::BorderModes())); } // namespace using CLCannyEdgeFixture = CannyEdgeFixture; diff --git a/tests/benchmark/CL/HarrisCorners.cpp b/tests/benchmark/CL/HarrisCorners.cpp index 990ac24894..dbaf95c98d 100644 --- a/tests/benchmark/CL/HarrisCorners.cpp +++ b/tests/benchmark/CL/HarrisCorners.cpp @@ -54,25 +54,23 @@ using CLHarrisCornersFixture = HarrisCornersFixture; diff --git a/tests/benchmark/NEON/HarrisCorners.cpp b/tests/benchmark/NEON/HarrisCorners.cpp index 33315ffcd0..75a6794cc5 100644 --- a/tests/benchmark/NEON/HarrisCorners.cpp +++ b/tests/benchmark/NEON/HarrisCorners.cpp @@ -53,49 +53,23 @@ using NEHarrisCornersFixture = HarrisCornersFixture - void setup(std::string image, int gradient_size, MagnitudeType norm_type, BorderMode border_mode, bool use_fp16, Format format) + void setup(std::string image, int gradient_size, MagnitudeType norm_type, BorderMode border_mode, Format format) { // Load the image (cached by the library if loaded before) const RawTensor &raw = library->get(image, format); @@ -52,7 +52,7 @@ public: src = create_tensor(raw.shape(), format); dst = create_tensor(raw.shape(), format); - configure_target(canny_edge_func, src, dst, gradient_size, static_cast(norm_type) + 1, border_mode, use_fp16); + canny_edge_func.configure(&src, &dst, upper_thresh, lower_thresh, gradient_size, static_cast(norm_type) + 1, border_mode, constant_border_value); // Allocate tensors src.allocator()->allocate(); @@ -72,22 +72,6 @@ public: sync_tensor_if_necessary(dst); } -protected: - template ::value, int>::type = 0> - void configure_target(F &func, TensorType &src, TensorType &dst, int gradient_size, int norm_type, BorderMode border_mode, bool use_fp16) - { - func.configure(&src, &dst, upper_thresh, lower_thresh, gradient_size, norm_type, border_mode, constant_border_value, use_fp16); - } - - template ::value, int>::type = 0> - void configure_target(F &func, TensorType &src, TensorType &dst, int gradient_size, int norm_type, BorderMode border_mode, bool use_fp16) - { - ARM_COMPUTE_UNUSED(use_fp16); - ARM_COMPUTE_ERROR_ON(use_fp16); - - func.configure(&src, &dst, upper_thresh, lower_thresh, gradient_size, norm_type, border_mode, constant_border_value); - } - private: static const int32_t lower_thresh = 0; static const int32_t upper_thresh = 255; diff --git a/tests/benchmark/fixtures/HarrisCornersFixture.h b/tests/benchmark/fixtures/HarrisCornersFixture.h index c7ce683ab5..29d1741156 100644 --- a/tests/benchmark/fixtures/HarrisCornersFixture.h +++ b/tests/benchmark/fixtures/HarrisCornersFixture.h @@ -42,8 +42,7 @@ class HarrisCornersFixture : public framework::Fixture public: template void setup(std::string image, Format format, float threshold, float min_dist, float sensitivity, - int32_t gradient_size, int32_t block_size, - BorderMode border_mode, bool use_fp16) + int32_t gradient_size, int32_t block_size, BorderMode border_mode) { // Load the image (cached by the library if loaded before) const RawTensor &raw = library->get(image, format); @@ -52,7 +51,7 @@ public: src = create_tensor(raw.shape(), format); // Create and configure function - harris_corners_func.configure(&src, threshold, min_dist, sensitivity, gradient_size, block_size, &out, border_mode, 0, use_fp16); + harris_corners_func.configure(&src, threshold, min_dist, sensitivity, gradient_size, block_size, &out, border_mode, 0); // Allocate tensor src.allocator()->allocate(); -- cgit v1.2.1