aboutsummaryrefslogtreecommitdiff
path: root/tests/AssetsLibrary.h
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2018-02-19 19:36:02 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:47:18 +0000
commit1fbb8120aa4f5ea2e73393421611ffea803a05b4 (patch)
tree87d2d8e7cf220bbcf04b7ceecd9d826bade6acdf /tests/AssetsLibrary.h
parent562fe0fcedace39735ead089cfdc4e2b07e40aad (diff)
downloadComputeLibrary-1fbb8120aa4f5ea2e73393421611ffea803a05b4.tar.gz
Revert "COMPMID-582: Add validation to channel_extract kernels."
This reverts commit 9a0875951d43dda035f32d2e0728cf59d80cb4d3. Change-Id: I6af0bc64c656f91cf1e0357f8760defa08f2e78d Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/121190 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/AssetsLibrary.h')
-rw-r--r--tests/AssetsLibrary.h26
1 files changed, 12 insertions, 14 deletions
diff --git a/tests/AssetsLibrary.h b/tests/AssetsLibrary.h
index afdf714ff1..c9bd427845 100644
--- a/tests/AssetsLibrary.h
+++ b/tests/AssetsLibrary.h
@@ -416,24 +416,22 @@ void AssetsLibrary::fill_borders_with_garbage(T &&tensor, D &&distribution, std:
template <typename T, typename D>
void AssetsLibrary::fill(T &&tensor, D &&distribution, std::random_device::result_type seed_offset) const
{
- using ResultType = typename std::remove_reference<D>::type::result_type;
+ Window window;
+ for(unsigned int d = 0; d < tensor.shape().num_dimensions(); ++d)
+ {
+ window.set(d, Window::Dimension(0, tensor.shape()[d], 1));
+ }
std::mt19937 gen(_seed + seed_offset);
- // Iterate over all elements
- for(int element_idx = 0; element_idx < tensor.num_elements(); ++element_idx)
+ //FIXME: Replace with normal loop
+ execute_window_loop(window, [&](const Coordinates & id)
{
- const Coordinates id = index2coord(tensor.shape(), element_idx);
-
- // Iterate over all channels
- for(int channel = 0; channel < tensor.num_channels(); ++channel)
- {
- const ResultType value = distribution(gen);
- ResultType &target_value = reinterpret_cast<ResultType *const>(tensor(id))[channel];
-
- store_value_with_data_type(&target_value, value, tensor.data_type());
- }
- }
+ using ResultType = typename std::remove_reference<D>::type::result_type;
+ const ResultType value = distribution(gen);
+ void *const out_ptr = tensor(id);
+ store_value_with_data_type(out_ptr, value, tensor.data_type());
+ });
fill_borders_with_garbage(tensor, distribution, seed_offset);
}