aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/ReferenceCPP.cpp
diff options
context:
space:
mode:
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