From b3b8e49e53e0053989ca4fd649af53a148a12c30 Mon Sep 17 00:00:00 2001 From: wangshuide2020 Date: Tue, 6 Apr 2021 11:44:51 +0800 Subject: [PATCH] fix the ge compilation problem. --- cmake/options.cmake | 2 +- mindspore/ccsrc/CMakeLists.txt | 2 +- mindspore/ccsrc/pipeline/jit/pipeline.cc | 4 ++-- mindspore/ccsrc/runtime/device/CMakeLists.txt | 9 ++++++--- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/cmake/options.cmake b/cmake/options.cmake index 6f1040b9840..9a1ca9705a2 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -23,7 +23,7 @@ option(ENABLE_PYTHON "Enable python" ON) option(ENABLE_ACL "enable acl" OFF) option(ENABLE_GLIBCXX "enable_glibcxx" OFF) -if(NOT ENABLE_D AND NOT ENABLE_TESTCASES AND NOT ENABLE_ACL) +if(NOT ENABLE_D AND NOT ENABLE_TESTCASES AND NOT ENABLE_ACL AND NOT ENABLE_GE) set(ENABLE_GLIBCXX ON) endif() diff --git a/mindspore/ccsrc/CMakeLists.txt b/mindspore/ccsrc/CMakeLists.txt index 5474f35064c..3bde6fcb7e0 100644 --- a/mindspore/ccsrc/CMakeLists.txt +++ b/mindspore/ccsrc/CMakeLists.txt @@ -256,7 +256,7 @@ if(ENABLE_GE) else() target_link_libraries(mindspore ge_client) endif() - target_link_libraries(mindspore graph tsdclient datatransfer) + target_link_libraries(mindspore graph tsdclient datatransfer ascendcl runtime) endif() if(ENABLE_D) diff --git a/mindspore/ccsrc/pipeline/jit/pipeline.cc b/mindspore/ccsrc/pipeline/jit/pipeline.cc index a17d01b58c5..357f7e16ae7 100644 --- a/mindspore/ccsrc/pipeline/jit/pipeline.cc +++ b/mindspore/ccsrc/pipeline/jit/pipeline.cc @@ -80,7 +80,7 @@ using mindspore::abstract::AbstractTensorPtr; using mindspore::abstract::AbstractTuple; using mindspore::abstract::AbstractTuplePtr; -#if (ENABLE_GE || ENABLE_D) +#if (ENABLE_D) using mindspore::device::ascend::ProfilingManager; #endif @@ -1109,7 +1109,7 @@ void InitHccl() { (void)context::OpenTsd(ms_context); } #endif -#if (ENABLE_GE || ENABLE_D) +#if (ENABLE_D) if (!ProfilingManager::GetInstance().IsProfiling()) { ProfilingManager::GetInstance().SetHcclEnabledBefProfilingEnabled(); } diff --git a/mindspore/ccsrc/runtime/device/CMakeLists.txt b/mindspore/ccsrc/runtime/device/CMakeLists.txt index 4d85882bbc7..c7d87544357 100644 --- a/mindspore/ccsrc/runtime/device/CMakeLists.txt +++ b/mindspore/ccsrc/runtime/device/CMakeLists.txt @@ -16,8 +16,11 @@ else() endif() if(ENABLE_D) - file(GLOB_RECURSE D_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "ascend/*.cc" "kernel_adjust.cc" - "../../minddata/dataset/engine/tdt/tdt_handle.cc") + file(GLOB_RECURSE D_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "ascend/*.cc" "kernel_adjust.cc") +endif() +if(ENABLE_TDTQUE) + file(GLOB_RECURSE TDT_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + "../../minddata/dataset/engine/tdt/tdt_handle.cc") endif() if(ENABLE_CPU) @@ -75,4 +78,4 @@ endif() list(REMOVE_ITEM D_SRC_LIST "ascend/profiling/profiling_callback_register.cc") set_property(SOURCE ${DEVICE_SRC_LIST} ${D_SRC_LIST} ${CPU_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_DEVICE) -add_library(_mindspore_runtime_device_obj OBJECT ${DEVICE_SRC_LIST} ${D_SRC_LIST} ${CPU_SRC_LIST}) +add_library(_mindspore_runtime_device_obj OBJECT ${DEVICE_SRC_LIST} ${D_SRC_LIST} ${CPU_SRC_LIST} ${TDT_SRC_LIST})