aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/ReferenceCPP.cpp
diff options
context:
space:
mode:
authorIsabella Gottardi <isabella.gottardi@arm.com>2017-06-22 11:05:41 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:15:05 +0100
commit3b77e9df5d2d33bda0500235d3f258f3197037de (patch)
treef99c3fa58483b9992eae4cdd9f2978c2f278404b /tests/validation/ReferenceCPP.cpp
parent3eb263e95898c933cde5450a919a161ac6b2359b (diff)
downloadComputeLibrary-3b77e9df5d2d33bda0500235d3f258f3197037de.tar.gz
COMPMID-378 - Implemented reference implementation and tests (NEON and CL) for Non Linear Filter
Change-Id: I1b81e030a27cf01d098247a87d047099616e2a39 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/78531 Reviewed-by: Moritz Pflanzer <moritz.pflanzer@arm.com> Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Diffstat (limited to 'tests/validation/ReferenceCPP.cpp')
-rw-r--r--tests/validation/ReferenceCPP.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/validation/ReferenceCPP.cpp b/tests/validation/ReferenceCPP.cpp
index 6264695253..7c50f508a0 100644
--- a/tests/validation/ReferenceCPP.cpp
+++ b/tests/validation/ReferenceCPP.cpp
@@ -224,6 +224,15 @@ void ReferenceCPP::gemm(const RawTensor &src1, const RawTensor &src2, const RawT
boost::apply_visitor(tensor_visitors::gemm_visitor(s1, s2, s3, alpha, beta), d);
}
+// Non linear filter
+void ReferenceCPP::non_linear_filter(const RawTensor &src, RawTensor &dst, NonLinearFilterFunction function, unsigned int mask_size,
+ MatrixPattern pattern, const uint8_t *mask, BorderMode border_mode, uint8_t constant_border_value)
+{
+ ARM_COMPUTE_ERROR_ON(src.data_type() != DataType::U8 || dst.data_type() != DataType::U8);
+ const Tensor<uint8_t> s(src.shape(), src.data_type(), src.fixed_point_position(), reinterpret_cast<const uint8_t *>(src.data()));
+ Tensor<uint8_t> d(dst.shape(), dst.data_type(), dst.fixed_point_position(), reinterpret_cast<uint8_t *>(dst.data()));
+ tensor_operations::non_linear_filter(s, d, function, mask_size, pattern, mask, border_mode, constant_border_value);
+}
// Pixel-wise multiplication
void ReferenceCPP::pixel_wise_multiplication(const RawTensor &src1, const RawTensor &src2, RawTensor &dst, float scale, ConvertPolicy convert_policy, RoundingPolicy rounding_policy)