From: @taoxudonghaha Reviewed-by: @ji_chen,@wqtshg Signed-off-by: @ji_chentags/v1.2.0
@@ -74,7 +74,7 @@ if (ENABLE_OPEN_SRC) | |||||
set(STATIC_ACL_LIB ${GE_LIB_PATH}) | set(STATIC_ACL_LIB ${GE_LIB_PATH}) | ||||
find_module(slog libslog.so ${GE_LIB_PATH}) | find_module(slog libslog.so ${GE_LIB_PATH}) | ||||
find_module(static_mmpa libmmpa.a ${GE_LIB_PATH}) | find_module(static_mmpa libmmpa.a ${GE_LIB_PATH}) | ||||
find_module(msprofiler libmsprofiler.a ${GE_LIB_PATH}) | |||||
find_module(msprofiler_ext libmsprofiler.a ${GE_LIB_PATH}) | |||||
find_module(hccl libhccl.so ${GE_LIB_PATH}) | find_module(hccl libhccl.so ${GE_LIB_PATH}) | ||||
find_module(adump_server libadump_server.a ${GE_LIB_PATH}) | find_module(adump_server libadump_server.a ${GE_LIB_PATH}) | ||||
find_module(runtime libruntime.so ${GE_LIB_PATH}) | find_module(runtime libruntime.so ${GE_LIB_PATH}) | ||||
@@ -83,7 +83,7 @@ if (ENABLE_OPEN_SRC) | |||||
find_module(error_manager liberror_manager.so ${GE_LIB_PATH}) | find_module(error_manager liberror_manager.so ${GE_LIB_PATH}) | ||||
find_module(ascend_hal_stub libascend_hal.so ${GE_LIB_PATH}) | find_module(ascend_hal_stub libascend_hal.so ${GE_LIB_PATH}) | ||||
find_module(error_manager_static liberror_manager.a ${GE_LIB_PATH}) | find_module(error_manager_static liberror_manager.a ${GE_LIB_PATH}) | ||||
find_module(msprofiler_fwk libmsprofiler_fwk.a ${GE_LIB_PATH}) | |||||
find_module(msprofiler_fwk_ext libmsprofiler_fwk.a ${GE_LIB_PATH}) | |||||
#find_module(ascendcl_static libascendcl.a ${GE_LIB_PATH}) | #find_module(ascendcl_static libascendcl.a ${GE_LIB_PATH}) | ||||
elseif(ENABLE_GE_COV OR ENABLE_GE_UT) | elseif(ENABLE_GE_COV OR ENABLE_GE_UT) | ||||
add_subdirectory(tests) | add_subdirectory(tests) | ||||
@@ -97,7 +97,7 @@ if (ENABLE_OPEN_SRC) | |||||
find_module(runtime libruntime.so ${ASCEND_RUNTIME_DIR}) | find_module(runtime libruntime.so ${ASCEND_RUNTIME_DIR}) | ||||
find_module(resource libresource.so ${ASCEND_RUNTIME_DIR}) | find_module(resource libresource.so ${ASCEND_RUNTIME_DIR}) | ||||
find_module(error_manager liberror_manager.so ${ASCEND_RUNTIME_DIR}) | find_module(error_manager liberror_manager.so ${ASCEND_RUNTIME_DIR}) | ||||
find_module(msprofiler_fwk libmsprofiler_fwk.a ${ASCEND_RUNTIME_DIR}) | |||||
find_module(msprofiler_fwk_ext libmsprofiler_fwk.a ${ASCEND_RUNTIME_DIR}) | |||||
find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}/driver) | find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}/driver) | ||||
if(PRODUCT STREQUAL "flr3") | if(PRODUCT STREQUAL "flr3") | ||||
message(FATAL_ERROR "This platform is not supported in train mode, build terminated") | message(FATAL_ERROR "This platform is not supported in train mode, build terminated") | ||||
@@ -109,7 +109,7 @@ if (ENABLE_OPEN_SRC) | |||||
find_module(resource libresource.so ${ASCEND_ATC_DIR}) | find_module(resource libresource.so ${ASCEND_ATC_DIR}) | ||||
find_module(error_manager liberror_manager.so ${ASCEND_ATC_DIR}) | find_module(error_manager liberror_manager.so ${ASCEND_ATC_DIR}) | ||||
find_module(error_manager_static liberror_manager.a ${ASCEND_ACL_DIR}) | find_module(error_manager_static liberror_manager.a ${ASCEND_ACL_DIR}) | ||||
find_module(msprofiler libmsprofiler.a ${ASCEND_ACL_DIR}) | |||||
find_module(msprofiler_ext libmsprofiler.a ${ASCEND_ACL_DIR}) | |||||
#find_module(ascendcl_static libascendcl.a ${ASCEND_ACL_DIR}) | #find_module(ascendcl_static libascendcl.a ${ASCEND_ACL_DIR}) | ||||
if(PRODUCT STREQUAL "flr3") | if(PRODUCT STREQUAL "flr3") | ||||
elseif(PRODUCT STREQUAL "flr1") | elseif(PRODUCT STREQUAL "flr1") | ||||
@@ -120,7 +120,7 @@ if (ENABLE_OPEN_SRC) | |||||
find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}) | find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}) | ||||
endif() | endif() | ||||
elseif(PLATFORM STREQUAL "all") | elseif(PLATFORM STREQUAL "all") | ||||
find_module(msprofiler libmsprofiler.a ${ASCEND_ACL_DIR}) | |||||
find_module(msprofiler_ext libmsprofiler.a ${ASCEND_ACL_DIR}) | |||||
find_module(hccl libhccl.so ${ASCEND_RUNTIME_DIR}) | find_module(hccl libhccl.so ${ASCEND_RUNTIME_DIR}) | ||||
find_module(adump_server libadump_server.a ${ASCEND_ACL_DIR}) | find_module(adump_server libadump_server.a ${ASCEND_ACL_DIR}) | ||||
find_module(runtime libruntime.so ${ASCEND_ACL_DIR}) | find_module(runtime libruntime.so ${ASCEND_ACL_DIR}) | ||||
@@ -128,7 +128,7 @@ if (ENABLE_OPEN_SRC) | |||||
find_module(resource libresource.so ${ASCEND_ATC_DIR}) | find_module(resource libresource.so ${ASCEND_ATC_DIR}) | ||||
find_module(error_manager liberror_manager.so ${ASCEND_ATC_DIR}) | find_module(error_manager liberror_manager.so ${ASCEND_ATC_DIR}) | ||||
find_module(error_manager_static liberror_manager.a ${ASCEND_ACL_DIR}) | find_module(error_manager_static liberror_manager.a ${ASCEND_ACL_DIR}) | ||||
find_module(msprofiler_fwk libmsprofiler_fwk.a ${ASCEND_RUNTIME_DIR}) | |||||
find_module(msprofiler_fwk_ext libmsprofiler_fwk.a ${ASCEND_RUNTIME_DIR}) | |||||
find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}/driver) | find_module(ascend_hal_stub libascend_hal.so ${ASCEND_DRIVER_DIR}/driver) | ||||
#find_module(ascendcl_static libascendcl.a ${ASCEND_ACL_DIR}) | #find_module(ascendcl_static libascendcl.a ${ASCEND_ACL_DIR}) | ||||
else() | else() | ||||
@@ -1,7 +1,6 @@ | |||||
if (NOT ENABLE_D AND NOT ENABLE_ACL AND NOT ENABLE_MS_TESTCASES) | if (NOT ENABLE_D AND NOT ENABLE_ACL AND NOT ENABLE_MS_TESTCASES) | ||||
add_subdirectory(common) | add_subdirectory(common) | ||||
add_subdirectory(plugin/engine) | add_subdirectory(plugin/engine) | ||||
add_subdirectory(graph/build/memory) | |||||
add_subdirectory(ge_local_engine) | add_subdirectory(ge_local_engine) | ||||
add_subdirectory(host_cpu_engine) | add_subdirectory(host_cpu_engine) | ||||
add_subdirectory(executor) | add_subdirectory(executor) | ||||
@@ -342,6 +341,13 @@ set(TRAIN_SRC_LIST | |||||
"analyzer/analyzer.cc" | "analyzer/analyzer.cc" | ||||
"ir_build/ge_ir_build.cc" | "ir_build/ge_ir_build.cc" | ||||
"ir_build/atc_ir_common.cc" | "ir_build/atc_ir_common.cc" | ||||
"graph/build/memory/memory_assigner.cc" | |||||
"graph/build/memory/graph_mem_assigner.cc" | |||||
"graph/build/memory/binary_block_mem_assigner.cc" | |||||
"graph/build/memory/block_mem_assigner.cc" | |||||
"graph/build/memory/hybrid_mem_assigner.cc" | |||||
"graph/build/memory/max_block_mem_assigner.cc" | |||||
"graph/build/memory/var_mem_assign_util.cc" | |||||
) | ) | ||||
set(INFER_SRC_LIST | set(INFER_SRC_LIST | ||||
@@ -611,11 +617,35 @@ set(INFER_SRC_LIST | |||||
"graph/label/while_label_maker.cc" | "graph/label/while_label_maker.cc" | ||||
"graph/label/partitioned_call_label_maker.cc" | "graph/label/partitioned_call_label_maker.cc" | ||||
"analyzer/analyzer.cc" | "analyzer/analyzer.cc" | ||||
"graph/build/memory/memory_assigner.cc" | |||||
"graph/build/memory/graph_mem_assigner.cc" | |||||
"graph/build/memory/binary_block_mem_assigner.cc" | |||||
"graph/build/memory/block_mem_assigner.cc" | |||||
"graph/build/memory/hybrid_mem_assigner.cc" | |||||
"graph/build/memory/max_block_mem_assigner.cc" | |||||
"graph/build/memory/var_mem_assign_util.cc" | |||||
) | ) | ||||
if (NOT ENABLE_D AND NOT ENABLE_ACL AND NOT ENABLE_MS_TESTCASES) | if (NOT ENABLE_D AND NOT ENABLE_ACL AND NOT ENABLE_MS_TESTCASES) | ||||
############ libge_runner.so ############ | ############ libge_runner.so ############ | ||||
add_library(ge_runner SHARED ${TRAIN_SRC_LIST} ${PROTO_SRCS} ${PROTO_CLIENT_SRCS}) | |||||
add_library(ge_runner SHARED | |||||
${TRAIN_SRC_LIST} | |||||
${PROTO_SRCS} | |||||
${PROTO_CLIENT_SRCS} | |||||
$<TARGET_OBJECTS:$<IF:$<TARGET_EXISTS:msprofiler_fwk>,msprofiler_fwk,msprofiler_fwk_object>> | |||||
) | |||||
add_library(msprofiler_fwk_object OBJECT IMPORTED GLOBAL) | |||||
if (msprofiler_fwk_ext_LIBRARY_DIR) | |||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/msprofiler_fwk_object) | |||||
execute_process( | |||||
COMMAND ar x ${msprofiler_fwk_ext_LIBRARY_DIR} | |||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/msprofiler_fwk_object | |||||
) | |||||
file(GLOB MSPROFILER_FWK_OBJECT_LIST ${CMAKE_CURRENT_BINARY_DIR}/msprofiler_fwk_object/*.o) | |||||
set_property(TARGET msprofiler_fwk_object PROPERTY IMPORTED_OBJECTS ${MSPROFILER_FWK_OBJECT_LIST}) | |||||
endif() | |||||
target_compile_definitions(ge_runner PRIVATE | target_compile_definitions(ge_runner PRIVATE | ||||
PROTOBUF_INLINE_NOT_IN_HEADERS=0 | PROTOBUF_INLINE_NOT_IN_HEADERS=0 | ||||
@@ -660,12 +690,8 @@ target_include_directories(ge_runner PRIVATE | |||||
target_link_libraries(ge_runner PRIVATE | target_link_libraries(ge_runner PRIVATE | ||||
$<BUILD_INTERFACE:intf_pub> | $<BUILD_INTERFACE:intf_pub> | ||||
ge_memory | |||||
adump_server | adump_server | ||||
static_mmpa | static_mmpa | ||||
-Wl,--whole-archive | |||||
msprofiler_fwk | |||||
-Wl,--no-whole-archive | |||||
-Wl,--no-as-needed | -Wl,--no-as-needed | ||||
graph | graph | ||||
ge_common | ge_common | ||||
@@ -728,7 +754,6 @@ target_include_directories(ge_compiler PRIVATE | |||||
target_link_libraries(ge_compiler PRIVATE | target_link_libraries(ge_compiler PRIVATE | ||||
$<BUILD_INTERFACE:intf_pub> | $<BUILD_INTERFACE:intf_pub> | ||||
ge_memory | |||||
static_mmpa | static_mmpa | ||||
-Wl,--no-as-needed | -Wl,--no-as-needed | ||||
graph | graph | ||||
@@ -755,7 +780,7 @@ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ascendcl_object) | |||||
if(EXISTS ${STATIC_ACL_LIB}/libascendcl.a) | if(EXISTS ${STATIC_ACL_LIB}/libascendcl.a) | ||||
execute_process( | execute_process( | ||||
COMMAND ar x ${STATIC_ACL_LIB}/libascendcl.a | COMMAND ar x ${STATIC_ACL_LIB}/libascendcl.a | ||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ascendcl_object | |||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ascendcl_object | |||||
) | ) | ||||
file(GLOB OBJECT_LIST ${CMAKE_CURRENT_BINARY_DIR}/ascendcl_object/*.o) | file(GLOB OBJECT_LIST ${CMAKE_CURRENT_BINARY_DIR}/ascendcl_object/*.o) | ||||
else() | else() | ||||
@@ -764,8 +789,21 @@ endif() | |||||
add_library(opensrc_ascendcl SHARED | add_library(opensrc_ascendcl SHARED | ||||
${OBJECT_LIST} | ${OBJECT_LIST} | ||||
$<TARGET_OBJECTS:$<IF:$<TARGET_EXISTS:msprofiler>,msprofiler,msprofiler_object>> | |||||
) | ) | ||||
add_library(msprofiler_object OBJECT IMPORTED GLOBAL) | |||||
if (msprofiler_ext_LIBRARY_DIR) | |||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/msprofiler_object) | |||||
execute_process( | |||||
COMMAND ar x ${msprofiler_ext_LIBRARY_DIR} | |||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/msprofiler_object | |||||
) | |||||
file(GLOB MSPROFILER_OBJECT_LIST ${CMAKE_CURRENT_BINARY_DIR}/msprofiler_object/*.o) | |||||
set_property(TARGET msprofiler_object PROPERTY IMPORTED_OBJECTS ${MSPROFILER_OBJECT_LIST}) | |||||
endif() | |||||
target_compile_definitions(opensrc_ascendcl PRIVATE | target_compile_definitions(opensrc_ascendcl PRIVATE | ||||
google=ascend_private | google=ascend_private | ||||
$<$<STREQUAL:${ENABLE_OPEN_SRC},True>:ONLY_COMPILE_OPEN_SRC> | $<$<STREQUAL:${ENABLE_OPEN_SRC},True>:ONLY_COMPILE_OPEN_SRC> | ||||
@@ -780,14 +818,7 @@ target_link_options(opensrc_ascendcl PRIVATE | |||||
-Wl,--allow-multiple-definition | -Wl,--allow-multiple-definition | ||||
-Wl,-z,muldefs | -Wl,-z,muldefs | ||||
-Wl,-Bsymbolic | -Wl,-Bsymbolic | ||||
-Wl,--exclude-libs,libascend_protobuf.a | |||||
-Wl,--exclude-libs,libge_executor.a | |||||
-Wl,--exclude-libs,libge_common.a | |||||
-Wl,--exclude-libs,libgraph.a | |||||
-Wl,--exclude-libs,libmmpa.a | |||||
-Wl,--exclude-libs,libregister.a | |||||
-Wl,--exclude-libs,liberror_manager.a | |||||
-Wl,--exclude-libs,libadump_server.a | |||||
-Wl,--exclude-libs,ALL | |||||
) | ) | ||||
target_link_libraries(opensrc_ascendcl PRIVATE | target_link_libraries(opensrc_ascendcl PRIVATE | ||||
-Wl,--whole-archive | -Wl,--whole-archive | ||||
@@ -799,7 +830,6 @@ target_link_libraries(opensrc_ascendcl PRIVATE | |||||
register_static | register_static | ||||
error_manager_static | error_manager_static | ||||
adump_server | adump_server | ||||
msprofiler | |||||
-Wl,--no-whole-archive | -Wl,--no-whole-archive | ||||
-Wl,--no-as-needed | -Wl,--no-as-needed | ||||
c_sec | c_sec | ||||
@@ -1,45 +0,0 @@ | |||||
set(SRC_LIST | |||||
"memory_assigner.cc" | |||||
"graph_mem_assigner.cc" | |||||
"binary_block_mem_assigner.cc" | |||||
"block_mem_assigner.cc" | |||||
"hybrid_mem_assigner.cc" | |||||
"max_block_mem_assigner.cc" | |||||
"var_mem_assign_util.cc" | |||||
) | |||||
############ libge_memory.a ############ | |||||
add_library(ge_memory STATIC ${SRC_LIST}) | |||||
target_compile_options(ge_memory PRIVATE | |||||
-Werror | |||||
-O2 | |||||
-fno-common | |||||
) | |||||
target_compile_definitions(ge_memory PRIVATE | |||||
google=ascend_private | |||||
LOG_CPP | |||||
$<$<STREQUAL:${ENABLE_OPEN_SRC},True>:ONLY_COMPILE_OPEN_SRC> | |||||
) | |||||
target_link_libraries(ge_memory PRIVATE | |||||
$<BUILD_INTERFACE:intf_pub> | |||||
ascend_protobuf | |||||
c_sec | |||||
) | |||||
target_include_directories(ge_memory PRIVATE | |||||
${CMAKE_CURRENT_LIST_DIR} | |||||
${GE_CODE_DIR}/ge | |||||
${GE_CODE_DIR}/inc | |||||
${GE_CODE_DIR}/inc/external | |||||
${METADEF_DIR}/inc | |||||
${METADEF_DIR}/inc/external | |||||
${METADEF_DIR}/inc/external/graph | |||||
${GE_CODE_DIR}/inc/framework | |||||
#### yellow zone #### | |||||
${GE_CODE_DIR}/../inc | |||||
#### blue zone #### | |||||
${GE_CODE_DIR}/third_party/fwkacllib/inc | |||||
) |