[neurun] Append preVisit and postVisit to ITensorBuilder (#5879)
author김용섭/On-Device Lab(SR)/Engineer/삼성전자 <yons.kim@samsung.com>
Thu, 25 Jul 2019 08:33:03 +0000 (17:33 +0900)
committer이한종/On-Device Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Thu, 25 Jul 2019 08:33:03 +0000 (17:33 +0900)
Append preVisit and postVisit to ITensorBuilder for #5642

Signed-off-by: Yongseop Kim <yons.kim@samsung.com>
runtimes/neurun/backend/acl_common/TemplTensorBuilder.h
runtimes/neurun/backend/cpu/TensorBuilder.h
runtimes/neurun/core/include/backend/ITensorBuilder.h

index 3da55cb..c0160d7 100644 (file)
@@ -67,12 +67,15 @@ public:
   std::shared_ptr<backend::operand::IObject> wrapTensor(const model::OperandIndex &ind) override;
   void iterate(const IterateFunction &fn) override;
 
+  // TODO Fill these and remember that these will be for the linear executor for a while
+  void preVisit(const model::Operation &) override {}
+  void postVisit(const model::Operation &) override {}
+
+  // TODO Consider removing after #5642 fixes
   void registerModelObject(const model::OperandIndex &ind, const model::Operand &obj) override;
   void markConstant(const model::OperandIndex &ind) override;
   bool isConstant(const model::OperandIndex &ind) override;
-
   void deallocateConstants(void) override;
-
   void notifyFirstUseIf(const model::OperandIndex &ind) override;
   void notifyLastUseIf(const model::OperandIndex &ind) override;
 
index 87c3a63..463cbd6 100644 (file)
@@ -68,13 +68,14 @@ public:
 
   void iterate(const IterateFunction &fn) override;
 
+  void preVisit(const model::Operation &) override {}
+  void postVisit(const model::Operation &) override {}
+
+  // TODO Consider removing after #5642 fixes
   void registerModelObject(const model::OperandIndex &ind, const model::Operand &obj) override;
   void markConstant(const model::OperandIndex &ind) override;
   bool isConstant(const model::OperandIndex &ind) override;
-
   void deallocateConstants(void) override;
-
-  // Only act on the linear executor on acl
   void notifyFirstUseIf(const model::OperandIndex &) override;
   void notifyLastUseIf(const model::OperandIndex &) override;
 
index cc5427c..f2650b1 100644 (file)
 
 #include "model/Index.h"
 #include "model/OperandInfo.h"
+#include "model/Operation.h"
+#include "model/Layout.h"
 #include "operand/IObject.h"
-#include "compiler/SubTensorInfo.h"
 #include "operand/ITensor.h"
-#include "model/Layout.h"
+#include "compiler/SubTensorInfo.h"
 #include "IMemoryManager.h"
 
 namespace neurun
@@ -61,12 +62,14 @@ struct ITensorBuilder
   virtual std::shared_ptr<backend::operand::IObject> wrapTensor(const model::OperandIndex &ind) = 0;
   virtual void iterate(const IterateFunction &fn) = 0;
 
+  virtual void preVisit(const model::Operation &) = 0;
+  virtual void postVisit(const model::Operation &) = 0;
+
+  // TODO Consider removing after #5642 fixes
   virtual void registerModelObject(const model::OperandIndex &, const model::Operand &) = 0;
   virtual void markConstant(const model::OperandIndex &) = 0;
   virtual bool isConstant(const model::OperandIndex &) = 0;
-
   virtual void deallocateConstants(void) = 0;
-
   virtual void notifyFirstUseIf(const model::OperandIndex &) = 0;
   virtual void notifyLastUseIf(const model::OperandIndex &) = 0;