diff options
author | SiCong Li <sicong.li@arm.com> | 2017-06-28 15:27:02 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-09-17 14:15:39 +0100 |
commit | 7a0357549a0ffa0ea3ea56fa791a15a35368afe8 (patch) | |
tree | 8f9c9d87f8199d69068ff769cc2136f7407363eb /tests/validation/NEON/Gaussian3x3.cpp | |
parent | 4e288696a2ca8e1c9d6d37d90d237c1a18d6e364 (diff) | |
download | ComputeLibrary-7a0357549a0ffa0ea3ea56fa791a15a35368afe8.tar.gz |
COMPMID-424 Clean up validation tests for 2D spatial filter functions
* Remove shape_to_valid_region_undefined_border
* Remove hardcoded border size
Change-Id: I3c64148d8f7ce7e960f21d88d3af43bb23501683
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/79106
Reviewed-by: Moritz Pflanzer <moritz.pflanzer@arm.com>
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'tests/validation/NEON/Gaussian3x3.cpp')
-rw-r--r-- | tests/validation/NEON/Gaussian3x3.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/validation/NEON/Gaussian3x3.cpp b/tests/validation/NEON/Gaussian3x3.cpp index f33b63f919..b69df9ac24 100644 --- a/tests/validation/NEON/Gaussian3x3.cpp +++ b/tests/validation/NEON/Gaussian3x3.cpp @@ -52,6 +52,9 @@ using namespace arm_compute::test::validation; namespace { +constexpr unsigned int filter_size = 3; /** Size of the kernel/filter in number of elements. */ +constexpr BorderSize border_size(filter_size / 2); /** Border size of the kernel/filter around its central element. */ + /** Compute Neon gaussian3x3 filter. * * @param[in] shape Shape of the input and output tensors. @@ -107,7 +110,7 @@ BOOST_DATA_TEST_CASE(Configuration, (SmallShapes() + LargeShapes()) * BorderMode // Validate valid region const ValidRegion src_valid_region = shape_to_valid_region(shape); - const ValidRegion dst_valid_region = shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, BorderSize(1)); + const ValidRegion dst_valid_region = shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, border_size); validate(src.info()->valid_region(), src_valid_region); validate(dst.info()->valid_region(), dst_valid_region); @@ -141,7 +144,7 @@ BOOST_DATA_TEST_CASE(RunSmall, SmallShapes() * BorderModes(), shape, border_mode RawTensor ref_dst = Reference::compute_reference_gaussian3x3(shape, border_mode, border_value); // Validate output - validate(NEAccessor(dst), ref_dst, shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, BorderSize(1))); + validate(NEAccessor(dst), ref_dst, shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, border_size)); } BOOST_TEST_DECORATOR(*boost::unit_test::label("nightly")) @@ -158,7 +161,7 @@ BOOST_DATA_TEST_CASE(RunLarge, LargeShapes() * BorderModes(), shape, border_mode RawTensor ref_dst = Reference::compute_reference_gaussian3x3(shape, border_mode, border_value); // Validate output - validate(NEAccessor(dst), ref_dst, shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, BorderSize(1))); + validate(NEAccessor(dst), ref_dst, shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, border_size)); } BOOST_AUTO_TEST_SUITE_END() |