Add to initialize a member of Reader and View (#9318)
author장지섭/On-Device Lab(SR)/Engineer/삼성전자 <jiseob.jang@samsung.com>
Mon, 2 Dec 2019 05:11:57 +0000 (14:11 +0900)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 2 Dec 2019 05:11:57 +0000 (14:11 +0900)
This commit adds to initialize a member of Reader and View

Signed-off-by: jiseob.jang <jiseob.jang@samsung.com>
runtime/neurun/core/include/util/feature/nhwc/Reader.h
runtime/neurun/core/include/util/feature/nhwc/View.h

index 9f0a037..0e9e076 100644 (file)
@@ -39,7 +39,7 @@ template <typename T> class Reader final : public nnfw::misc::feature::Reader<T>
 public:
   // Construct for buffer of model inputs
   Reader(const ::nnfw::misc::feature::Shape &shape, const T *ptr, size_t len)
-      : _shape{shape}, _ptr{reinterpret_cast<const uint8_t *>(ptr)}
+      : _shape{shape}, _ptr{reinterpret_cast<const uint8_t *>(ptr)}, _len{len}
   {
     UNUSED_RELEASE(len); // Workaround for unused variable in release mode
     assert(shape.N * shape.C * shape.H * shape.W * sizeof(T) == len);
index a8f32d2..924a441 100644 (file)
@@ -40,7 +40,7 @@ template <typename T> class View final : public nnfw::misc::feature::Reader<T>
 public:
   // Construct for buffer of model inputs
   View(const ::nnfw::misc::feature::Shape &shape, T *ptr, size_t len)
-      : _shape{shape}, _ptr{reinterpret_cast<uint8_t *>(ptr)}
+      : _shape{shape}, _ptr{reinterpret_cast<uint8_t *>(ptr)}, _len{len}
   {
     UNUSED_RELEASE(len); // Workaround for unused variable in release mode
     assert(shape.N * shape.H * shape.W * shape.C * sizeof(T) == len);