[neurun] Recover prepare of IFunction (#6975)
author김용섭/On-Device Lab(SR)/Engineer/삼성전자 <yons.kim@samsung.com>
Wed, 28 Aug 2019 08:21:09 +0000 (17:21 +0900)
committer오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Wed, 28 Aug 2019 08:21:09 +0000 (17:21 +0900)
Recover prepare of IFunction for #6156

Signed-off-by: Yongseop Kim <yons.kim@samsung.com>
runtimes/neurun/backend/acl_common/AclFunction.h
runtimes/neurun/core/include/exec/IFunction.h
runtimes/neurun/core/src/exec/FunctionSequence.cc
runtimes/neurun/core/src/exec/FunctionSequence.h

index 24235a3..a63f380 100644 (file)
@@ -47,6 +47,7 @@ public:
     run();
     arm_compute::CLScheduler::get().sync();
   }
+  void prepare() override { _func->prepare(); }
 
 private:
   std::unique_ptr<::arm_compute::IFunction> _func;
index 350fc56..5cc29ea 100644 (file)
@@ -28,6 +28,7 @@ public:
   virtual ~IFunction() = default;
   virtual void run() = 0;
   virtual void runSync() = 0;
+  virtual void prepare() {}
 };
 
 } // namespace exec
index 1cc8483..d3b6f1f 100644 (file)
@@ -37,6 +37,14 @@ void FunctionSequence::runSync()
   }
 }
 
+void FunctionSequence::prepare()
+{
+  for (const auto &function : _functions)
+  {
+    function->prepare();
+  }
+}
+
 void FunctionSequence::append(std::unique_ptr<IFunction> &&function)
 {
   _functions.push_back(std::move(function));
index ab0bf4a..b61d3c0 100644 (file)
@@ -34,6 +34,7 @@ public:
 
   void run() override;
   void runSync() override;
+  void prepare() override;
 
   /**
    * @brief Appends an IFunction object to the function sequence