From 50f9fd73536fd359137702ac9c42c9a1c61ff415 Mon Sep 17 00:00:00 2001 From: Giorgio Arena Date: Mon, 19 Jun 2017 17:05:30 +0100 Subject: COMPMID-378 NEON/CL Sobel 3x3 and 5x5 tests. Change-Id: Ic90edd77c7f694f95663d8163623db3837a48616 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/78284 Tested-by: Kaizen Reviewed-by: Moritz Pflanzer --- tests/validation/Reference.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'tests/validation/Reference.cpp') diff --git a/tests/validation/Reference.cpp b/tests/validation/Reference.cpp index 5f49caead0..be3f28b052 100644 --- a/tests/validation/Reference.cpp +++ b/tests/validation/Reference.cpp @@ -39,6 +39,36 @@ namespace test { namespace validation { +std::pair Reference::compute_reference_sobel_3x3(const TensorShape &shape, BorderMode border_mode, uint8_t constant_border_value) +{ + // Create reference + RawTensor ref_src = library->get(shape, Format::U8); + RawTensor ref_dst_x = library->get(shape, Format::S16); + RawTensor ref_dst_y = library->get(shape, Format::S16); + + // Fill reference + library->fill_tensor_uniform(ref_src, 0); + + // Compute reference + ReferenceCPP::sobel_3x3(ref_src, ref_dst_x, ref_dst_y, border_mode, constant_border_value); + + return std::make_pair(ref_dst_x, ref_dst_y); +} +std::pair Reference::compute_reference_sobel_5x5(const TensorShape &shape, BorderMode border_mode, uint8_t constant_border_value) +{ + // Create reference + RawTensor ref_src = library->get(shape, Format::U8); + RawTensor ref_dst_x = library->get(shape, Format::S16); + RawTensor ref_dst_y = library->get(shape, Format::S16); + + // Fill reference + library->fill_tensor_uniform(ref_src, 0); + + // Compute reference + ReferenceCPP::sobel_5x5(ref_src, ref_dst_x, ref_dst_y, border_mode, constant_border_value); + + return std::make_pair(ref_dst_x, ref_dst_y); +} std::pair Reference::compute_reference_mean_and_standard_deviation(const TensorShape &shape) { // Create reference -- cgit v1.2.1