[neurun] Move namespace of nnapi::feature classes (#2875)
author이한종/동작제어Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Tue, 2 Oct 2018 01:26:43 +0000 (10:26 +0900)
committer이춘석/동작제어Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Tue, 2 Oct 2018 01:26:43 +0000 (10:26 +0900)
Move namespace `internal::nnapi::feature` to
`neurun::util::feature::nhwc`. This will introduce the namespace
`neurun::util`.

Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
runtimes/neurun/CMakeLists.txt
runtimes/neurun/src/exec/Sink.h
runtimes/neurun/src/exec/Source.h
runtimes/neurun/src/kernel/cpu/PermuteLayer.cc
runtimes/neurun/src/kernel/cpu/PermuteLayer.h
runtimes/neurun/src/util/feature/nhwc/Reader.h [moved from runtimes/neurun/src/internal/nnapi/feature/Reader.h with 85% similarity]
runtimes/neurun/src/util/feature/nhwc/Utils.h [moved from runtimes/neurun/src/internal/nnapi/feature/Utils.h with 84% similarity]
runtimes/neurun/src/util/feature/nhwc/View.h [moved from runtimes/neurun/src/internal/nnapi/feature/View.h with 87% similarity]

index 2cbd702..7cb9112 100644 (file)
@@ -20,6 +20,7 @@ file(GLOB_RECURSE SOURCES_GRAPH "src/graph/*.cc")
 file(GLOB_RECURSE SOURCES_LINEAR "src/linear/*.cc")
 file(GLOB_RECURSE SOURCES_CODEGEN "src/codegen/*.cc")
 file(GLOB_RECURSE SOURCES_VERIFIER "src/verifier/*.cc")
+file(GLOB_RECURSE SOURCES_VERIFIER "src/util/*.cc")
 
 set(SOURCES ${SOURCES} ${SOURCES_FRONTEND} ${SOURCES_BACKEND} ${SOURCES_INTERNAL} ${SOURCES_GRAPH} ${SOURCES_LINEAR} ${SOURCES_CODEGEN} ${SOURCES_VERIFIER})
 
index eaeea66..9df83e1 100644 (file)
@@ -27,8 +27,8 @@
 #include <util/tensor/Shape.h>
 
 #include "backend/cpu/operand/Tensor.h" // TODO Remove this dependency to backend
-#include "internal/nnapi/feature/View.h"
-#include "internal/nnapi/feature/Reader.h"
+#include "util/feature/nhwc/View.h"
+#include "util/feature/nhwc/Reader.h"
 
 namespace neurun
 {
@@ -194,7 +194,7 @@ public:
     else if (typeid(tensor) == typeid(::arm_compute::CLTensor))
     {
       const ::internal::arm_compute::feature::View<T> from{&tensor};
-      ::internal::nnapi::feature::View<T> into{_shape, _base, _size};
+      util::feature::nhwc::View<T> into{_shape, _base, _size};
 
       ::nnfw::util::feature::iterate(_shape)
           << [&](uint32_t bat, uint32_t ch, uint32_t row, uint32_t col) {
index b9cffe6..a8d85d2 100644 (file)
@@ -27,8 +27,8 @@
 #include <util/tensor/Shape.h>
 
 #include "backend/cpu/operand/Tensor.h" // TODO Remove this dependency to backend
-#include "internal/nnapi/feature/Reader.h"
-#include "internal/nnapi/feature/View.h"
+#include "util/feature/nhwc/Reader.h"
+#include "util/feature/nhwc/View.h"
 
 #include "backend/acl_cl/feature/View.h"
 
@@ -191,7 +191,7 @@ public:
     }
     else if (typeid(tensor) == typeid(::arm_compute::CLTensor))
     {
-      const ::internal::nnapi::feature::Reader<T> from{_shape, _base, _size};
+      const util::feature::nhwc::Reader<T> from{_shape, _base, _size};
       ::internal::arm_compute::feature::View<T> into{&tensor};
 
       ::nnfw::util::feature::iterate(_shape)
index 5136735..f22432b 100644 (file)
@@ -16,8 +16,8 @@
 
 #include "PermuteLayer.h"
 
-#include "internal/nnapi/feature/Reader.h"
-#include "internal/nnapi/feature/View.h"
+#include "util/feature/nhwc/Reader.h"
+#include "util/feature/nhwc/View.h"
 #include "backend/acl_cl/feature/View.h"
 
 #include <util/feature/IndexIterator.h>
@@ -57,7 +57,7 @@ void PermuteLayer::run()
   {
     case Type::NHWC_TO_NCHW:
     {
-      const ::internal::nnapi::feature::Reader<float> from{
+      const util::feature::nhwc::Reader<float> from{
           feature, reinterpret_cast<const float *>(input_buffer), input_size};
       ::internal::arm_compute::feature::View<float> into{_output};
 
@@ -84,8 +84,8 @@ void PermuteLayer::run()
       _input_cl->map(queue);
 
       const ::internal::arm_compute::feature::View<float> from{_input};
-      ::internal::nnapi::feature::View<float> into{
-          feature, reinterpret_cast<float *>(output_buffer), output_size};
+      util::feature::nhwc::View<float> into{feature, reinterpret_cast<float *>(output_buffer),
+                                            output_size};
 
       ::nnfw::util::feature::iterate(feature)
           << [&](uint32_t batch, uint32_t ch, uint32_t row, uint32_t col) {
index 5960871..9a28442 100644 (file)
@@ -22,7 +22,7 @@
 #include <arm_compute/runtime/IFunction.h>
 #include <arm_compute/core/ITensor.h>
 
-#include "internal/nnapi/feature/View.h"
+#include "util/feature/nhwc/View.h"
 #include "OperationUtils.h"
 
 namespace neurun
  * limitations under the License.
  */
 
-#ifndef __INTERNAL_NNAPI_FEATURE_READER_H__
-#define __INTERNAL_NNAPI_FEATURE_READER_H__
+#ifndef __NEURUN_UTIL_FEATURE_NHWC_READER_H__
+#define __NEURUN_UTIL_FEATURE_NHWC_READER_H__
 
-#include "internal/nnapi/feature/Utils.h"
+#include "Utils.h"
 
 #include "util/feature/Reader.h"
 
-namespace internal
+namespace neurun
 {
-namespace nnapi
+namespace util
 {
 namespace feature
 {
+namespace nhwc
+{
 
 template <typename T> class Reader final : public nnfw::util::feature::Reader<T>
 {
@@ -62,8 +64,9 @@ private:
   const T *_ptr;
 };
 
+} // namespace nhwc
 } // namespace feature
-} // namespace nnapi
-} // namespace internal
+} // namespace util
+} // namespace neurun
 
-#endif // __INTERNAL_NNAPI_FEATURE_READER_H__
+#endif // __NEURUN_UTIL_FEATURE_NHWC_READER_H__
  * limitations under the License.
  */
 
-#ifndef __INTERNAL_NNAPI_FEATURE_UTILS_H__
-#define __INTERNAL_NNAPI_FEATURE_UTILS_H__
+#ifndef __NEURUN_UTIL_FEATURE_NHWC_UTILS_H__
+#define __NEURUN_UTIL_FEATURE_NHWC_UTILS_H__
 
 #include "util/feature/Shape.h"
 
-namespace internal
+namespace neurun
 {
-namespace nnapi
+namespace util
 {
 namespace feature
 {
+namespace nhwc
+{
 
 inline uint32_t index_of(const ::nnfw::util::feature::Shape &shape, uint32_t ch, uint32_t row,
                          uint32_t col)
@@ -53,8 +55,9 @@ inline uint32_t index_of(const ::nnfw::util::feature::Shape &shape, uint32_t bat
   return res;
 }
 
+} // namespace nhwc
 } // namespace feature
-} // namespace nnapi
-} // namespace internal
+} // namespace util
+} // namespace neurun
 
-#endif // __INTERNAL_NNAPI_FEATURE_UTILS_H__
+#endif // __NEURUN_UTIL_FEATURE_NHWC_UTILS_H__
  * limitations under the License.
  */
 
-#ifndef __INTERNAL_NNAPI_FEATURE_VIEW_H__
-#define __INTERNAL_NNAPI_FEATURE_VIEW_H__
+#ifndef __NEURUN_UTIL_FEATURE_NHWC_VIEW_H__
+#define __NEURUN_UTIL_FEATURE_NHWC_VIEW_H__
 
 #include <cassert>
 
-#include "internal/nnapi/feature/Utils.h"
+#include "Utils.h"
 
 #include "util/feature/Reader.h"
 
-namespace internal
+namespace neurun
 {
-namespace nnapi
+namespace util
 {
 namespace feature
 {
+namespace nhwc
+{
 
 template <typename T> class View final : public nnfw::util::feature::Reader<T>
 {
@@ -78,8 +80,9 @@ private:
   T *_ptr;
 };
 
+} // namespace nhwc
 } // namespace feature
-} // namespace nnapi
-} // namespace internal
+} // namespace util
+} // namespace neurun
 
-#endif // __INTERNAL_NNAPI_FEATURE_VIEW_H__
+#endif // __NEURUN_UTIL_FEATURE_NHWC_VIEW_H__