fix type of exception

Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
This commit is contained in:
zhoufeng 2020-12-03 09:29:32 +08:00
parent 1d94569d04
commit 3baf37bf13
4 changed files with 11 additions and 20 deletions

View File

@ -217,7 +217,7 @@ if (NOT ENABLE_GE)
if (ENABLE_D)
install(
TARGETS ms_profile hccl_adapter
TARGETS ms_profile
DESTINATION ${INSTALL_LIB_DIR}
COMPONENT mindspore
)

View File

@ -162,6 +162,7 @@ set(SUB_COMP
backend/kernel_compiler
backend/session
runtime/device
runtime/hccl_adapter
frontend/optimizer
frontend/parallel
frontend/operator
@ -239,17 +240,16 @@ if (ENABLE_D)
find_library(PROFILING_SHARED msprof ${ASCEND_DRIVER_PATH})
find_library(REGISTER register ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
find_library(OPTILING optiling ${ASCEND_OPP_PATH})
# hccl_adpter
find_library(HCCL_ADPTER hcom_graph_adaptor ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
find_library(HCCL_BUILDER hcom_opskernel_builder ${ASCEND_RUNTIME_PATH}/plugin/opskernel ${ASCEND_TOOLKIT_RUNTIME_PATH}/plugin/opskernel)
add_library(ms_profile SHARED ${PROFILING})
set_target_properties(ms_profile PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(ms_profile -Wl,--start-group ${PROFILING_SHARED} ${PROFILING} mindspore::protobuf -Wl,--end-group)
target_link_libraries(mindspore ms_profile ge_runtime ${CCE_LIB} ${RUNTIME_LIB} ${TSDCLIENT} ${HCCL} ${DATATRANSFER}
${REGISTER} -Wl,--no-as-needed ${OPTILING})
${HCCL_ADPTER} ${REGISTER} -Wl,--no-as-needed ${OPTILING} ${HCCL_BUILDER})
target_link_libraries(mindspore -Wl,--start-group proto_input mindspore::protobuf -Wl,--end-group)
# hccl_adpter
find_library(HCCL_ADPTER hcom_graph_adaptor ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
find_library(HCCL_BUILDER hcom_opskernel_builder ${ASCEND_RUNTIME_PATH}/plugin/opskernel ${ASCEND_TOOLKIT_RUNTIME_PATH}/plugin/opskernel)
add_subdirectory(runtime/hccl_adapter)
target_link_libraries(hccl_adapter PRIVATE mindspore ${HCCL_ADPTER} ${REGISTER} -Wl,--no-as-needed ${HCCL_BUILDER})
elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
target_link_libraries(mindspore -Wl,--start-group proto_input mindspore::protobuf mindspore::sentencepiece -Wl,--end-group)
else ()
@ -288,16 +288,10 @@ if (ENABLE_D)
elseif (ENABLE_GPU)
set(MINDSPORE_RPATH ${MINDSPORE_RPATH}:/usr/local/cuda/lib64)
endif ()
set(HCCL_ADPT_RPATH ${ORIGIN_PATH}:${MINDSPORE_RPATH})
set(MINDSPORE_RPATH ${ORIGIN_PATH}/lib:${MINDSPORE_RPATH})
set_target_properties(_c_expression PROPERTIES INSTALL_RPATH ${MINDSPORE_RPATH})
if (ENABLE_D)
set_target_properties(hccl_adapter PROPERTIES INSTALL_RPATH ${HCCL_ADPT_RPATH})
target_link_libraries(_c_expression PRIVATE hccl_adapter)
endif ()
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
target_link_libraries(mindspore mindspore::pybind11_module)
target_link_libraries(mindspore mindspore_gvar)
@ -362,7 +356,6 @@ if (ENABLE_D)
find_library(adump_server libadump_server.a ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
target_link_libraries(_c_expression PRIVATE ${adump_server})
target_link_libraries(inference PRIVATE ${adump_server})
target_link_libraries(inference PRIVATE mindspore_core hccl_adapter)
endif()
if (ENABLE_CPU)

View File

@ -82,6 +82,5 @@ endif ()
if (ENABLE_D)
find_library(adump_server libadump_server.a ${ASCEND_RUNTIME_PATH} ${ASCEND_TOOLKIT_RUNTIME_PATH})
target_link_libraries(mindspore_shared_lib PRIVATE ${adump_server})
target_link_libraries(mindspore_shared_lib PRIVATE mindspore_core hccl_adapter)
endif ()

View File

@ -1,8 +1,7 @@
file(GLOB_RECURSE HCCL_ADAPTER_SRC_LIST ./*.cc)
set_property(SOURCE ${HCCL_ADAPTER_SRC_LIST} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_HCCL_ADPT)
add_library(hccl_adapter SHARED ${HCCL_ADAPTER_SRC_LIST})
target_include_directories(hccl_adapter PRIVATE ${CMAKE_BINARY_DIR}/proto/ge)
add_dependencies(hccl_adapter graph)
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
target_link_options(hccl_adapter PRIVATE -Wl,-init,mindspore_log_init)
if (ENABLE_D)
add_library(_mindspore_runtime_hccl_adapter_obj OBJECT ${HCCL_ADAPTER_SRC_LIST})
target_include_directories(_mindspore_runtime_hccl_adapter_obj PRIVATE ${CMAKE_BINARY_DIR}/proto/ge)
add_dependencies(_mindspore_runtime_hccl_adapter_obj graph)
endif ()