diff options
Diffstat (limited to 'tests/NEON/Helper.h')
-rw-r--r-- | tests/NEON/Helper.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/NEON/Helper.h b/tests/NEON/Helper.h index 5b0f750fca..9e60a48ecd 100644 --- a/tests/NEON/Helper.h +++ b/tests/NEON/Helper.h @@ -25,8 +25,10 @@ #define __ARM_COMPUTE_TEST_NEON_HELPER_H__ #include "arm_compute/runtime/Array.h" +#include "tests/Globals.h" #include <algorithm> +#include <array> #include <vector> namespace arm_compute @@ -44,6 +46,20 @@ Array<T> create_array(const std::vector<T> &v) return array; } + +template <typename D, typename T, typename... Ts> +void fill_tensors(D &&dist, std::initializer_list<int> seeds, T &&tensor, Ts &&... other_tensors) +{ + const std::array < T, 1 + sizeof...(Ts) > tensors{ { std::forward<T>(tensor), std::forward<Ts>(other_tensors)... } }; + std::vector<int> vs(seeds); + ARM_COMPUTE_ERROR_ON(vs.size() != tensors.size()); + int k = 0; + for(auto tp : tensors) + { + library->fill(Accessor(*tp), std::forward<D>(dist), vs[k++]); + } +} + } // namespace test } // namespace arm_compute #endif /* __ARM_COMPUTE_TEST_NEON_HELPER_H__ */ |