summaryrefslogtreecommitdiff
path: root/runtimes/pure_arm_compute/src/internal/nnapi/kernel/Reader.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtimes/pure_arm_compute/src/internal/nnapi/kernel/Reader.h')
-rw-r--r--runtimes/pure_arm_compute/src/internal/nnapi/kernel/Reader.h38
1 files changed, 32 insertions, 6 deletions
diff --git a/runtimes/pure_arm_compute/src/internal/nnapi/kernel/Reader.h b/runtimes/pure_arm_compute/src/internal/nnapi/kernel/Reader.h
index 0853a8c89..ae964f74c 100644
--- a/runtimes/pure_arm_compute/src/internal/nnapi/kernel/Reader.h
+++ b/runtimes/pure_arm_compute/src/internal/nnapi/kernel/Reader.h
@@ -14,11 +14,16 @@
* limitations under the License.
*/
+/**
+ * @file Reader.h
+ * @ingroup COM_AI_RUNTIME
+ * @brief This file defines internal::nnapi::kernel::Reader class
+ */
#ifndef __INTERNAL_NNAPI_KERNEL_READER_H__
#define __INTERNAL_NNAPI_KERNEL_READER_H__
-#include "util/kernel/Shape.h"
-#include "util/kernel/Reader.h"
+#include "misc/kernel/Shape.h"
+#include "misc/kernel/Reader.h"
namespace internal
{
@@ -27,20 +32,41 @@ namespace nnapi
namespace kernel
{
-template <typename T> class Reader final : public nnfw::util::kernel::Reader<T>
+/**
+ * @brief Class to support reading element in kernel
+ */
+template <typename T> class Reader final : public nnfw::misc::kernel::Reader<T>
{
public:
+ /**
+ * @brief Construct a new Reader object
+ * @param[in] shape Shape of kernel
+ * @param[in] ptr Pointer to kernel data
+ * @param[in] len Size of kernel (byte)
+ */
// NOTE The parameter len denotes the number of bytes.
- Reader(const ::nnfw::util::kernel::Shape &shape, const T *ptr, size_t len)
+ Reader(const ::nnfw::misc::kernel::Shape &shape, const T *ptr, size_t len)
: _shape{shape}, _ptr{ptr}
{
assert(shape.N * shape.C * shape.H * shape.W * sizeof(T) == len);
}
public:
- const nnfw::util::kernel::Shape &shape(void) const { return _shape; }
+ /**
+ * @brief Get shape of kernel
+ * @return Shape of kernel
+ */
+ const nnfw::misc::kernel::Shape &shape(void) const { return _shape; }
public:
+ /**
+ * @brief Get value of element for kernel
+ * @param[in] nth Kernel index
+ * @param[in] ch Channel index
+ * @param[in] row Row index
+ * @param[in] col Column index
+ * @return Value of element
+ */
T at(uint32_t nth, uint32_t ch, uint32_t row, uint32_t col) const override
{
// NNAPI uses NHWC ordering
@@ -55,7 +81,7 @@ public:
}
private:
- nnfw::util::kernel::Shape _shape;
+ nnfw::misc::kernel::Shape _shape;
private:
const T *_ptr;