From 310959e5d97248ff32cf51fefdffb57a6ee2df72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=8D=8E?= Date: Tue, 22 Jun 2021 11:53:41 +0800 Subject: [PATCH] move to ge_compile --- ge/CMakeLists.txt | 8 ++++++++ ge/common/CMakeLists.txt | 7 ------- ge/{common => ge_opt_info}/ge_opt_info.cc | 2 +- ge/{common => ge_opt_info}/ge_opt_info.h | 6 +++--- ge/graph/manager/graph_manager.cc | 2 +- tests/st/testcase/test_ge_opt_info.cc | 2 +- tests/ut/ge/CMakeLists.txt | 17 +++++++++++++---- .../ge/{common => ge_opt_info}/ge_opt_info_unittest.cc | 2 +- 8 files changed, 28 insertions(+), 18 deletions(-) rename ge/{common => ge_opt_info}/ge_opt_info.cc (98%) rename ge/{common => ge_opt_info}/ge_opt_info.h (88%) rename tests/ut/ge/{common => ge_opt_info}/ge_opt_info_unittest.cc (98%) diff --git a/ge/CMakeLists.txt b/ge/CMakeLists.txt index 81e2d539..543f9745 100755 --- a/ge/CMakeLists.txt +++ b/ge/CMakeLists.txt @@ -434,6 +434,7 @@ set(TRAIN_SRC_LIST "graph/build/memory/max_block_mem_assigner.cc" "graph/build/memory/var_mem_assign_util.cc" "graph/build/memory/buffer_pool_mem_assigner.cc" + "ge_opt_info/ge_opt_info.cc" ) set(INFER_SRC_LIST @@ -711,6 +712,7 @@ set(INFER_SRC_LIST "graph/build/memory/max_block_mem_assigner.cc" "graph/build/memory/var_mem_assign_util.cc" "graph/build/memory/buffer_pool_mem_assigner.cc" + "ge_opt_info/ge_opt_info.cc" ) if (NOT ENABLE_D AND NOT ENABLE_ACL AND NOT ENABLE_MS_TESTCASES) @@ -772,11 +774,13 @@ target_include_directories(ge_runner SYSTEM PRIVATE ${GE_CODE_DIR}/../inc/cce ${GE_CODE_DIR}/../toolchain/ide/ide-daemon/external ${GE_CODE_DIR}/../abl/adump/external + ${GE_CODE_DIR}/../abl/licctrll #### blue zone ${ASCEND_DIR}/driver/include ${ASCEND_DIR}/fwkacllib/include ${GE_CODE_DIR}/third_party/fwkacllib/inc ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain + ${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info ) target_link_options(ge_runner PRIVATE @@ -799,6 +803,7 @@ target_link_libraries(ge_runner PRIVATE runtime error_manager ascend_hal_stub + opt_feature -Wl,--as-needed json -lrt @@ -853,11 +858,13 @@ target_include_directories(ge_compiler SYSTEM PRIVATE ${GE_CODE_DIR}/../inc/cce ${GE_CODE_DIR}/../toolchain/ide/ide-daemon/external ${GE_CODE_DIR}/../abl/adump/external + ${GE_CODE_DIR}/../abl/licctrl #### blue zone #### ${ASCEND_DIR}/driver/include ${ASCEND_DIR}/fwkacllib/include ${GE_CODE_DIR}/third_party/fwkacllib/inc ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain + ${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info ) target_link_options(ge_compiler PRIVATE @@ -877,6 +884,7 @@ target_link_libraries(ge_compiler PRIVATE error_manager slog runtime_compile + opt_feature -Wl,--as-needed json -lrt diff --git a/ge/common/CMakeLists.txt b/ge/common/CMakeLists.txt index 0569c91a..c28bf2a7 100755 --- a/ge/common/CMakeLists.txt +++ b/ge/common/CMakeLists.txt @@ -43,7 +43,6 @@ set(SRC_LIST "op/ge_op_utils.cc" "thread_pool.cc" "ge/tbe_plugin_manager.cc" - "ge_opt_info.cc" ) if (NOT ENABLE_D AND NOT ENABLE_ACL) @@ -87,12 +86,10 @@ target_include_directories(ge_common PRIVATE #### yellow zone #### ${GE_DEPEND_DIR}/inc ${GE_DEPEND_DIR}/inc/cce - ${GE_DEPEND_DIR}/abl/licctrl #### blue zone #### #${GE_DEPEND_DIR}/include ${GE_CODE_DIR}/third_party/fwkacllib/inc ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain - ${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info ) target_link_options(ge_common PRIVATE @@ -157,12 +154,10 @@ target_include_directories(ge_common_static PRIVATE #### yellow zone #### ${GE_DEPEND_DIR}/inc ${GE_DEPEND_DIR}/inc/cce - ${GE_DEPEND_DIR}/abl/licctrl #### blue zone #### #${GE_DEPEND_DIR}/include ${GE_CODE_DIR}/third_party/fwkacllib/inc ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain - ${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info ) target_link_libraries(ge_common_static PRIVATE @@ -215,7 +210,6 @@ target_include_directories(ge_common PRIVATE ${CMAKE_BINARY_DIR}/proto/graphengine_protos ${GE_CODE_DIR}/third_party/fwkacllib/inc ${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain - ${GE_CODE_DIR}/third_party/fwkacllib/inc/opt_info ) target_link_options(ge_common PRIVATE @@ -231,7 +225,6 @@ target_link_libraries(ge_common PRIVATE c_sec error_manager slog - opt_feature static_mmpa -Wl,--as-needed json diff --git a/ge/common/ge_opt_info.cc b/ge/ge_opt_info/ge_opt_info.cc similarity index 98% rename from ge/common/ge_opt_info.cc rename to ge/ge_opt_info/ge_opt_info.cc index c6bac480..8c1b84ab 100644 --- a/ge/common/ge_opt_info.cc +++ b/ge/ge_opt_info/ge_opt_info.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "common/ge_opt_info.h" +#include "ge_opt_info/ge_opt_info.h" #include #include diff --git a/ge/common/ge_opt_info.h b/ge/ge_opt_info/ge_opt_info.h similarity index 88% rename from ge/common/ge_opt_info.h rename to ge/ge_opt_info/ge_opt_info.h index 4ec9a59f..935dff25 100644 --- a/ge/common/ge_opt_info.h +++ b/ge/ge_opt_info/ge_opt_info.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef GE_COMMON_GE_OPT_INFO_H_ -#define GE_COMMON_GE_OPT_INFO_H_ +#ifndef GE_OPT_INFO_GE_OPT_INFO_H_ +#define GE_OPT_INFO_GE_OPT_INFO_H_ #include "ge/ge_api_error_codes.h" #include "register/register_types.h" @@ -28,4 +28,4 @@ class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY GeOptInfo { }; } // namespace ge -#endif // GE_COMMON_GE_OPT_INFO_H_ +#endif // GE_OPT_INFO_GE_OPT_INFO_H_ diff --git a/ge/graph/manager/graph_manager.cc b/ge/graph/manager/graph_manager.cc index 3861e6ac..0a4633ad 100755 --- a/ge/graph/manager/graph_manager.cc +++ b/ge/graph/manager/graph_manager.cc @@ -27,7 +27,7 @@ #include "common/math/math_util.h" #include "common/thread_pool.h" #include "common/dump/dump_manager.h" -#include "common/ge_opt_info.h" +#include "ge_opt_info/ge_opt_info.h" #include "analyzer/analyzer.h" #include "graph/common/ge_call_wrapper.h" #include "graph/common/local_context.h" diff --git a/tests/st/testcase/test_ge_opt_info.cc b/tests/st/testcase/test_ge_opt_info.cc index 8fc47a9b..457473b1 100644 --- a/tests/st/testcase/test_ge_opt_info.cc +++ b/tests/st/testcase/test_ge_opt_info.cc @@ -30,7 +30,7 @@ #include "ge_graph_dsl/op_desc/op_desc_cfg_box.h" #define protected public #define private public -#include "common/ge_opt_info.h" +#include "ge_opt_info/ge_opt_info.h" #undef private #undef protected diff --git a/tests/ut/ge/CMakeLists.txt b/tests/ut/ge/CMakeLists.txt index 3ea4d1a7..ea2ac14c 100755 --- a/tests/ut/ge/CMakeLists.txt +++ b/tests/ut/ge/CMakeLists.txt @@ -173,7 +173,6 @@ set(COMMON_SRC_FILES "${GE_CODE_DIR}/ge/common/dump/exception_dumper.cc" "${GE_CODE_DIR}/ge/common/dump/opdebug_register.cc" "${GE_CODE_DIR}/ge/common/dump/dump_op.cc" - "${GE_CODE_DIR}/ge/common/ge_opt_info.cc" "${GE_CODE_DIR}/ge/common/helper/om_file_helper.cc" "${GE_CODE_DIR}/ge/model/ge_root_model.cc" "${GE_CODE_DIR}/ge/common/model_parser/model_parser.cc" @@ -348,6 +347,7 @@ set(COMMON_SRC_FILES "${GE_CODE_DIR}/ge/common/ge/datatype_util.cc" "${GE_CODE_DIR}/ge/ge_local_engine/engine/host_cpu_engine.cc" "${GE_CODE_DIR}/ge/session/omg.cc" + "${GE_CODE_DIR}/ge/ge_opt_info/ge_opt_info.cc" ) set(COMMON_FORMAT_SRC_FILES @@ -379,7 +379,6 @@ set(GRAPH_OPTIMIZE_COMMON_SRC_FILES "${GE_CODE_DIR}/ge/graph/optimize/mem_rw_conflict_optimize.cc" ) - set(GRAPH_PREPARE_COMMON_SRC_FILES "${GE_CODE_DIR}/ge/graph/preprocess/graph_preprocess.cc" "${GE_CODE_DIR}/ge/graph/preprocess/insert_op/util_insert_aipp_op.cc" @@ -455,6 +454,7 @@ set(GRAPH_EXECUTE_COMMON_SRC_FILES "${GE_CODE_DIR}/ge/graph/manager/graph_manager.cc" "${GE_CODE_DIR}/ge/graph/manager/graph_context.cc" "${GE_CODE_DIR}/ge/graph/manager/util/rt_context_util.cc" + "${GE_CODE_DIR}/ge/ge_opt_info/ge_opt_info.cc" "${GE_CODE_DIR}/ge/graph/manager/graph_context.h" ) @@ -630,6 +630,10 @@ set(SINGLE_OP_SRC_FILES "${GE_CODE_DIR}/ge/hybrid/hybrid_davinci_model.cc" ) +set(GE_OPT_INFO_SRC_FILES + "${GE_CODE_DIR}/ge/ge_opt_info/ge_opt_info.cc" +) + # test files set(COMMON_TEST_FILES "graph/passes/graph_builder_utils.cc" @@ -767,10 +771,9 @@ set(MULTI_PARTS_TEST_FILES "graph/transop_util_unittest.cc" "common/datatype_transfer_unittest.cc" "common/dump_manager_unittest.cc" - "common/dump_op_unittest.cc" "common/dump_exception_unittest.cc" + "common/dump_op_unittest.cc" "common/opdebug_register_unittest.cc" - "common/ge_opt_info_unittest.cc" "common/format_transfer_unittest.cc" "common/format_transfer_transpose_unittest.cc" "common/format_transfer_nchw_5d_unittest.cc" @@ -815,6 +818,10 @@ set(MULTI_PARTS_TEST_FILES "common/host_cpu_engine_unittest.cc" ) +set(GE_OPT_INFO_TEST_FILES + "ge_opt_info/ge_opt_info_unittest.cc" +) + set(GENERATOR_TEST_FILES "generator/ge_generator_unittest.cc" ) @@ -1110,10 +1117,12 @@ target_link_libraries(ut_libge_multiparts_utest # libge_others_utest add_executable(ut_libge_others_utest + ${GE_OPT_INFO_SRC_FILES} ${COMMON_TEST_FILES} ${PASS_TEST_FILES} ${EXECUTE_TEST_FILES} ${OTHERS_TEST_FILES} + ${GE_OPT_INFO_TEST_FILES} ) target_compile_options(ut_libge_others_utest PRIVATE diff --git a/tests/ut/ge/common/ge_opt_info_unittest.cc b/tests/ut/ge/ge_opt_info/ge_opt_info_unittest.cc similarity index 98% rename from tests/ut/ge/common/ge_opt_info_unittest.cc rename to tests/ut/ge/ge_opt_info/ge_opt_info_unittest.cc index 3ac51615..20c123e9 100644 --- a/tests/ut/ge/common/ge_opt_info_unittest.cc +++ b/tests/ut/ge/ge_opt_info/ge_opt_info_unittest.cc @@ -19,7 +19,7 @@ #define protected public #define private public -#include "common/ge_opt_info.h" +#include "ge_opt_info/ge_opt_info.h" #include "graph/ge_local_context.h" #include "external/ge/ge_api_types.h" #undef private