diff options
Diffstat (limited to 'runtimes/pure_arm_compute/src/internal/nnapi/matrix/Reader.h')
-rw-r--r-- | runtimes/pure_arm_compute/src/internal/nnapi/matrix/Reader.h | 36 |
1 files changed, 30 insertions, 6 deletions
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 <typename T> class Reader final : public nnfw::util::matrix::Reader<T> +/** + * @brief Class to support reading element in matrix + */ +template <typename T> class Reader final : public nnfw::misc::matrix::Reader<T> { 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; |