diff options
author | Isabella Gottardi <isabella.gottardi@arm.com> | 2017-06-23 15:02:11 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-09-17 14:16:08 +0100 |
commit | b797fa235f714440ffa7a2ad4eef7ae14ee45da4 (patch) | |
tree | efdefae2963d612c1bb1f84b8b74823c64804702 /tests/validation/TensorOperations.h | |
parent | ac4e873dad6aa6291fc36aff62047a896db04f6a (diff) | |
download | ComputeLibrary-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/TensorOperations.h')
-rw-r--r-- | tests/validation/TensorOperations.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/validation/TensorOperations.h b/tests/validation/TensorOperations.h index bf9bceff0a..e2747249b4 100644 --- a/tests/validation/TensorOperations.h +++ b/tests/validation/TensorOperations.h @@ -808,6 +808,16 @@ void fixed_point_pixel_wise_multiplication(const Tensor<T> &in1, const Tensor<T> } } +//Table Lookup +template <typename T, typename T1> +void table_lookup(const Tensor<T> &in, Tensor<T> &out, std::map<T1, T1> &lut) +{ + for(int i = 0; i < in.num_elements(); ++i) + { + out[i] = static_cast<T>(lut[in[i]]); + } +} + // Threshold template <typename T> void threshold(const Tensor<T> &in, Tensor<T> &out, uint8_t threshold, uint8_t false_value, uint8_t true_value, ThresholdType type, uint8_t upper) |