From 3eb263e95898c933cde5450a919a161ac6b2359b Mon Sep 17 00:00:00 2001 From: SiCong Li Date: Mon, 19 Jun 2017 15:31:43 +0100 Subject: COMPMID-424 Add validation tests for Gaussian5x5 * Fix apply_2d_spatial_filter to use double as intermediate type * Fix tensor_elem_at to use random value if on border and border_mode is UNDEFINED Change-Id: I7feea23c4664cc63c5bab936566dc92b98c723b9 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/78905 Tested-by: Kaizen Reviewed-by: Moritz Pflanzer --- tests/validation/ReferenceCPP.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/validation/ReferenceCPP.cpp') diff --git a/tests/validation/ReferenceCPP.cpp b/tests/validation/ReferenceCPP.cpp index 06606c7075..6264695253 100644 --- a/tests/validation/ReferenceCPP.cpp +++ b/tests/validation/ReferenceCPP.cpp @@ -204,6 +204,15 @@ void ReferenceCPP::gaussian3x3(const RawTensor &src, RawTensor &dst, BorderMode tensor_operations::gaussian3x3(s, d, border_mode, constant_border_value); } +// Gaussian5x5 filter +void ReferenceCPP::gaussian5x5(const RawTensor &src, RawTensor &dst, BorderMode border_mode, uint8_t constant_border_value) +{ + ARM_COMPUTE_ERROR_ON(src.data_type() != DataType::U8 || dst.data_type() != DataType::U8); + const Tensor s(src.shape(), src.data_type(), src.fixed_point_position(), reinterpret_cast(src.data())); + Tensor d(dst.shape(), dst.data_type(), dst.fixed_point_position(), reinterpret_cast(dst.data())); + tensor_operations::gaussian5x5(s, d, border_mode, constant_border_value); +} + // GEMM void ReferenceCPP::gemm(const RawTensor &src1, const RawTensor &src2, const RawTensor &src3, RawTensor &dst, float alpha, float beta) -- cgit v1.2.1