aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/ReferenceCPP.cpp
diff options
context:
space:
mode:
authorGiorgio Arena <giorgio.arena@arm.com>2017-06-19 17:05:30 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:14:20 +0100
commit50f9fd73536fd359137702ac9c42c9a1c61ff415 (patch)
tree3b41b943be044d3f01fe624a419649f87c2e1738 /tests/validation/ReferenceCPP.cpp
parentbee466b5eac4ec39d4032d946c9a4aee051f2b31 (diff)
downloadComputeLibrary-50f9fd73536fd359137702ac9c42c9a1c61ff415.tar.gz
COMPMID-378 NEON/CL Sobel 3x3 and 5x5 tests.
Change-Id: Ic90edd77c7f694f95663d8163623db3837a48616 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/78284 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Moritz Pflanzer <moritz.pflanzer@arm.com>
Diffstat (limited to 'tests/validation/ReferenceCPP.cpp')
-rw-r--r--tests/validation/ReferenceCPP.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/validation/ReferenceCPP.cpp b/tests/validation/ReferenceCPP.cpp
index 5c429ea864..ca6bb6cec4 100644
--- a/tests/validation/ReferenceCPP.cpp
+++ b/tests/validation/ReferenceCPP.cpp
@@ -48,6 +48,26 @@ namespace test
{
namespace validation
{
+// Sobel 3x3
+void ReferenceCPP::sobel_3x3(RawTensor &src, RawTensor &dst_x, RawTensor &dst_y, BorderMode border_mode, uint8_t constant_border_value)
+{
+ ARM_COMPUTE_ERROR_ON(src.data_type() != DataType::U8 || dst_x.data_type() != DataType::S16 || dst_y.data_type() != DataType::S16);
+ Tensor<uint8_t> s(src.shape(), src.data_type(), src.fixed_point_position(), reinterpret_cast<const uint8_t *>(src.data()));
+ Tensor<int16_t> dx(dst_x.shape(), dst_x.data_type(), dst_x.fixed_point_position(), reinterpret_cast<int16_t *>(dst_x.data()));
+ Tensor<int16_t> dy(dst_y.shape(), dst_y.data_type(), dst_y.fixed_point_position(), reinterpret_cast<int16_t *>(dst_y.data()));
+ tensor_operations::sobel_3x3(s, dx, dy, border_mode, constant_border_value);
+}
+
+// Sobel 5x5
+void ReferenceCPP::sobel_5x5(RawTensor &src, RawTensor &dst_x, RawTensor &dst_y, BorderMode border_mode, uint8_t constant_border_value)
+{
+ ARM_COMPUTE_ERROR_ON(src.data_type() != DataType::U8 || dst_x.data_type() != DataType::S16 || dst_y.data_type() != DataType::S16);
+ Tensor<uint8_t> s(src.shape(), src.data_type(), src.fixed_point_position(), reinterpret_cast<const uint8_t *>(src.data()));
+ Tensor<int16_t> dx(dst_x.shape(), dst_x.data_type(), dst_x.fixed_point_position(), reinterpret_cast<int16_t *>(dst_x.data()));
+ Tensor<int16_t> dy(dst_y.shape(), dst_y.data_type(), dst_y.fixed_point_position(), reinterpret_cast<int16_t *>(dst_y.data()));
+ tensor_operations::sobel_5x5(s, dx, dy, border_mode, constant_border_value);
+}
+
// Absolute difference
void ReferenceCPP::absolute_difference(const RawTensor &src1, const RawTensor &src2, RawTensor &dst)
{