From cc68ee5c7256eb303760fcadb738cef1db1f2d06 Mon Sep 17 00:00:00 2001 From: taoxiangdong Date: Wed, 21 Oct 2020 14:22:10 +0800 Subject: [PATCH] update src code cmakelist --- ge/CMakeLists.txt | 6 ++++ ge/common/ge_common.mk | 5 ++- ge/executor/CMakeLists.txt | 1 + ge/executor/module.mk | 1 + ge/ge_inference.mk | 1 + ge/ge_local_engine/module.mk | 3 +- ge/ge_runner.mk | 1 + ge/ge_runtime/CMakeLists.txt | 59 +++++++++++++++++++++++++++++++++ ge/graph/build/memory/module.mk | 1 + ge/host_cpu_engine/module.mk | 1 + ge/offline/CMakeLists.txt | 6 +++- ge/offline/module.mk | 1 + 12 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 ge/ge_runtime/CMakeLists.txt diff --git a/ge/CMakeLists.txt b/ge/CMakeLists.txt index 9793e36d..fa315516 100755 --- a/ge/CMakeLists.txt +++ b/ge/CMakeLists.txt @@ -138,6 +138,7 @@ set(TRAIN_SRC_LIST "graph/passes/mark_same_addr_pass.cc" "graph/passes/mark_graph_unknown_status_pass.cc" "graph/partition/dynamic_shape_partition.cc" + "graph/partition/stage_partition.cc" "graph/passes/base_pass.cc" "graph/passes/bitcast_pass.cc" "graph/passes/cast_remove_pass.cc" @@ -270,6 +271,7 @@ set(TRAIN_SRC_LIST "model/ge_root_model.cc" "omm/csa_interact.cc" "opskernel_manager/ops_kernel_manager.cc" + "opskernel_manager/ops_kernel_builder_manager.cc" "session/inner_session.cc" "session/session_manager.cc" "single_op/single_op.cc" @@ -356,6 +358,7 @@ target_include_directories(ge_runner PRIVATE ${CMAKE_BINARY_DIR}/proto/ge #### yellow zone #### ${GE_CODE_DIR}/../inc + ${GE_CODE_DIR}/../inc/external ${GE_CODE_DIR}/../inc/cce ${GE_CODE_DIR}/../toolchain/ide/ide-daemon/external #### blue zone @@ -369,6 +372,7 @@ target_link_libraries(ge_runner $ ge_memory adump_server + msprofiler -Wl,--no-as-needed graph ge_common @@ -426,6 +430,7 @@ set(INFER_SRC_LIST "session/session_manager.cc" "engine_manager/dnnengine_manager.cc" "opskernel_manager/ops_kernel_manager.cc" + "opskernel_manager/ops_kernel_builder_manager.cc" "graph/manager/graph_manager.cc" "graph/manager/graph_manager_utils.cc" "graph/manager/graph_context.cc" @@ -678,6 +683,7 @@ target_include_directories(ge_compiler PRIVATE ${CMAKE_BINARY_DIR}/proto/ge #### yellow zone #### ${GE_CODE_DIR}/../inc + ${GE_CODE_DIR}/../inc/external ${GE_CODE_DIR}/../inc/cce ${GE_CODE_DIR}/../toolchain/ide/ide-daemon/external #### blue zone diff --git a/ge/common/ge_common.mk b/ge/common/ge_common.mk index e40ef3c1..efddc788 100755 --- a/ge/common/ge_common.mk +++ b/ge/common/ge_common.mk @@ -71,7 +71,10 @@ GE_COMMON_LOCAL_C_INCLUDES := \ $(TOPDIR)third_party/openssl/include/x86/include \ $(TOPDIR)framework/domi \ $(TOPDIR)framework/domi/common \ - $(TOPDIR)framework/domi/common/op + $(TOPDIR)framework/domi/common/op \ + $(TOPDIR)graphengine/ge \ + $(TOPDIR)graphengine/ge/common \ + $(TOPDIR)graphengine/ge/common/op \ #compile host libge_common include $(CLEAR_VARS) diff --git a/ge/executor/CMakeLists.txt b/ge/executor/CMakeLists.txt index 1709fe04..684e49b3 100755 --- a/ge/executor/CMakeLists.txt +++ b/ge/executor/CMakeLists.txt @@ -60,6 +60,7 @@ set(SRC_LIST "../graph/load/new_model_manager/task_info/end_graph_task_info.cc" "../graph/load/new_model_manager/task_info/super_kernel/super_kernel_factory.cc" "../graph/load/new_model_manager/task_info/super_kernel/super_kernel.cc" + "../opskernel_manager/ops_kernel_builder_manager.cc" "../single_op/single_op_manager.cc" "../single_op/single_op_model.cc" "../single_op/single_op.cc" diff --git a/ge/executor/module.mk b/ge/executor/module.mk index 8638ff91..c6831077 100755 --- a/ge/executor/module.mk +++ b/ge/executor/module.mk @@ -75,6 +75,7 @@ local_ge_executor_c_include := \ $(TOPDIR)inc/framework \ $(TOPDIR)inc \ $(LOCAL_PATH)/../ \ + $(TOPDIR)graphengine/ge \ $(TOPDIR)libc_sec/include \ third_party/protobuf/include \ third_party/json/include \ diff --git a/ge/ge_inference.mk b/ge/ge_inference.mk index 9a0bbd94..ac106346 100755 --- a/ge/ge_inference.mk +++ b/ge/ge_inference.mk @@ -347,6 +347,7 @@ DEVICE_LOCAL_C_INCLUDES := \ $(TOPDIR)inc/runtime \ $(TOPDIR)ops/built-in/op_proto/inc \ $(TOPDIR)framework/domi \ + $(TOPDIR)graphengine/ge \ $(TOPDIR)toolchain/ide/ide-daemon/external \ third_party/json/include \ third_party/protobuf/include \ diff --git a/ge/ge_local_engine/module.mk b/ge/ge_local_engine/module.mk index 3daa9686..a0247da7 100755 --- a/ge/ge_local_engine/module.mk +++ b/ge/ge_local_engine/module.mk @@ -23,6 +23,7 @@ local_lib_inc_path := proto/task.proto \ ${TOPDIR}third_party/protobuf/include \ ${TOPDIR}inc/framework \ $(TOPDIR)framework/domi \ + $(TOPDIR)graphengine/ge \ #compiler for host include $(CLEAR_VARS) @@ -143,4 +144,4 @@ LOCAL_SRC_FILES := $(ops_kernel_builder_src_files) LOCAL_C_INCLUDES := $(local_lib_inc_path) -include ${BUILD_STATIC_LIBRARY} \ No newline at end of file +include ${BUILD_STATIC_LIBRARY} diff --git a/ge/ge_runner.mk b/ge/ge_runner.mk index f654867d..6c448a46 100644 --- a/ge/ge_runner.mk +++ b/ge/ge_runner.mk @@ -318,6 +318,7 @@ RUNNER_LOCAL_C_INCLUDES := \ $(TOPDIR)libc_sec/include \ $(TOPDIR)ops/built-in/op_proto/inc \ $(TOPDIR)framework/domi/analyzer \ + $(TOPDIR)graphengine/ge/analyzer \ $(TOPDIR)toolchain/ide/ide-daemon/external \ proto/fwk_adapter.proto \ proto/ge_ir.proto \ diff --git a/ge/ge_runtime/CMakeLists.txt b/ge/ge_runtime/CMakeLists.txt new file mode 100644 index 00000000..f46e2cdc --- /dev/null +++ b/ge/ge_runtime/CMakeLists.txt @@ -0,0 +1,59 @@ +############ libge_runtime.so ############ +set(GE_SRC_LIST + "model_runner.cc" + "runtime_model.cc" + "output.cc" + "task/aicpu_task.cc" + "task/cce_task.cc" + "task/tbe_task.cc" + "task/event_record_task.cc" + "task/event_wait_task.cc" + "task/stream_active_task.cc" + "task/stream_switch_task.cc" + "task/hccl_task.cc" + "task/memcpy_async_task.cc" + "task/profiler_task.cc" +) + +add_library(ge_runtime SHARED ${GE_SRC_LIST}) + +target_compile_options(ge_runtime PRIVATE + -Werror + -O2 +) + +target_compile_definitions(ge_runtime PRIVATE + PROTOBUF_INLINE_NOT_IN_HEADERS=0 +) + +target_include_directories(ge_runtime PRIVATE + ${TOP_DIR} + ${TOP_DIR}/inc + ${TOP_DIR}/inc/graph + ${TOP_DIR}/inc/external + ${TOP_DIR}/inc/framework + ${TOP_DIR}/inc/framework/common + ${TOP_DIR}/inc/framework/ge_runtime + ${TOP_DIR}/inc/cce + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}/proto/ge +) + +target_link_libraries(ge_runtime PRIVATE + $ + -Wl,--no-as-needed + slog + runtime + c_sec + -Wl,--as-needed + -lrt + -ldl +) + +############ install ############ +set(INSTALL_BASE_DIR "") +set(INSTALL_LIBRARY_DIR lib) + +install(TARGETS ge_runtime OPTIONAL + LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR} +) diff --git a/ge/graph/build/memory/module.mk b/ge/graph/build/memory/module.mk index 2b77e40e..47c9e5cc 100755 --- a/ge/graph/build/memory/module.mk +++ b/ge/graph/build/memory/module.mk @@ -17,6 +17,7 @@ local_lib_inc_path := ${LOCAL_PATH} \ ${TOPDIR}third_party/protobuf/include \ ${TOPDIR}inc/framework \ $(TOPDIR)framework/domi \ + $(TOPDIR)graphengine/ge \ #compiler for host include $(CLEAR_VARS) diff --git a/ge/host_cpu_engine/module.mk b/ge/host_cpu_engine/module.mk index fdd6dca6..3c8e0cc9 100644 --- a/ge/host_cpu_engine/module.mk +++ b/ge/host_cpu_engine/module.mk @@ -15,6 +15,7 @@ local_lib_inc_path := proto/task.proto \ ${TOPDIR}third_party/protobuf/include \ ${TOPDIR}inc/framework \ $(TOPDIR)framework/domi \ + $(TOPDIR)graphengine/ge \ #compiler for host include $(CLEAR_VARS) diff --git a/ge/offline/CMakeLists.txt b/ge/offline/CMakeLists.txt index cf258995..8e4a7ff0 100644 --- a/ge/offline/CMakeLists.txt +++ b/ge/offline/CMakeLists.txt @@ -29,15 +29,19 @@ target_compile_definitions(atc PRIVATE target_include_directories(atc PRIVATE ${CMAKE_CURRENT_LIST_DIR} + ${GE_CODE_DIR} ${GE_CODE_DIR}/ge - ${GE_CODE_DIR}/graphengine ${GE_CODE_DIR}/inc/external ${GE_CODE_DIR}/common/inc/external ${GE_CODE_DIR}/common/inc/external/graph ${GE_CODE_DIR}/inc ${GE_CODE_DIR}/inc/framework ${METADEF_DIR}/inc + ${METADEF_DIR}/inc/graph + ${METADEF_DIR}/inc/register ${METADEF_DIR}/inc/external + ${METADEF_DIR}/inc/external/graph + ${METADEF_DIR}/inc/external/register ${PARSER_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/proto/ge diff --git a/ge/offline/module.mk b/ge/offline/module.mk index 42b217db..21fe3009 100755 --- a/ge/offline/module.mk +++ b/ge/offline/module.mk @@ -23,6 +23,7 @@ LOCAL_C_INCLUDES := \ $(TOPDIR)inc/framework/domi \ $(TOPDIR)libc_sec/include \ $(TOPDIR)inc/common/util \ + $(TOPDIR)parser \ third_party/json/include \ third_party/gflags/include \ third_party/protobuf/include \