Introduce interpreter ExecManager (#4747)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 18 Mar 2019 08:24:03 +0000 (17:24 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 18 Mar 2019 08:24:03 +0000 (17:24 +0900)
To introduce interpreter ExecManager, rename Interpereter class
ExecManager will handle execution environment and invoke intepreter
Execution environment and interpreter will be introduced as separated module later

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
runtimes/neurun/src/compiler/Compiler.cc
runtimes/neurun/src/exec/interp/ExecManager.cc [moved from runtimes/neurun/src/exec/interp/Interpreter.cc with 92% similarity]
runtimes/neurun/src/exec/interp/ExecManager.h [moved from runtimes/neurun/src/exec/interp/Interpreter.h with 89% similarity]

index ede417a..f2c8a15 100644 (file)
@@ -27,7 +27,7 @@
 #include "linear/Linear.h"
 #include "exec/Executor.h"
 #include "exec/DataflowExecutor.h"
-#include "exec/interp/Interpreter.h"
+#include "exec/interp/ExecManager.h"
 #include "util/config/ConfigManager.h"
 
 namespace neurun
@@ -46,7 +46,7 @@ void Compiler::compile(void)
 
   if (!checkCompilable())
   {
-    _executor = std::make_shared<exec::interp::Interpreter>(_model->shareModel());
+    _executor = std::make_shared<exec::interp::ExecManager>(_model->shareModel());
     return;
   }
 
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include "Interpreter.h"
+#include "ExecManager.h"
 
 namespace neurun
 {
@@ -23,7 +23,7 @@ namespace exec
 namespace interp
 {
 
-void Interpreter::setInput(const neurun::model::operand::IO::Index &index,
+void ExecManager::setInput(const neurun::model::operand::IO::Index &index,
                            const neurun::model::operand::TypeInfo &type,
                            const neurun::model::operand::Shape &shape, const void *buffer,
                            size_t length)
@@ -57,7 +57,7 @@ void Interpreter::setInput(const neurun::model::operand::IO::Index &index,
   _tensor_info_map.insert({input_index, info});
 }
 
-void Interpreter::setOutput(const neurun::model::operand::IO::Index &index,
+void ExecManager::setOutput(const neurun::model::operand::IO::Index &index,
                             const neurun::model::operand::TypeInfo &type,
                             const neurun::model::operand::Shape &shape, void *buffer, size_t length)
 {
@@ -90,7 +90,7 @@ void Interpreter::setOutput(const neurun::model::operand::IO::Index &index,
   _tensor_info_map.insert({output_index, info});
 }
 
-void Interpreter::execute(void) { throw std::runtime_error{"NYI: Interpreter execute"}; }
+void ExecManager::execute(void) { throw std::runtime_error{"NYI: ExecManager execute"}; }
 
 } // namespace interp
 } // namespace exec
  */
 
 /**
- * @file  Interpreter.h
- * @brief This file contains Interpreter class to run interpreter
+ * @file  ExecManager.h
+ * @brief This file contains ExecManager class\n
+ *        to manage interpreter execution and environment
  */
-#ifndef __NEURUN_EXEC_INTERP_INTERPRETER_H_
-#define __NEURUN_EXEC_INTERP_INTERPRETER_H_
+#ifndef __NEURUN_EXEC_INTERP_EXEC_MANAGER_H_
+#define __NEURUN_EXEC_INTERP_EXEC_MANAGER_H_
 
 #include "model/operand/IndexMap.h"
 #include "compiler/TensorInfo.h"
@@ -37,10 +38,10 @@ namespace interp
 /**
  * @brief Class to execute model using interpreter
  */
-class Interpreter final : public IExecutor
+class ExecManager final : public IExecutor
 {
 public:
-  Interpreter(const std::shared_ptr<const model::Model> &model) : _model{model}
+  ExecManager(const std::shared_ptr<const model::Model> &model) : _model{model}
   {
     // DO NOTHING
   }
@@ -103,4 +104,4 @@ private:
 } // namespace exec
 } // namespace neurun
 
-#endif // __NEURUN_EXEC_INTERP_INTERPRETER_H_
+#endif // __NEURUN_EXEC_INTERP_EXEC_MANAGER_H_