From 01822c54d9928a08e0b688bb2493f0fe22276741 Mon Sep 17 00:00:00 2001 From: kingfo Date: Fri, 3 Apr 2020 10:53:46 +0800 Subject: [PATCH] fix ME+GE compile error --- CMakeLists.txt | 2 +- mindspore/ccsrc/CMakeLists.txt | 2 +- mindspore/ccsrc/pipeline/pipeline_ge.cc | 17 ++++------------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bdac2da46e..d11314408e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,7 @@ set(MS_CCSRC_BUILD_PATH ${BUILD_PATH}/mindspore/mindspore/ccsrc) if (ENABLE_GE) link_directories(${CMAKE_SOURCE_DIR}/third_party/ge/lib) -else() +elseif(ENABLE_D OR ENABLE_TESTCASES) include(${CMAKE_SOURCE_DIR}/cmake/dependency_graphengine.cmake) endif() diff --git a/mindspore/ccsrc/CMakeLists.txt b/mindspore/ccsrc/CMakeLists.txt index 0b4bb0d1df..ef9b7e951c 100644 --- a/mindspore/ccsrc/CMakeLists.txt +++ b/mindspore/ccsrc/CMakeLists.txt @@ -491,7 +491,7 @@ if (NOT ENABLE_GE) add_dependencies(add_ge_lib add_ms_lib) add_dependencies(add_ge_lib graph) add_dependencies(add_ge_lib ge_runtime) - else() + elseif(ENABLE_TESTCASES) add_custom_target(add_ge_lib ALL COMMAND cp ${MS_CCSRC_BUILD_PATH}/../../graphengine/src/common/graph/libgraph.so ${MS_LIB_PATH} COMMAND cp ${CMAKE_SOURCE_DIR}/graphengine/third_party/prebuild/${CMAKE_HOST_SYSTEM_PROCESSOR}/libslog.so ${MS_LIB_PATH} diff --git a/mindspore/ccsrc/pipeline/pipeline_ge.cc b/mindspore/ccsrc/pipeline/pipeline_ge.cc index 4617884ca0..5a2a8039dd 100644 --- a/mindspore/ccsrc/pipeline/pipeline_ge.cc +++ b/mindspore/ccsrc/pipeline/pipeline_ge.cc @@ -429,20 +429,11 @@ std::shared_ptr DoExecGraph(const FuncGraphPtr& graph, const std::ve std::shared_ptr ret = nullptr; -#ifdef ENABLE_GE - AnfNodePtr root = graph->get_return(); - MS_EXCEPTION_IF_NULL(root); - AbstractBasePtr output = root->abstract(); + AnfNodePtr output_node = graph->get_return()->input(1); + MS_EXCEPTION_IF_NULL(output_node); size_t count = 0; - py::object oj = StructureOutput(output, outputs, &count); + py::object oj = StructureOutput(output_node, outputs, &count); ret = std::make_shared(oj); -#else - if (outputs.size() == 1) { - ret = std::make_shared(outputs[0]); - } else { - ret = std::make_shared(outputs); - } -#endif return ret; } @@ -495,7 +486,7 @@ py::object ExecDFGraph(const std::map& info, const FuncGraphPtr anf_graph = info.at(phase)->func_graph; -#if (!defined ENABLE_GE) || (defined ENABLE_INFER) +#ifdef ENABLE_INFER // Now don't use the graph because the exec ge function don't take effect MS_EXCEPTION_IF_NULL(info.at(phase)->func_graph); if (ENABLE_TRAIN != info.at(phase)->func_graph->flags()["training"]) {