aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/reference
diff options
context:
space:
mode:
authorMohammed Suhail Munshi <MohammedSuhail.Munshi@arm.com>2022-05-12 11:00:36 +0100
committerMohmun02 <MohammedSuhail.Munshi@arm.com>2022-05-12 13:25:03 +0000
commitdc4f276b810c4746c684a81ffeeb22aa0bff2adc (patch)
treea4e6f63749cf88cee8078b8518831c260cc3a805 /tests/validation/reference
parent4e9f568f1055db8d5b6a969550787032b91854a5 (diff)
downloadComputeLibrary-dc4f276b810c4746c684a81ffeeb22aa0bff2adc.tar.gz
Revert "Add support for 2d and 3d indices for axis 0"
This reverts commit 0db8b8bbd941b3dab4238c03e734e7ac43c662ed. Relates to [COMPMID-5055] Signed-off-by: Mohammed Suhail Munshi <MohammedSuhail.Munshi@arm.com> Change-Id: I143e7965e21b956abb05ba5c41e12c5b73b7345a Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/7558 Reviewed-by: Pablo Marquez Tello <pablo.tello@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'tests/validation/reference')
-rw-r--r--tests/validation/reference/Gather.cpp41
1 files changed, 12 insertions, 29 deletions
diff --git a/tests/validation/reference/Gather.cpp b/tests/validation/reference/Gather.cpp
index 02292fb74e..c26438857f 100644
--- a/tests/validation/reference/Gather.cpp
+++ b/tests/validation/reference/Gather.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019, 2022 Arm Limited.
+ * Copyright (c) 2018-2022 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -45,39 +45,22 @@ SimpleTensor<T> gather(const SimpleTensor<T> &src, const SimpleTensor<uint32_t>
Window win;
win.use_tensor_dimensions(dst_shape);
- if(indices.shape().num_dimensions() == 1u)
+ execute_window_loop(win, [&](const Coordinates & id)
{
- execute_window_loop(win, [&](const Coordinates & id)
+ Coordinates offset;
+ for(unsigned int dim = 0; dim < id.num_dimensions(); ++dim)
{
- Coordinates offset;
- for(unsigned int dim = 0; dim < id.num_dimensions(); ++dim)
+ if(dim == actual_axis)
{
- if(dim == actual_axis)
- {
- offset.set(dim, indices_ptr[id[dim]]);
- }
- else
- {
- offset.set(dim, id[dim]);
- }
+ offset.set(dim, indices_ptr[id[dim]]);
}
- *reinterpret_cast<T *>(dst(id)) = *reinterpret_cast<const T *>(src(offset));
- });
- }
- else
- {
- if(actual_axis == 0)
- {
- win.set(Window::DimX, Window::Dimension(0, 1, 1));
- uint32_t index = 0;
- execute_window_loop(win, [&](const Coordinates & id)
+ else
{
- auto *dst_ptr = reinterpret_cast<T *>(dst(id));
- const int row_to_copy = indices[index++];
- std::copy_n(src.data() + row_to_copy * src.shape()[0], src.shape()[0], dst_ptr);
- });
+ offset.set(dim, id[dim]);
+ }
}
- }
+ *reinterpret_cast<T *>(dst(id)) = *reinterpret_cast<const T *>(src(offset));
+ });
return dst;
}
@@ -89,4 +72,4 @@ template SimpleTensor<uint8_t> gather(const SimpleTensor<uint8_t> &src, const Si
} // namespace reference
} // namespace validation
} // namespace test
-} // namespace arm_compute
+} // namespace arm_compute \ No newline at end of file