aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/ReferenceCPP.cpp
diff options
context:
space:
mode:
authorIsabella Gottardi <isabella.gottardi@arm.com>2017-06-23 15:02:11 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:16:08 +0100
commitb797fa235f714440ffa7a2ad4eef7ae14ee45da4 (patch)
treeefdefae2963d612c1bb1f84b8b74823c64804702 /tests/validation/ReferenceCPP.cpp
parentac4e873dad6aa6291fc36aff62047a896db04f6a (diff)
downloadComputeLibrary-b797fa235f714440ffa7a2ad4eef7ae14ee45da4.tar.gz
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 <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Steven Niu <steven.niu@arm.com>
Diffstat (limited to 'tests/validation/ReferenceCPP.cpp')
-rw-r--r--tests/validation/ReferenceCPP.cpp15
1 files changed, 14 insertions, 1 deletions
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 <typename T>
+void ReferenceCPP::table_lookup(const RawTensor &src, RawTensor &dst, std::map<T, T> &lut)
+{
+ const TensorVariant s = TensorFactory::get_tensor(src);
+ TensorVariant d = TensorFactory::get_tensor(dst);
+ boost::apply_visitor(tensor_visitors::table_lookup<T>(s, lut), d);
+}
+#ifndef DOXYGEN_SKIP_THIS
+template void arm_compute::test::validation::ReferenceCPP::table_lookup<uint8_t>(const RawTensor &src, RawTensor &dst, std::map<uint8_t, uint8_t> &lut);
+template void arm_compute::test::validation::ReferenceCPP::table_lookup<int16_t>(const RawTensor &src, RawTensor &dst, std::map<int16_t, int16_t> &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<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()));
- 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