From c8e84b5a3872eda6748d77dbaf8548ad99f4c0cd Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Tue, 17 Jul 2018 16:48:42 +0100 Subject: COMPMID-1405: Create our own gemm_native kernel / function. Change-Id: Ie0a80bd6b4eb5632cac63ccf54bcb07d4309da19 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/140305 Tested-by: Jenkins Reviewed-by: Giorgio Arena Reviewed-by: Georgios Pinitas --- arm_compute/core/WindowIterator.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'arm_compute/core/WindowIterator.h') diff --git a/arm_compute/core/WindowIterator.h b/arm_compute/core/WindowIterator.h index 13e9973506..13cb9cf2f4 100644 --- a/arm_compute/core/WindowIterator.h +++ b/arm_compute/core/WindowIterator.h @@ -24,6 +24,7 @@ #ifndef __ARM_COMPUTE_WINDOW_ITERATOR_H__ #define __ARM_COMPUTE_WINDOW_ITERATOR_H__ #include "arm_compute/core/Coordinates.h" +#include "arm_compute/core/Error.h" #include "arm_compute/core/ITensor.h" #include "arm_compute/core/Window.h" @@ -71,9 +72,20 @@ public: */ inline size_t stride(size_t dim) const { + ARM_COMPUTE_ERROR_ON(_strides[dim] % sizeof(T) != 0); return _strides[dim] / sizeof(T); } + /** Manually set the stride of a dimension + * + * @param[in] dim Dimension of the stride to set. + * @param[in] size Value to set the stride to (in bytes). + */ + void set_stride(size_t dim, size_t size) + { + _strides[dim] = size; + } + /** Returns a pointer to the element at coordinates (x,y,z,w) * * @param[in] x X coordinates @@ -99,8 +111,8 @@ public: } private: - uint8_t *_first; /**< Pointer to the first element of the tensor.*/ - const Strides &_strides; /**< Strides in bytes of the tensor */ + uint8_t *_first; /**< Pointer to the first element of the tensor.*/ + Strides _strides; /**< Strides in bytes of the tensor */ }; /** Iterate over a portion of a Window */ -- cgit v1.2.1