diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-08-30 16:02:11 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:54:54 +0000 |
commit | 09d3451b4caf8d5e0e7cf2c6097e50a1f815d027 (patch) | |
tree | 8e9b8e9882d0120c85ff08473dbf3721b7602677 /tests/validation/fixtures | |
parent | b57be0da77370e5e71fe82dfa281f528279e8127 (diff) | |
download | ComputeLibrary-09d3451b4caf8d5e0e7cf2c6097e50a1f815d027.tar.gz |
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 <bsgcomp@arm.com>
Reviewed-by: Michele DiGiorgio <michele.digiorgio@arm.com>
Diffstat (limited to 'tests/validation/fixtures')
-rw-r--r-- | tests/validation/fixtures/CannyEdgeFixture.h | 23 | ||||
-rw-r--r-- | tests/validation/fixtures/HarrisCornersFixture.h | 25 |
2 files changed, 9 insertions, 39 deletions
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 <typename...> - 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 <typename F, typename std::enable_if<std::is_same<F, NECannyEdge>::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 <typename F, typename std::enable_if<std::is_same<F, CLCannyEdge>::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<FunctionType>(canny_edge, src, dst, gradient_size, static_cast<int>(norm_type) + 1, border_mode, use_fp16, params); + canny_edge.configure(&src, &dst, params.upper_thresh, params.lower_thresh, gradient_size, static_cast<int>(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 <typename...> - 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 <typename F, typename std::enable_if<std::is_same<F, NEHarrisCorners>::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 <typename F, typename std::enable_if<std::is_same<F, CLHarrisCorners>::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<FunctionType>(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); |