[neurun] Move operand IObject to backend (#2293)
author이한종/동작제어Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Tue, 14 Aug 2018 07:40:26 +0000 (16:40 +0900)
committer박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Tue, 14 Aug 2018 07:40:26 +0000 (16:40 +0900)
Move `internal::Object` to `neurun::backend::operand::Object`.

Part of #2286

Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
runtimes/neurun/src/backend/IObject.h [moved from runtimes/neurun/src/internal/IObject.h with 50% similarity]
runtimes/neurun/src/backend/acl_cl/operand/Object.h
runtimes/neurun/src/backend/cpu/operand/Object.h
runtimes/neurun/src/internal/Plan.cc
runtimes/neurun/src/internal/Plan.h
runtimes/neurun/src/internal/common/Tensor.h
runtimes/neurun/src/internal/common/common.h

similarity index 50%
rename from runtimes/neurun/src/internal/IObject.h
rename to runtimes/neurun/src/backend/IObject.h
index 1ea6615..73034f9 100644 (file)
@@ -1,11 +1,15 @@
-#ifndef __INTERNAL_IOBJECT_H__
-#define __INTERNAL_IOBJECT_H__
+#ifndef __NEURUN_BACKEND_OPERAND_I_OBJECT_H__
+#define __NEURUN_BACKEND_OPERAND_I_OBJECT_H__
 
 #include <functional>
 
 #include <arm_compute/core/ITensor.h>
 
-namespace internal
+namespace neurun
+{
+namespace backend
+{
+namespace operand
 {
 
 struct IObject
@@ -15,6 +19,8 @@ struct IObject
   virtual void access(const std::function<void(::arm_compute::ITensor &tensor)> &fn) const = 0;
 };
 
-} // namespace internal
+} // namespace operand
+} // namespace backend
+} // namespace neurun
 
-#endif // __INTERNAL_IOBJECT_H__
+#endif // __NEURUN_BACKEND_OPERAND_I_OBJECT_H__
index 2184ff7..c4c78a2 100644 (file)
@@ -4,7 +4,7 @@
 #include <memory>
 #include <arm_compute/core/CL/ICLTensor.h>
 
-#include "internal/IObject.h"
+#include "backend/IObject.h"
 
 namespace neurun
 {
@@ -15,7 +15,7 @@ namespace acl_cl
 namespace operand
 {
 
-class Object : public ::internal::IObject
+class Object : public backend::operand::IObject
 {
 public:
   Object() = default;
index 4f8ebfb..9b4f260 100644 (file)
@@ -4,7 +4,7 @@
 #include <memory>
 #include <arm_compute/core/ITensor.h>
 
-#include "internal/IObject.h"
+#include "backend/IObject.h"
 
 namespace neurun
 {
@@ -15,7 +15,7 @@ namespace cpu
 namespace operand
 {
 
-class Object : public ::internal::IObject
+class Object : public backend::operand::IObject
 {
 public:
   Object() = default;
index e79b28c..af772b6 100644 (file)
@@ -6,7 +6,7 @@ namespace operand
 {
 
 Context &Context::set(const ::internal::tflite::operand::Index &id,
-                      const std::shared_ptr<::internal::IObject> &object)
+                      const std::shared_ptr<neurun::backend::operand::IObject> &object)
 {
   _objects[id.asInt()].emplace_back(object);
   return (*this);
index a950db5..2c2bf77 100644 (file)
@@ -2,7 +2,7 @@
 #define __INTERNAL_PLAN_H__
 
 #include "graph/Graph.h"
-#include "internal/IObject.h"
+#include "backend/IObject.h"
 
 #include <map>
 
@@ -15,7 +15,7 @@ class Context
 {
 public:
   Context &set(const ::internal::tflite::operand::Index &ind,
-               const std::shared_ptr<::internal::IObject> &object);
+               const std::shared_ptr<neurun::backend::operand::IObject> &object);
 
 public:
   bool exist(const ::internal::tflite::operand::Index &ind) const
@@ -24,19 +24,20 @@ public:
   }
 
 public:
-  const std::vector<std::shared_ptr<IObject>> &
+  const std::vector<std::shared_ptr<neurun::backend::operand::IObject>> &
   at(const ::internal::tflite::operand::Index &ind) const
   {
     return _objects.at(ind.asInt());
   }
 
-  std::vector<std::shared_ptr<IObject>> &at(const ::internal::tflite::operand::Index &ind)
+  std::vector<std::shared_ptr<neurun::backend::operand::IObject>> &
+  at(const ::internal::tflite::operand::Index &ind)
   {
     return _objects.at(ind.asInt());
   }
 
 private:
-  std::map<int, std::vector<std::shared_ptr<IObject>>> _objects;
+  std::map<int, std::vector<std::shared_ptr<neurun::backend::operand::IObject>>> _objects;
 };
 
 } // namespace operand
index f27cdc7..27d2002 100644 (file)
@@ -4,7 +4,7 @@
 #include <arm_compute/core/ITensor.h>
 #include <arm_compute/core/TensorInfo.h>
 
-#include "internal/IObject.h"
+#include "backend/IObject.h"
 
 namespace internal
 {
index 9651ac1..69be54c 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef __INTERNAL_COMMON_H__
 #define __INTERNAL_COMMON_H__
 
-#include "internal/IObject.h"
+#include "backend/IObject.h"
 #include "Tensor.h"
 
 namespace internal
@@ -9,7 +9,7 @@ namespace internal
 namespace common
 {
 
-class Object : public ::internal::IObject
+class Object : public neurun::backend::operand::IObject
 {
 public:
   Object() = default;