From db2987e15f94e91bd5c6c3823a53ef4940c19a9a Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=98=A4=ED=98=95=EC=84=9D/On-Device=20Lab=28SR=29/Staff?= =?utf8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Mon, 18 Mar 2019 17:24:03 +0900 Subject: [PATCH] Introduce interpreter ExecManager (#4747) 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 --- runtimes/neurun/src/compiler/Compiler.cc | 4 ++-- .../src/exec/interp/{Interpreter.cc => ExecManager.cc} | 8 ++++---- .../src/exec/interp/{Interpreter.h => ExecManager.h} | 15 ++++++++------- 3 files changed, 14 insertions(+), 13 deletions(-) rename runtimes/neurun/src/exec/interp/{Interpreter.cc => ExecManager.cc} (92%) rename runtimes/neurun/src/exec/interp/{Interpreter.h => ExecManager.h} (89%) diff --git a/runtimes/neurun/src/compiler/Compiler.cc b/runtimes/neurun/src/compiler/Compiler.cc index ede417a..f2c8a15 100644 --- a/runtimes/neurun/src/compiler/Compiler.cc +++ b/runtimes/neurun/src/compiler/Compiler.cc @@ -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(_model->shareModel()); + _executor = std::make_shared(_model->shareModel()); return; } diff --git a/runtimes/neurun/src/exec/interp/Interpreter.cc b/runtimes/neurun/src/exec/interp/ExecManager.cc similarity index 92% rename from runtimes/neurun/src/exec/interp/Interpreter.cc rename to runtimes/neurun/src/exec/interp/ExecManager.cc index ab28caf..5873d2d 100644 --- a/runtimes/neurun/src/exec/interp/Interpreter.cc +++ b/runtimes/neurun/src/exec/interp/ExecManager.cc @@ -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 diff --git a/runtimes/neurun/src/exec/interp/Interpreter.h b/runtimes/neurun/src/exec/interp/ExecManager.h similarity index 89% rename from runtimes/neurun/src/exec/interp/Interpreter.h rename to runtimes/neurun/src/exec/interp/ExecManager.h index 8148bc4..8ddbf5e 100644 --- a/runtimes/neurun/src/exec/interp/Interpreter.h +++ b/runtimes/neurun/src/exec/interp/ExecManager.h @@ -15,11 +15,12 @@ */ /** - * @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 &model) : _model{model} + ExecManager(const std::shared_ptr &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_ -- 2.7.4