|
@@ -222,7 +222,7 @@ Status GraphManager::UnloadModel(GeRootModelPtr ge_root_model, uint32_t graph_id |
|
|
Status ret = SUCCESS; |
|
|
Status ret = SUCCESS; |
|
|
for (size_t i = 0; i < ge_root_model->GetAllModelId().size(); ++i) { |
|
|
for (size_t i = 0; i < ge_root_model->GetAllModelId().size(); ++i) { |
|
|
uint32_t model_id = ge_root_model->GetAllModelId()[i]; |
|
|
uint32_t model_id = ge_root_model->GetAllModelId()[i]; |
|
|
GELOGI("Unload model %u.", model_id); |
|
|
|
|
|
|
|
|
GELOGI("Unload model %u", model_id); |
|
|
ret = GraphLoader::UnloadModel(model_id); |
|
|
ret = GraphLoader::UnloadModel(model_id); |
|
|
if (ret != SUCCESS) { |
|
|
if (ret != SUCCESS) { |
|
|
GELOGW("[GraphManager] unload model failed, modelId=%u, graphId=%u.", model_id, graph_id); |
|
|
GELOGW("[GraphManager] unload model failed, modelId=%u, graphId=%u.", model_id, graph_id); |
|
@@ -324,7 +324,7 @@ Status GraphManager::InitDynamicParams(ComputeGraphPtr &compute_graph) { |
|
|
return FAILED; |
|
|
return FAILED; |
|
|
} |
|
|
} |
|
|
if ((op_desc->GetType() == DATA) || (op_type == kGetNextName)) { |
|
|
if ((op_desc->GetType() == DATA) || (op_type == kGetNextName)) { |
|
|
GELOGI("Need to process multi batch for compute graph. op_type:%s.", op_desc->GetType().c_str()); |
|
|
|
|
|
|
|
|
GELOGI("Need to process multi batch for compute graph, op_type:%s.", op_desc->GetType().c_str()); |
|
|
GetLocalOmgContext().need_multi_batch = true; |
|
|
GetLocalOmgContext().need_multi_batch = true; |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
@@ -349,7 +349,7 @@ Status GraphManager::InitDynamicParams(ComputeGraphPtr &compute_graph) { |
|
|
void GraphManager::SetAddGraphCondition(GraphId graph_id, uint32_t cond) { |
|
|
void GraphManager::SetAddGraphCondition(GraphId graph_id, uint32_t cond) { |
|
|
std::lock_guard<std::mutex> lock(add_graph_cond_mutex_); |
|
|
std::lock_guard<std::mutex> lock(add_graph_cond_mutex_); |
|
|
graph_id_to_add_graph_cond_[graph_id] = cond; |
|
|
graph_id_to_add_graph_cond_[graph_id] = cond; |
|
|
GELOGD("Graph [id:%u] has been added.", graph_id); |
|
|
|
|
|
|
|
|
GELOGD("Graph [id:%u] has been added", graph_id); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
uint32_t GraphManager::GetAddGraphCondition(GraphId graph_id) { |
|
|
uint32_t GraphManager::GetAddGraphCondition(GraphId graph_id) { |
|
@@ -358,7 +358,7 @@ uint32_t GraphManager::GetAddGraphCondition(GraphId graph_id) { |
|
|
if (it != graph_id_to_add_graph_cond_.end()) { |
|
|
if (it != graph_id_to_add_graph_cond_.end()) { |
|
|
return it->second; |
|
|
return it->second; |
|
|
} else { |
|
|
} else { |
|
|
GELOGD("Graph [id:%u] has not been added.", graph_id); |
|
|
|
|
|
|
|
|
GELOGD("Graph [id:%u] has not been added", graph_id); |
|
|
return kNotAdded; |
|
|
return kNotAdded; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@@ -368,9 +368,9 @@ void GraphManager::RemoveAddGraphCondition(GraphId graph_id) { |
|
|
auto it = graph_id_to_add_graph_cond_.find(graph_id); |
|
|
auto it = graph_id_to_add_graph_cond_.find(graph_id); |
|
|
if (it != graph_id_to_add_graph_cond_.end()) { |
|
|
if (it != graph_id_to_add_graph_cond_.end()) { |
|
|
graph_id_to_add_graph_cond_.erase(it); |
|
|
graph_id_to_add_graph_cond_.erase(it); |
|
|
GELOGD("Successfully removed add_graph_cond of graph [id:%u].", graph_id); |
|
|
|
|
|
|
|
|
GELOGD("Successfully remove add_graph_cond of graph [id:%u].", graph_id); |
|
|
} else { |
|
|
} else { |
|
|
GELOGD("Graph [id:%u] has not been added. no need to remove.", graph_id); |
|
|
|
|
|
|
|
|
GELOGD("Graph [id:%u] has not been added, no need to be removed.", graph_id); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -390,7 +390,7 @@ Status GraphManager::CheckRepeatAdd(uint32_t graph_id, bool &is_added) { |
|
|
GraphNodePtr graph_node; |
|
|
GraphNodePtr graph_node; |
|
|
Status ret = GetGraphNode(graph_id, graph_node); |
|
|
Status ret = GetGraphNode(graph_id, graph_node); |
|
|
if (ret != SUCCESS) { |
|
|
if (ret != SUCCESS) { |
|
|
GELOGE(ret, "[AddGraph] GetGraphNode failed, graph_id = %u.", graph_id); |
|
|
|
|
|
|
|
|
GELOGE(ret, "[AddGraph] GetGraphNode failed, graph_id:%u.", graph_id); |
|
|
return ret; |
|
|
return ret; |
|
|
} |
|
|
} |
|
|
is_added = true; |
|
|
is_added = true; |
|
@@ -418,7 +418,7 @@ Status GraphManager::NotifyWaittingGraph(uint32_t graph_id) { |
|
|
GELOGE(INTERNAL_ERROR, "Get graph [id:%u] count failed, graph might have not been added.", graph_id); |
|
|
GELOGE(INTERNAL_ERROR, "Get graph [id:%u] count failed, graph might have not been added.", graph_id); |
|
|
return INTERNAL_ERROR; |
|
|
return INTERNAL_ERROR; |
|
|
} |
|
|
} |
|
|
GELOGD("Add graph finished, graph_id:%u", graph_id); |
|
|
|
|
|
|
|
|
GELOGD("Add graph finished, graph_id is :%u", graph_id); |
|
|
if (count > 1) { |
|
|
if (count > 1) { |
|
|
GELOGD("Finish addgraph, graph_id:%u, graph_count:%u, start to notify.", graph_id, count); |
|
|
GELOGD("Finish addgraph, graph_id:%u, graph_count:%u, start to notify.", graph_id, count); |
|
|
add_graph_cv_.notify_all(); |
|
|
add_graph_cv_.notify_all(); |
|
|