From: 오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 Date: Mon, 17 Dec 2018 09:47:56 +0000 (+0900) Subject: Define compile state (#4055) X-Git-Tag: 0.3~66 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a61f4283a0cf72577141477a09c04e0f700c6494;p=platform%2Fcore%2Fml%2Fnnfw.git Define compile state (#4055) * Define compile state - Define 4 compile state getter/setter in plan - Set compiled state when compile finished Signed-off-by: Hyeongseok Oh * Rename getter & setter * Use class enum instead of enum --- diff --git a/runtimes/neurun/src/compiler/Compiler.cc b/runtimes/neurun/src/compiler/Compiler.cc index cf5a048..28606bd 100644 --- a/runtimes/neurun/src/compiler/Compiler.cc +++ b/runtimes/neurun/src/compiler/Compiler.cc @@ -115,6 +115,8 @@ void Compiler::compile(void) /******************************** * Code generation phase finished ********************************/ + + plan.state(State::PLANNED); } } // namespace compiler diff --git a/runtimes/neurun/src/compiler/Plan.h b/runtimes/neurun/src/compiler/Plan.h index b5fb4d5..d7ba31f 100644 --- a/runtimes/neurun/src/compiler/Plan.h +++ b/runtimes/neurun/src/compiler/Plan.h @@ -26,10 +26,18 @@ namespace neurun namespace compiler { +enum class State +{ + NONE, // Initial state + FAILED, // Failed + PLANNED, // Success planned + NO_PLAN // Not planned by environment or graph status +}; + class Plan { public: - Plan(const std::shared_ptr &model) : _model(model) + Plan(const std::shared_ptr &model) : _model(model), _state(State::NONE) { // DO NOTHING } @@ -38,6 +46,9 @@ public: neurun::graph::Graph &model(void) { return *_model; } const neurun::graph::Graph &model(void) const { return *_model; } + void state(State state) { _state = state; } + State state(void) const { return _state; } + public: operand::Context &operands(void) { return _operands; } const operand::Context &operands(void) const { return _operands; } @@ -50,6 +61,7 @@ private: std::shared_ptr _model; operand::Context _operands; operation::Sequence _ops; + State _state; }; } // namespace compiler