From bd11b24234d7d43dfe05a81c520aa01ffad06e42 Mon Sep 17 00:00:00 2001 From: Chunseok Lee Date: Tue, 8 Jan 2019 17:36:34 +0900 Subject: Imported Upstream version 0.3 --- .../src/internal/nnapi/matrix/Reader.h | 36 ++++++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'runtimes/pure_arm_compute/src/internal/nnapi/matrix') diff --git a/runtimes/pure_arm_compute/src/internal/nnapi/matrix/Reader.h b/runtimes/pure_arm_compute/src/internal/nnapi/matrix/Reader.h index f6f0f3908..f03a4be31 100644 --- a/runtimes/pure_arm_compute/src/internal/nnapi/matrix/Reader.h +++ b/runtimes/pure_arm_compute/src/internal/nnapi/matrix/Reader.h @@ -14,11 +14,16 @@ * limitations under the License. */ +/** + * @file Reader.h + * @ingroup COM_AI_RUNTIME + * @brief This file defines internal::nnapi::matrix::Reader class + */ #ifndef __INTERNAL_NNAPI_MATRIX_READER_H__ #define __INTERNAL_NNAPI_MATRIX_READER_H__ -#include "util/matrix/Shape.h" -#include "util/matrix/Reader.h" +#include "misc/matrix/Shape.h" +#include "misc/matrix/Reader.h" namespace internal { @@ -27,20 +32,39 @@ namespace nnapi namespace matrix { -template class Reader final : public nnfw::util::matrix::Reader +/** + * @brief Class to support reading element in matrix + */ +template class Reader final : public nnfw::misc::matrix::Reader { public: + /** + * @brief Construct a new Reader object + * @param[in] shape Shape of matrix + * @param[in] ptr Pointer to matrix data + * @param[in] len Size of matrix (byte) + */ // NOTE The parameter len denotes the number of bytes. - Reader(const ::nnfw::util::matrix::Shape &shape, const T *ptr, size_t len) + Reader(const ::nnfw::misc::matrix::Shape &shape, const T *ptr, size_t len) : _shape{shape}, _ptr{ptr} { assert(shape.H * shape.W * sizeof(T) == len); } public: - const nnfw::util::matrix::Shape &shape(void) const { return _shape; } + /** + * @brief Get shape of matrix + * @return Shape of matrix + */ + const nnfw::misc::matrix::Shape &shape(void) const { return _shape; } public: + /** + * @brief Get value of element for matrix + * @param[in] row Row index + * @param[in] col Column index + * @return Value of element + */ T at(uint32_t row, uint32_t col) const override { // NNAPI uses NHWC ordering @@ -53,7 +77,7 @@ public: } private: - nnfw::util::matrix::Shape _shape; + nnfw::misc::matrix::Shape _shape; private: const T *_ptr; -- cgit v1.2.3