Move SubTensorInfo into compiler (#3666)
author오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Wed, 21 Nov 2018 09:32:25 +0000 (18:32 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 21 Nov 2018 09:32:25 +0000 (18:32 +0900)
Move SubTensorInfo.h into compiler and fix namespace
Remove acl dependency header from SubTensorInfo.h

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
runtimes/neurun/src/backend/acl_cl/TensorBuilder.cc
runtimes/neurun/src/backend/acl_cl/TensorBuilder.h
runtimes/neurun/src/backend/cpu/TensorBuilder.cc
runtimes/neurun/src/backend/cpu/TensorBuilder.h
runtimes/neurun/src/backend/interface/ITensorBuilder.h
runtimes/neurun/src/compiler/SubTensorInfo.h [moved from runtimes/neurun/src/backend/common/operand/SubTensorInfo.h with 87% similarity]
runtimes/neurun/src/linear/Linear.cc

index dc5a64a..828006d 100644 (file)
@@ -45,7 +45,7 @@ void TensorBuilder::registerTensorInfo(const graph::operand::Index &ind,
 }
 
 void TensorBuilder::registerSubTensorInfo(const graph::operand::Index &ind,
-                                          const backend::operand::SubTensorInfo &info)
+                                          const compiler::SubTensorInfo &info)
 {
   assert(_tensors.size() == 0);
 
index e7ae3b3..fd55c17 100644 (file)
@@ -49,7 +49,7 @@ public:
    * @param[in] info  Tensor information
    */
   virtual void registerSubTensorInfo(const graph::operand::Index &ind,
-                                     const backend::operand::SubTensorInfo &info) override;
+                                     const compiler::SubTensorInfo &info) override;
 
   virtual void notifyFirstUse(const graph::operand::Index &) override;
   virtual void notifyLastUse(const graph::operand::Index &) override;
@@ -74,7 +74,7 @@ public:
 
 private:
   std::unordered_map<graph::operand::Index, ::arm_compute::TensorInfo> _tensor_info_map;
-  std::unordered_map<graph::operand::Index, backend::operand::SubTensorInfo> _subtensor_info_map;
+  std::unordered_map<graph::operand::Index, compiler::SubTensorInfo> _subtensor_info_map;
   std::unordered_map<graph::operand::Index, std::shared_ptr<::arm_compute::CLTensor>> _tensors;
   std::unordered_map<graph::operand::Index, std::shared_ptr<::arm_compute::CLSubTensor>>
       _subtensors;
index b0a9a77..c0d6565 100644 (file)
@@ -40,7 +40,7 @@ void TensorBuilder::registerTensorInfo(const graph::operand::Index &ind,
 }
 
 void TensorBuilder::registerSubTensorInfo(const graph::operand::Index &,
-                                          const backend::operand::SubTensorInfo &)
+                                          const compiler::SubTensorInfo &)
 {
   // Not supported yet
   assert(false);
index 2825581..67508ee 100644 (file)
@@ -49,7 +49,7 @@ public:
    * @param[in] info  Tensor information
    */
   virtual void registerSubTensorInfo(const graph::operand::Index &ind,
-                                     const backend::operand::SubTensorInfo &info) override;
+                                     const compiler::SubTensorInfo &info) override;
 
   virtual void notifyFirstUse(const graph::operand::Index &) override;
   virtual void notifyLastUse(const graph::operand::Index &) override;
index d195994..1086818 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "graph/operand/Index.h"
 #include "operand/IObject.h"
-#include "backend/common/operand/SubTensorInfo.h"
+#include "compiler/SubTensorInfo.h"
 
 namespace neurun
 {
@@ -45,7 +45,7 @@ struct ITensorBuilder
    * @brief     Register subtensor information to allocate on backend
    */
   virtual void registerSubTensorInfo(const graph::operand::Index &,
-                                     const backend::operand::SubTensorInfo &) = 0;
+                                     const compiler::SubTensorInfo &) = 0;
 
   virtual void notifyFirstUse(const graph::operand::Index &) = 0;
   virtual void notifyLastUse(const graph::operand::Index &) = 0;
  * @brief This file contains SubTensorInfo to represent subsumption between tensors
  *        for backend tensor allocation
  */
-#ifndef __NEURUN_BACKEND_OPERAND_SUBTENSOR_INFO_H__
-#define __NEURUN_BACKEND_OPERAND_SUBTENSOR_INFO_H__
-
-#include <arm_compute/core/Coordinates.h>
-#include <arm_compute/core/TensorShape.h>
+#ifndef __NEURUN_COMPILER_SUBTENSOR_INFO_H__
+#define __NEURUN_COMPILER_SUBTENSOR_INFO_H__
 
 #include "graph/operand/Object.h"
 
 namespace neurun
 {
-namespace backend
-{
-namespace operand
+namespace compiler
 {
 
 /**
@@ -81,8 +76,8 @@ private:
   const graph::operand::TypeInfo _type;
   const graph::operand::ParentInfo::Coordinate4D _offset;
 };
-} // operand
-} // backend
+
+} // compiler
 } // neurun
 
-#endif // __NEURUN_BACKEND_OPERAND_SUBTENSOR_INFO_H__
+#endif // __NEURUN_COMPILER_SUBTENSOR_INFO_H__
index f1cbfe6..e6de540 100644 (file)
@@ -24,7 +24,7 @@
 #include "backend/interface/IStageGenerator.h"
 #include "internal/Convert.h"
 #include "backend/interface/IConfig.h"
-#include "backend/common/operand/SubTensorInfo.h"
+#include "compiler/SubTensorInfo.h"
 
 #include "logging.h"
 
@@ -105,7 +105,7 @@ backend::TensorBuilderSet Linear::planTensors()
 
           if (isSubTensor)
           {
-            const backend::operand::SubTensorInfo info(obj);
+            const compiler::SubTensorInfo info(obj);
             tensor_builder->registerSubTensorInfo(ind, info);
           }
           else