summaryrefslogtreecommitdiff
path: root/runtimes/pure_arm_compute/src/internal/FeatureSink.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtimes/pure_arm_compute/src/internal/FeatureSink.h')
-rw-r--r--runtimes/pure_arm_compute/src/internal/FeatureSink.h36
1 files changed, 28 insertions, 8 deletions
diff --git a/runtimes/pure_arm_compute/src/internal/FeatureSink.h b/runtimes/pure_arm_compute/src/internal/FeatureSink.h
index 9e4412c2a..7c6884141 100644
--- a/runtimes/pure_arm_compute/src/internal/FeatureSink.h
+++ b/runtimes/pure_arm_compute/src/internal/FeatureSink.h
@@ -14,6 +14,12 @@
* limitations under the License.
*/
+/**
+ * @file        FeatureSink.h
+ * @brief       This file contains FeatureSink class
+ * @ingroup     COM_AI_RUNTIME
+ */
+
#ifndef __INTERNAL_FEATURE_SINK_H__
#define __INTERNAL_FEATURE_SINK_H__
@@ -21,22 +27,36 @@
#include "internal/nnapi/feature/View.h"
#include "internal/arm_compute/feature/View.h"
-#include <util/feature/Shape.h>
-#include "util/feature/IndexIterator.h"
+#include <misc/feature/Shape.h>
+#include "misc/feature/IndexIterator.h"
-//
-// FeatureSink
-//
+/**
+ * @brief Class to store Feature(4D) output data.
+ * This is for pulling data to internal tensor from other tensor.
+ * @tparam T Type of the data elements
+ */
template <typename T> class FeatureSink final : public Sink
{
public:
- FeatureSink(const nnfw::util::feature::Shape &shape, T *base, const size_t size)
+ /**
+ * @brief Construct a FeatureSink object
+ *
+ * @param[in] shape 4D tensor dimensions for this feature
+ * @param[in] base Base pointer of the actual data
+ * @param[in] size Size of the data
+ */
+ FeatureSink(const nnfw::misc::feature::Shape &shape, T *base, const size_t size)
: _shape{shape}, _base{base}, _size{size}
{
// DO NOTHING
}
public:
+ /**
+ * @brief Pull the data into the internal structure
+ * @param[in] tensor The tensor which contains source data
+ * @return N/A
+ */
void pull(::arm_compute::ITensor &tensor) const override
{
const ::internal::arm_compute::feature::View<T> from{&tensor};
@@ -44,7 +64,7 @@ public:
// Inevitably casting must be done.
::internal::nnapi::feature::View<T> into{_shape, _base, _size};
- ::nnfw::util::feature::iterate(_shape)
+ ::nnfw::misc::feature::iterate(_shape)
<< [&](uint32_t batch, uint32_t ch, uint32_t row, uint32_t col) {
const auto value = from.at(batch, ch, row, col);
into.at(batch, ch, row, col) = value;
@@ -52,7 +72,7 @@ public:
}
private:
- const nnfw::util::feature::Shape _shape;
+ const nnfw::misc::feature::Shape _shape;
T *const _base;
const size_t _size;
};