From 37d080f2f11cfd734104b76512e1fb191486216e Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Fri, 21 Jun 2019 18:43:12 +0100 Subject: COMPMID-2378: Sanitize GEMM configuration for NEON Change-Id: I7859b82b2059e14685f8792424648ac5eacd67f1 Signed-off-by: Georgios Pinitas Reviewed-on: https://review.mlplatform.org/c/1418 Comments-Addressed: Arm Jenkins Reviewed-by: Michele Di Giorgio Reviewed-by: Michalis Spyrou Tested-by: Arm Jenkins --- arm_compute/core/Dimensions.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'arm_compute/core/Dimensions.h') diff --git a/arm_compute/core/Dimensions.h b/arm_compute/core/Dimensions.h index 0a9264f6b0..9c38c60779 100644 --- a/arm_compute/core/Dimensions.h +++ b/arm_compute/core/Dimensions.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018 ARM Limited. + * Copyright (c) 2017-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -166,6 +166,27 @@ public: collapse(num_dimensions() - start, start); } + /** Remove dimension of a given index + * + * @note If index is greater than the number of dimensions no operation is performed + * + * @param[in] idx Dimension index to remove + */ + void remove(size_t idx) + { + ARM_COMPUTE_ERROR_ON(_num_dimensions < 1); + if(idx >= _num_dimensions) + { + return; + } + + std::copy(_id.begin() + idx + 1, _id.end(), _id.begin() + idx); + _num_dimensions--; + + // Make sure all empty dimensions are filled with 0 + std::fill(_id.begin() + _num_dimensions, _id.end(), 0); + } + /** Returns a read/write iterator that points to the first element in the dimension array. * * @return an iterator. -- cgit v1.2.1