aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/core/Window.inl
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2018-01-17 09:40:27 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:43:42 +0000
commit5237e01c342b9301951a799842e9c48813b66fd4 (patch)
tree257e9f92e0599c0de68668ce568a3a4f37c1f0b6 /arm_compute/core/Window.inl
parent652bde553f506caac4c563988dc9baf746f9584d (diff)
downloadComputeLibrary-5237e01c342b9301951a799842e9c48813b66fd4.tar.gz
COMPMID-838 Implement CLPermute
Change-Id: I6d97b649f1ebc289c9e6f8949e67740a6b3cbcb2 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/116636 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Pablo Tello <pablo.tello@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'arm_compute/core/Window.inl')
-rw-r--r--arm_compute/core/Window.inl16
1 files changed, 16 insertions, 0 deletions
diff --git a/arm_compute/core/Window.inl b/arm_compute/core/Window.inl
index e46a0ec8f7..1b21820f90 100644
--- a/arm_compute/core/Window.inl
+++ b/arm_compute/core/Window.inl
@@ -72,6 +72,22 @@ inline Window Window::collapse_if_possible(const Window &full_window, size_t fir
return collapsed;
}
+inline Window Window::collapse(const Window &full_window, size_t first) const
+{
+ Window collapsed = collapse_if_possible(full_window, first);
+ // Make sure that the window has collapsed
+ int end = _dims[first].end();
+ int start = 0;
+ ARM_COMPUTE_UNUSED(start);
+ for(size_t d = first + 1; d < Coordinates::num_max_dimensions; ++d)
+ {
+ start = end * _dims[d].start();
+ end *= _dims[d].end();
+ }
+ ARM_COMPUTE_ERROR_ON((collapsed[first].end() != end) || (collapsed[first].start() != start));
+ return collapsed;
+}
+
inline void Window::shift(size_t dimension, int shift_value)
{
ARM_COMPUTE_ERROR_ON(dimension >= Coordinates::num_max_dimensions);