|
|
@@ -42,6 +42,12 @@ namespace ge { |
|
|
|
/// @return Status result of function |
|
|
|
/// |
|
|
|
Status ModelExecutor::Initialize(const map<string, string> &options, uint64_t session_id) { |
|
|
|
if (init_flag_) { |
|
|
|
GELOGW("ModelExecutor has already initialized."); |
|
|
|
return SUCCESS; |
|
|
|
} |
|
|
|
|
|
|
|
session_id_ = session_id; |
|
|
|
graph_run_listener_ = MakeShared<GraphModelListener>(sync_run_mutex_, condition_); |
|
|
|
if (graph_run_listener_ == nullptr) { |
|
|
|
REPORT_CALL_ERROR("E19999", "New GraphModelListener fail"); |
|
|
@@ -66,7 +72,6 @@ Status ModelExecutor::Initialize(const map<string, string> &options, uint64_t se |
|
|
|
return status; |
|
|
|
} |
|
|
|
|
|
|
|
VarManager::Instance(session_id)->SetMemManager(&MemManager::Instance()); |
|
|
|
size_t total_mem_size = 0; |
|
|
|
GE_CHK_STATUS_RET_NOLOG(GetTotalMemorySize(total_mem_size)); |
|
|
|
status = VarManager::Instance(session_id)->SetMemoryMallocSize(options, total_mem_size); |
|
|
@@ -76,7 +81,6 @@ Status ModelExecutor::Initialize(const map<string, string> &options, uint64_t se |
|
|
|
return status; |
|
|
|
} |
|
|
|
|
|
|
|
session_id_ = session_id; |
|
|
|
train_graph_flag_ = ParseTrainGraphFlag(); |
|
|
|
thread_run_flag_.store(true); |
|
|
|
run_thread_ = std::thread(&ModelExecutor::RunThread, this); |
|
|
|