From: 오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 Date: Mon, 18 Mar 2019 08:24:03 +0000 (+0900) Subject: Introduce interpreter ExecManager (#4747) X-Git-Tag: submit/tizen/20190325.013700~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db2987e15f94e91bd5c6c3823a53ef4940c19a9a;p=platform%2Fcore%2Fml%2Fnnfw.git 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 --- 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_