From b797fa235f714440ffa7a2ad4eef7ae14ee45da4 Mon Sep 17 00:00:00 2001 From: Isabella Gottardi Date: Fri, 23 Jun 2017 15:02:11 +0100 Subject: COMPMID-424 - Implemented reference implementation and tests (NEON and CL) for TableLookup Change-Id: I53098ee750ab07fe64e9e2af8df91954d64017f5 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/79411 Tested-by: Kaizen Reviewed-by: Steven Niu --- tests/validation/ReferenceCPP.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'tests/validation/ReferenceCPP.cpp') diff --git a/tests/validation/ReferenceCPP.cpp b/tests/validation/ReferenceCPP.cpp index 105bfc4b6c..0db0352863 100644 --- a/tests/validation/ReferenceCPP.cpp +++ b/tests/validation/ReferenceCPP.cpp @@ -254,13 +254,26 @@ void ReferenceCPP::fixed_point_pixel_wise_multiplication(const RawTensor &src1, boost::apply_visitor(tensor_visitors::fixed_point_pixel_wise_multiplication_visitor(s1, s2, scale, convert_policy, rounding_policy), d); } +// Table lookup +template +void ReferenceCPP::table_lookup(const RawTensor &src, RawTensor &dst, std::map &lut) +{ + const TensorVariant s = TensorFactory::get_tensor(src); + TensorVariant d = TensorFactory::get_tensor(dst); + boost::apply_visitor(tensor_visitors::table_lookup(s, lut), d); +} +#ifndef DOXYGEN_SKIP_THIS +template void arm_compute::test::validation::ReferenceCPP::table_lookup(const RawTensor &src, RawTensor &dst, std::map &lut); +template void arm_compute::test::validation::ReferenceCPP::table_lookup(const RawTensor &src, RawTensor &dst, std::map &lut); +#endif /* DOXYGEN_SKIP_THIS */ + // Threshold void ReferenceCPP::threshold(const RawTensor &src, RawTensor &dst, uint8_t threshold, uint8_t false_value, uint8_t true_value, ThresholdType type, uint8_t upper) { 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())); - threshold_operation(s, d, threshold, false_value, true_value, type, upper); + tensor_operations::threshold(s, d, threshold, false_value, true_value, type, upper); } // Activation layer -- cgit v1.2.1