aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/CL/Box3x3.cpp
diff options
context:
space:
mode:
authorSiCong Li <sicong.li@arm.com>2017-06-28 15:27:02 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:15:39 +0100
commit7a0357549a0ffa0ea3ea56fa791a15a35368afe8 (patch)
tree8f9c9d87f8199d69068ff769cc2136f7407363eb /tests/validation/CL/Box3x3.cpp
parent4e288696a2ca8e1c9d6d37d90d237c1a18d6e364 (diff)
downloadComputeLibrary-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/CL/Box3x3.cpp')
-rw-r--r--tests/validation/CL/Box3x3.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/validation/CL/Box3x3.cpp b/tests/validation/CL/Box3x3.cpp
index fa604533d7..9c3db9f2fe 100644
--- a/tests/validation/CL/Box3x3.cpp
+++ b/tests/validation/CL/Box3x3.cpp
@@ -51,6 +51,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 CL box3x3 filter.
*
* @param[in] shape Shape of the input and output tensors.
@@ -106,7 +109,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);
@@ -140,7 +143,7 @@ BOOST_DATA_TEST_CASE(RunSmall, SmallShapes() * BorderModes(), shape, border_mode
RawTensor ref_dst = Reference::compute_reference_box3x3(shape, border_mode, border_value);
// Validate output
- validate(CLAccessor(dst), ref_dst, shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, BorderSize(1)));
+ validate(CLAccessor(dst), ref_dst, shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, border_size));
}
BOOST_TEST_DECORATOR(*boost::unit_test::label("nightly"))
@@ -157,7 +160,7 @@ BOOST_DATA_TEST_CASE(RunLarge, LargeShapes() * BorderModes(), shape, border_mode
RawTensor ref_dst = Reference::compute_reference_box3x3(shape, border_mode, border_value);
// Validate output
- validate(CLAccessor(dst), ref_dst, shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, BorderSize(1)));
+ validate(CLAccessor(dst), ref_dst, shape_to_valid_region(shape, border_mode == BorderMode::UNDEFINED, border_size));
}
BOOST_AUTO_TEST_SUITE_END()