[Pure CL] Extract 'VectorSink' class (#1671)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Fri, 15 Jun 2018 00:22:47 +0000 (09:22 +0900)
committer서상민/동작제어Lab(SR)/Staff Engineer/삼성전자 <sangmin7.seo@samsung.com>
Fri, 15 Jun 2018 00:22:47 +0000 (09:22 +0900)
This commit extracts 'VectorSink' class into a separate file.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
runtimes/pure_arm_compute/src/execution.cc
runtimes/pure_arm_compute/src/internal/VectorSink.h [new file with mode: 0644]

index 194464a..d5cbb4c 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "internal/arm_compute/feature/View.h"
 #include "internal/Sinks.h"
+#include "internal/VectorSink.h"
 #include "internal/MatrixSink.h"
 #include "internal/Tensor3DSink.h"
 
 #include <cassert>
 
 //
-// VectorSink
-//
-template <typename T> class VectorSink final : public Sink
-{
-public:
-  VectorSink(const int32_t vlen, T *base, const size_t size) : _vlen{vlen}, _base{base}
-  {
-    assert(size >= _vlen * sizeof(T));
-  }
-
-public:
-  void pull(::arm_compute::ITensor &tensor) const override
-  {
-    for (int32_t n = 0; n < _vlen; ++n)
-    {
-      auto from = reinterpret_cast<T *>(tensor.ptr_to_element(::arm_compute::Coordinates{n}));
-      auto into = _base + n;
-
-      *into = *from;
-    }
-  }
-
-private:
-  const int32_t _vlen;
-  T *const _base;
-};
-
-//
 // FeatureSink
 //
 template <typename T> class FeatureSink final : public Sink
diff --git a/runtimes/pure_arm_compute/src/internal/VectorSink.h b/runtimes/pure_arm_compute/src/internal/VectorSink.h
new file mode 100644 (file)
index 0000000..ba7dee4
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef __INTERNAL_VECTOR_SINK_H__
+#define __INTERNAL_VECTOR_SINK_H__
+
+#include "internal/Sink.h"
+
+#include <arm_compute/core/ITensor.h>
+
+#include <cassert>
+
+//
+// VectorSink
+//
+template <typename T> class VectorSink final : public Sink
+{
+public:
+  VectorSink(const int32_t vlen, T *base, const size_t size) : _vlen{vlen}, _base{base}
+  {
+    assert(size >= _vlen * sizeof(T));
+  }
+
+public:
+  void pull(::arm_compute::ITensor &tensor) const override
+  {
+    for (int32_t n = 0; n < _vlen; ++n)
+    {
+      auto from = reinterpret_cast<T *>(tensor.ptr_to_element(::arm_compute::Coordinates{n}));
+      auto into = _base + n;
+
+      *into = *from;
+    }
+  }
+
+private:
+  const int32_t _vlen;
+  T *const _base;
+};
+
+#endif // __INTERNAL_VECTOR_SINK_H__