diff options
author | Sanghoon Lee <sanghoon.lee@arm.com> | 2017-09-14 12:11:03 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | a7a5b7b2ee6adcfe86339a402f287c4d0d368659 (patch) | |
tree | e8d27d92b4ce6ebb7bb7af3ff27f236a24ba1924 /tests/validation/Helpers.h | |
parent | f670a0a1d9bb5d4f17e8f9c8a37af2850247b2ce (diff) | |
download | ComputeLibrary-a7a5b7b2ee6adcfe86339a402f287c4d0d368659.tar.gz |
COMPMID-508: Port TableLookup to new validation
Change-Id: I9e1a683afd64c351252617ba52131ca1ee829933
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/87698
Reviewed-by: Moritz Pflanzer <moritz.pflanzer@arm.com>
Reviewed-by: Pablo Tello <pablo.tello@arm.com>
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Diffstat (limited to 'tests/validation/Helpers.h')
-rw-r--r-- | tests/validation/Helpers.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/validation/Helpers.h b/tests/validation/Helpers.h index 7043f1ebdc..85002eb599 100644 --- a/tests/validation/Helpers.h +++ b/tests/validation/Helpers.h @@ -185,6 +185,23 @@ inline void fill_mask_from_pattern(uint8_t *mask, int cols, int rows, MatrixPatt * @return The shape of output concatenated tensor. */ TensorShape calculate_depth_concatenate_shape(const std::vector<TensorShape> &input_shapes); + +/** Helper function to fill the Lut random by a ILutAccessor. + * + * @param[in,out] table Accessor at the Lut. + * + */ +template <typename T> +void fill_lookuptable(T &&table) +{ + std::mt19937 generator(library->seed()); + std::uniform_int_distribution<typename T::value_type> distribution(std::numeric_limits<typename T::value_type>::min(), std::numeric_limits<typename T::value_type>::max()); + + for(int i = std::numeric_limits<typename T::value_type>::min(); i <= std::numeric_limits<typename T::value_type>::max(); i++) + { + table[i] = distribution(generator); + } +} } // namespace validation } // namespace test } // namespace arm_compute |