提交 cabe0c13 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!1731 move add graph manager to gpu session

Merge pull request !1731 from zyli2020/master
......@@ -160,6 +160,13 @@ GraphId GPUSession::CompileGraph(const AnfNodePtrList &lst, const AnfNodePtrList
graph->set_execution_order(execution_order);
// Alloc memory, including static memory and dynamic memory
AllocateMemory(graph.get());
MS_EXCEPTION_IF_NULL(context_);
FuncGraphManagerPtr manager = MakeManager({graph});
context_->AddManager(manager);
if (manager) {
manager->AddFuncGraph(graph);
graph->set_manager(manager);
}
return graph_id;
}
......
......@@ -532,7 +532,6 @@ KernelGraphPtr SessionBasic::ConstructKernelGraph(const AnfNodePtrList &lst, con
graph->set_output(ConstructOutput(outputs, graph));
MS_EXCEPTION_IF_NULL(context_);
FuncGraphManagerPtr manager = MakeManager({graph});
context_->AddManager(manager);
if (manager) {
manager->AddFuncGraph(graph);
graph->set_manager(manager);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册