Browse Source

move add graph manager to gpu session

tags/v0.5.0-beta
lizhenyu 5 years ago
parent
commit
9d0b74b473
2 changed files with 7 additions and 1 deletions
  1. +7
    -0
      mindspore/ccsrc/session/gpu_session.cc
  2. +0
    -1
      mindspore/ccsrc/session/session_basic.cc

+ 7
- 0
mindspore/ccsrc/session/gpu_session.cc View File

@@ -160,6 +160,13 @@ GraphId GPUSession::CompileGraph(const AnfNodePtrList &lst, const AnfNodePtrList
graph->set_execution_order(execution_order); graph->set_execution_order(execution_order);
// Alloc memory, including static memory and dynamic memory // Alloc memory, including static memory and dynamic memory
AllocateMemory(graph.get()); 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; return graph_id;
} }




+ 0
- 1
mindspore/ccsrc/session/session_basic.cc View File

@@ -532,7 +532,6 @@ KernelGraphPtr SessionBasic::ConstructKernelGraph(const AnfNodePtrList &lst, con
graph->set_output(ConstructOutput(outputs, graph)); graph->set_output(ConstructOutput(outputs, graph));
MS_EXCEPTION_IF_NULL(context_); MS_EXCEPTION_IF_NULL(context_);
FuncGraphManagerPtr manager = MakeManager({graph}); FuncGraphManagerPtr manager = MakeManager({graph});
context_->AddManager(manager);
if (manager) { if (manager) {
manager->AddFuncGraph(graph); manager->AddFuncGraph(graph);
graph->set_manager(manager); graph->set_manager(manager);


Loading…
Cancel
Save