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/validation/fixtures/CannyEdgeFixture.h | 23 ++++------------------ tests/validation/fixtures/HarrisCornersFixture.h | 25 +++++------------------- 2 files changed, 9 insertions(+), 39 deletions(-) (limited to 'tests/validation/fixtures') diff --git a/tests/validation/fixtures/CannyEdgeFixture.h b/tests/validation/fixtures/CannyEdgeFixture.h index 0f37c46641..d52b17e550 100644 --- a/tests/validation/fixtures/CannyEdgeFixture.h +++ b/tests/validation/fixtures/CannyEdgeFixture.h @@ -47,12 +47,11 @@ class CannyEdgeValidationFixture : public framework::Fixture { public: template - 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) { CannyEdgeParameters params = canny_edge_parameters(); - _target = compute_target(image, gradient_size, norm_type, border_mode, use_fp16, format, params); - //TODO(COMPMID-543): Add use_fp16 to reference + _target = compute_target(image, gradient_size, norm_type, border_mode, format, params); _reference = compute_reference(image, gradient_size, norm_type, border_mode, format, params); } @@ -63,21 +62,7 @@ protected: library->fill(tensor, raw); } - 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, const CannyEdgeParameters ¶ms) - { - func.configure(&src, &dst, params.upper_thresh, params.lower_thresh, gradient_size, norm_type, border_mode, params.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, const CannyEdgeParameters ¶ms) - { - ARM_COMPUTE_UNUSED(use_fp16); - ARM_COMPUTE_ERROR_ON(use_fp16); - func.configure(&src, &dst, params.upper_thresh, params.lower_thresh, gradient_size, norm_type, border_mode, params.constant_border_value); - } - - TensorType compute_target(const std::string &image, int gradient_size, MagnitudeType norm_type, BorderMode border_mode, bool use_fp16, Format format, const CannyEdgeParameters ¶ms) + TensorType compute_target(const std::string &image, int gradient_size, MagnitudeType norm_type, BorderMode border_mode, Format format, const CannyEdgeParameters ¶ms) { // Load the image (cached by the library if loaded before) const RawTensor &raw = library->get(image, format); @@ -90,7 +75,7 @@ protected: // Create Canny edge configure function FunctionType canny_edge; - configure_target(canny_edge, src, dst, gradient_size, static_cast(norm_type) + 1, border_mode, use_fp16, params); + canny_edge.configure(&src, &dst, params.upper_thresh, params.lower_thresh, gradient_size, static_cast(norm_type) + 1, border_mode, params.constant_border_value); ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); ARM_COMPUTE_EXPECT(dst.info()->is_resizable(), framework::LogLevel::ERRORS); diff --git a/tests/validation/fixtures/HarrisCornersFixture.h b/tests/validation/fixtures/HarrisCornersFixture.h index 1c30157344..f1d1f2d135 100644 --- a/tests/validation/fixtures/HarrisCornersFixture.h +++ b/tests/validation/fixtures/HarrisCornersFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018 ARM Limited. + * Copyright (c) 2017-2018 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -47,12 +47,11 @@ class HarrisCornersValidationFixture : public framework::Fixture { public: template - void setup(std::string image, int gradient_size, int block_size, BorderMode border_mode, bool use_fp16, Format format) + void setup(std::string image, int gradient_size, int block_size, BorderMode border_mode, Format format) { HarrisCornersParameters params = harris_corners_parameters(); - _target = compute_target(image, gradient_size, block_size, border_mode, use_fp16, format, params); - //TODO(COMPMID-543): Add use_fp16 to reference + _target = compute_target(image, gradient_size, block_size, border_mode, format, params); _reference = compute_reference(image, gradient_size, block_size, border_mode, format, params); } @@ -63,21 +62,7 @@ protected: library->fill(tensor, raw); } - template ::value, int>::type = 0> - void configure_target(F &func, TensorType &src, ArrayType &corners, int gradient_size, int block_size, BorderMode border_mode, bool use_fp16, const HarrisCornersParameters ¶ms) - { - func.configure(&src, params.threshold, params.min_dist, params.sensitivity, gradient_size, block_size, &corners, border_mode, params.constant_border_value, use_fp16); - } - - template ::value, int>::type = 0> - void configure_target(F &func, TensorType &src, ArrayType &corners, int gradient_size, int block_size, BorderMode border_mode, bool use_fp16, const HarrisCornersParameters ¶ms) - { - ARM_COMPUTE_UNUSED(use_fp16); - ARM_COMPUTE_ERROR_ON(use_fp16); - func.configure(&src, params.threshold, params.min_dist, params.sensitivity, gradient_size, block_size, &corners, border_mode, params.constant_border_value); - } - - ArrayType compute_target(std::string image, int gradient_size, int block_size, BorderMode border_mode, bool use_fp16, Format format, const HarrisCornersParameters ¶ms) + ArrayType compute_target(std::string image, int gradient_size, int block_size, BorderMode border_mode, Format format, const HarrisCornersParameters ¶ms) { // Load the image (cached by the library if loaded before) const RawTensor &raw = library->get(image, format); @@ -90,7 +75,7 @@ protected: // Create harris corners configure function FunctionType harris_corners; - configure_target(harris_corners, src, corners, gradient_size, block_size, border_mode, use_fp16, params); + harris_corners.configure(&src, params.threshold, params.min_dist, params.sensitivity, gradient_size, block_size, &corners, border_mode, params.constant_border_value); ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS); -- cgit v1.2.1