From 4f049ae644495582cb5707cb16c572dc9dc74f5a Mon Sep 17 00:00:00 2001 From: zhou_chao1993 Date: Tue, 13 Jul 2021 17:13:38 +0800 Subject: [PATCH] modify ge common so --- .clang-format | 2 +- ge/CMakeLists.txt | 13 -- ge/client/ge_api.cc | 2 +- ge/common/CMakeLists.txt | 15 +- ge/common/auth/file_saver.cc | 22 ++- ge/{graph => }/common/bcast.cc | 4 +- ge/{graph => }/common/bcast.h | 6 +- ge/common/context/ctx.cc | 2 +- ge/common/cust_aicpu_kernel_store.h | 2 +- ge/common/debug/memory_dumper.cc | 11 +- ge/common/dump/dump_manager.cc | 19 ++- ge/common/dump/dump_properties.cc | 74 +++++---- ge/common/fmk_error_codes.cc | 7 +- .../format_transfer_transpose.h | 1 - ge/common/formats/formats.cc | 16 +- .../formats/utils/formats_trans_utils.cc | 5 +- ge/common/fp16_t.cc | 74 ++++++--- ge/common/ge/datatype_util.h | 2 +- ge/common/ge/tbe_plugin_manager.cc | 6 +- ge/{graph => }/common/ge_call_wrapper.h | 0 ge/common/ge_format_util.cc | 4 +- ge/common/helper/model_cache_helper.h | 2 +- ge/common/helper/model_helper.cc | 77 ++++------ ge/common/helper/om_file_helper.cc | 40 ++--- ge/common/kernel_store.h | 2 +- ge/{graph => }/common/local_context.cc | 2 +- ge/{graph => }/common/local_context.h | 0 ge/common/math/fp16_math.cc | 28 ++-- ge/{ => common}/model/ge_model.cc | 2 +- ge/{ => common}/model/ge_model.h | 12 +- ge/{ => common}/model/ge_root_model.cc | 3 +- ge/{ => common}/model/ge_root_model.h | 2 +- ge/common/model_parser/model_parser.cc | 12 +- ge/common/model_saver.cc | 3 +- ge/{graph => }/common/omg_util.cc | 22 +-- ge/{graph => }/common/omg_util.h | 0 ge/common/op/attr_value_util.cc | 141 ++++++++---------- ge/common/op/ge_op_utils.cc | 41 ++--- ge/common/profiling/ge_profiling.cc | 2 +- ge/common/profiling/profiling_manager.cc | 65 ++++---- ge/common/profiling/profiling_manager.h | 2 +- ge/common/properties_manager.cc | 15 +- ge/common/tbe_kernel_store.h | 2 +- ge/common/thread_pool.cc | 4 +- ge/common/thread_pool.h | 2 +- ge/{graph => }/common/transop_util.cc | 4 +- ge/{graph => }/common/transop_util.h | 2 +- ge/common/util.cc | 34 ++--- ge/executor/CMakeLists.txt | 14 +- ge/executor/module.mk | 6 +- ge/ge_inference.mk | 8 +- ge/ge_runner.mk | 8 +- ge/generator/ge_generator.cc | 2 +- ge/graph/build/graph_builder.cc | 4 +- ge/graph/build/graph_builder.h | 2 +- ge/graph/build/logical_stream_allocator.cc | 2 +- ge/graph/build/memory/block_mem_assigner.cc | 2 +- .../build/memory/buffer_pool_mem_assigner.cc | 2 +- ge/graph/build/memory/graph_mem_assigner.cc | 2 +- ge/graph/build/memory/var_mem_assign_util.cc | 2 +- ge/graph/build/model_builder.cc | 6 +- ge/graph/build/model_builder.h | 2 +- ge/graph/build/run_context.cc | 2 +- ge/graph/build/stream_allocator.cc | 2 +- ge/graph/build/task_generator.cc | 2 +- ge/graph/execute/model_executor.cc | 4 +- ge/graph/load/model_manager/davinci_model.cc | 6 +- ge/graph/load/model_manager/davinci_model.h | 2 +- ge/graph/load/model_manager/model_manager.cc | 4 +- ge/graph/load/model_manager/model_manager.h | 2 +- ge/graph/manager/graph_manager.cc | 10 +- ge/graph/manager/graph_manager.h | 2 +- ge/graph/manager/graph_manager_utils.h | 6 +- ge/graph/optimize/graph_optimize.cc | 2 +- ge/graph/optimize/mem_rw_conflict_optimize.cc | 2 +- ge/graph/partition/dynamic_shape_partition.cc | 2 +- ge/graph/partition/graph_partition.cc | 2 +- ge/graph/partition/graph_partition.h | 2 + ge/graph/passes/atomic_addr_clean_pass.cc | 2 +- ge/graph/passes/attach_stream_label_pass.cc | 2 +- ge/graph/passes/buffer_pool_memory_pass.cc | 2 +- ge/graph/passes/cast_remove_pass.cc | 2 +- ge/graph/passes/cast_translate_pass.cc | 2 +- ge/graph/passes/compile_nodes_pass.cc | 2 +- ge/graph/passes/control_trigger_pass.cc | 2 +- ge/graph/passes/dimension_adjust_pass.h | 2 +- ge/graph/passes/flow_ctrl_pass.cc | 2 +- ge/graph/passes/get_original_format_pass.cc | 2 +- ge/graph/passes/guarantee_const_pass.cc | 2 +- .../passes/hccl_tailing_optimization_pass.cc | 2 +- ge/graph/passes/identity_pass.cc | 2 +- ge/graph/passes/infershape_pass.cc | 2 +- ge/graph/passes/iterator_op_pass.cc | 2 +- .../mark_force_unknown_for_cond_pass.cc | 2 +- .../passes/mark_node_unknown_shape_pass.cc | 2 +- ge/graph/passes/merge_input_memcpy_pass.cc | 2 +- ge/graph/passes/merge_pass.cc | 2 +- ge/graph/passes/merge_to_stream_merge_pass.cc | 2 +- ge/graph/passes/multi_batch_clone_pass.cc | 4 +- ge/graph/passes/multi_batch_pass.cc | 2 +- ge/graph/passes/net_output_pass.cc | 2 +- ge/graph/passes/next_iteration_pass.cc | 2 +- ge/graph/passes/pass_manager.cc | 2 +- ge/graph/passes/pass_utils.cc | 2 +- ge/graph/passes/permute_pass.cc | 2 +- .../passes/placeholder_with_default_pass.cc | 2 +- ge/graph/passes/prevent_gradient_pass.cc | 2 +- ge/graph/passes/print_op_pass.h | 2 +- .../passes/ref_identity_delete_op_pass.cc | 2 +- ge/graph/passes/replace_transshape_pass.cc | 2 +- ge/graph/passes/snapshot_pass.cc | 2 +- ge/graph/passes/stop_gradient_pass.h | 2 +- .../passes/switch_dead_branch_elimination.cc | 2 +- .../passes/switch_to_stream_switch_pass.cc | 2 +- .../passes/transop_breadth_fusion_pass.cc | 2 +- ge/graph/passes/transop_depth_fusion_pass.cc | 2 +- .../transop_nearby_allreduce_fusion_pass.cc | 2 +- .../transop_symmetry_elimination_pass.cc | 2 +- .../transop_without_reshape_fusion_pass.cc | 2 +- ge/graph/passes/variable_op_pass.h | 2 +- ge/graph/passes/variable_prepare_op_pass.cc | 2 +- ge/graph/preprocess/graph_preprocess.cc | 6 +- ge/graph/preprocess/insert_op/ge_aipp_op.cc | 2 +- ge/graph/preprocess/multi_batch_copy_graph.cc | 4 +- ge/graph/preprocess/multi_batch_options.cc | 4 +- ge/host_kernels/add_kernel.cc | 2 +- ge/host_kernels/broadcast_args_kernel.cc | 2 +- .../broadcast_gradient_args_kernel.cc | 2 +- ge/host_kernels/cast_kernel.cc | 2 +- ge/host_kernels/floormod_kernel.cc | 2 +- ge/host_kernels/greater_kernel.cc | 2 +- ge/host_kernels/maximum_kernel.cc | 2 +- ge/host_kernels/mul_kernel.cc | 2 +- ge/host_kernels/permute_kernel.cc | 2 +- ge/host_kernels/sub_kernel.cc | 2 +- ge/host_kernels/transdata_kernel.cc | 2 +- ge/hybrid/hybrid_davinci_model.h | 2 +- ge/hybrid/model/hybrid_model.h | 2 +- ge/hybrid/model/hybrid_model_builder.cc | 2 +- ge/hybrid/model/hybrid_model_builder.h | 2 +- ge/init/gelib.cc | 2 +- ge/ir_build/attr_options/utils.cc | 2 +- ge/ir_build/ge_ir_build.cc | 2 +- ge/session/inner_session.cc | 2 +- inc/framework/common/helper/model_helper.h | 20 ++- tests/ut/ge/CMakeLists.txt | 13 +- tests/ut/ge/common/fp16_unittest.cc | 56 +++++++ .../ge/graph/build/model_builder_unittest.cc | 2 +- tests/ut/ge/graph/graph_load_unittest.cc | 2 +- .../ut/ge/graph/load/model_helper_unittest.cc | 2 +- .../graph/manager/graph_manager_unittest.cc | 10 +- .../dynamic_shape_partition_unittest.cc | 2 +- .../mark_node_unknown_shape_pass_unittest.cc | 2 +- .../passes/multi_batch_clone_pass_unittest.cc | 2 +- .../subgraph_const_migration_pass_unittest.cc | 2 +- tests/ut/ge/graph/transop_util_unittest.cc | 2 +- tests/ut/ge/hybrid/ge_hybrid_unittest.cc | 4 +- .../model/hybrid_model_builder_unittest.cc | 2 +- .../ge_local_node_executor_unittest.cc | 2 +- .../host_cpu/host_cpu_node_task_unittest.cc | 2 +- .../rts/rts_node_task_unittest.cc | 2 +- 161 files changed, 592 insertions(+), 599 deletions(-) rename ge/{graph => }/common/bcast.cc (98%) rename ge/{graph => }/common/bcast.h (98%) rename ge/{graph => }/common/ge_call_wrapper.h (100%) rename ge/{graph => }/common/local_context.cc (97%) rename ge/{graph => }/common/local_context.h (100%) rename ge/{ => common}/model/ge_model.cc (99%) rename ge/{ => common}/model/ge_model.h (90%) rename ge/{ => common}/model/ge_root_model.cc (95%) rename ge/{ => common}/model/ge_root_model.h (98%) rename ge/{graph => }/common/omg_util.cc (95%) rename ge/{graph => }/common/omg_util.h (100%) rename ge/{graph => }/common/transop_util.cc (97%) rename ge/{graph => }/common/transop_util.h (95%) create mode 100644 tests/ut/ge/common/fp16_unittest.cc diff --git a/.clang-format b/.clang-format index 6faea40d..dd8abe32 100644 --- a/.clang-format +++ b/.clang-format @@ -11,7 +11,7 @@ AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false -AllowShortFunctionsOnASingleLine: All +AllowShortFunctionsOnASingleLine: Empty AllowShortIfStatementsOnASingleLine: true AllowShortLoopsOnASingleLine: true AlwaysBreakAfterDefinitionReturnType: None diff --git a/ge/CMakeLists.txt b/ge/CMakeLists.txt index dead6aa5..cb4c84b1 100755 --- a/ge/CMakeLists.txt +++ b/ge/CMakeLists.txt @@ -112,7 +112,6 @@ set(EXECUTOR_SRC_LIST "analyzer/analyzer.cc" "common/dump/dump_manager.cc" "common/dump/dump_op.cc" - "common/dump/dump_properties.cc" "common/dump/exception_dumper.cc" "common/dump/opdebug_register.cc" "common/formats/format_transfers/format_transfer_transpose.cc" @@ -126,9 +125,6 @@ set(EXECUTOR_SRC_LIST "executor/ge_executor.cc" "ge_local_engine/engine/host_cpu_engine.cc" "graph/build/memory/var_mem_assign_util.cc" - "graph/common/bcast.cc" - "graph/common/local_context.cc" - "graph/common/omg_util.cc" "graph/execute/graph_execute.cc" "graph/execute/model_executor.cc" "graph/load/graph_loader.cc" @@ -255,8 +251,6 @@ set(EXECUTOR_SRC_LIST "hybrid/node_executor/rts/rts_task_factory.cc" "hybrid/node_executor/task_context.cc" "init/gelib.cc" - "model/ge_model.cc" - "model/ge_root_model.cc" "opskernel_manager/ops_kernel_builder_manager.cc" "opskernel_manager/ops_kernel_manager.cc" "single_op/single_op.cc" @@ -274,7 +268,6 @@ set(EXECUTOR_SRC_LIST ################################################################## set(COMPILER_SRC_LIST "analyzer/analyzer.cc" - "common/dump/dump_manager.cc" "common/dump/dump_op.cc" "common/dump/dump_properties.cc" "common/formats/format_transfers/datatype_transfer.cc" @@ -322,10 +315,6 @@ set(COMPILER_SRC_LIST "graph/build/stream_allocator.cc" "graph/build/stream_graph_optimizer.cc" "graph/build/task_generator.cc" - "graph/common/bcast.cc" - "graph/common/local_context.cc" - "graph/common/omg_util.cc" - "graph/common/transop_util.cc" "graph/label/case_label_maker.cc" "graph/label/if_label_maker.cc" "graph/label/label_maker.cc" @@ -508,8 +497,6 @@ set(COMPILER_SRC_LIST "ir_build/attr_options/weight_compress_option.cc" "ir_build/ge_ir_build.cc" "ir_build/option_utils.cc" - "model/ge_model.cc" - "model/ge_root_model.cc" "opskernel_manager/ops_kernel_builder_manager.cc" "opskernel_manager/ops_kernel_manager.cc" ) diff --git a/ge/client/ge_api.cc b/ge/client/ge_api.cc index 3cf7c3c4..e4a016b3 100644 --- a/ge/client/ge_api.cc +++ b/ge/client/ge_api.cc @@ -29,7 +29,7 @@ #include "graph/opsproto_manager.h" #include "graph/utils/type_utils.h" #include "graph/manager/util/rt_context_util.h" -#include "graph/common/ge_call_wrapper.h" +#include "common/ge_call_wrapper.h" #include "register/op_registry.h" #include "common/ge/tbe_plugin_manager.h" #include "common/util/error_manager/error_manager.h" diff --git a/ge/common/CMakeLists.txt b/ge/common/CMakeLists.txt index 1872b4c2..0d41b86f 100755 --- a/ge/common/CMakeLists.txt +++ b/ge/common/CMakeLists.txt @@ -2,16 +2,23 @@ set(SRC_LIST "context/ctx.cc" "model_saver.cc" "ge/datatype_util.cc" + "ge/plugin_manager.cc" + "ge/op_tiling_manager.cc" "helper/om_file_helper.cc" "helper/model_helper.cc" - "../model/ge_model.cc" - "../model/ge_root_model.cc" + "model/ge_model.cc" + "model/ge_root_model.cc" + "bcast.cc" + "local_context.cc" + "omg_util.cc" + "transop_util.cc" "auth/file_saver.cc" "fp16_t.cc" "math/fp16_math.cc" "debug/memory_dumper.cc" "formats/utils/formats_trans_utils.cc" "dump/dump_properties.cc" + "dump/dump_manager.cc" "formats/format_transfers/datatype_transfer.cc" "formats/format_transfers/format_transfer_transpose.cc" "formats/format_transfers/format_transfer_nchw_nc1hwc0.cc" @@ -63,7 +70,7 @@ target_compile_definitions(ge_common PRIVATE ) target_compile_options(ge_common PRIVATE - -fvisibility=hidden + -fvisibility=default -O2 -Werror -Wno-deprecated-declarations @@ -183,7 +190,7 @@ target_compile_definitions(ge_common PRIVATE ) target_compile_options(ge_common PRIVATE - -fvisibility=hidden + -fvisibility=default -O2 -Werror -Wno-deprecated-declarations diff --git a/ge/common/auth/file_saver.cc b/ge/common/auth/file_saver.cc index 57ab901b..d6f24497 100755 --- a/ge/common/auth/file_saver.cc +++ b/ge/common/auth/file_saver.cc @@ -238,7 +238,7 @@ Status FileSaver::SaveToBuffWithFileHeader(const ModelFileHeader &file_header, return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status FileSaver::CheckPath(const std::string &file_path) { +Status FileSaver::CheckPath(const std::string &file_path) { // Determine file path length if (file_path.size() >= MMPA_MAX_PATH) { GELOGE(FAILED, "[Check][FilePath]Failed, file path's length:%zu > mmpa_max_path:%d", @@ -271,8 +271,8 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status FileSaver::CheckPath(con return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status -FileSaver::SaveToFile(const string &file_path, const ge::ModelData &model, const ModelFileHeader *model_file_header) { +Status FileSaver::SaveToFile(const string &file_path, const ge::ModelData &model, + const ModelFileHeader *model_file_header) { if (file_path.empty() || model.model_data == nullptr || model.model_len == 0) { GELOGE(FAILED, "[Save][File]Incorrect input param, " "file_path is empty or model_data is nullptr or model_len is 0"); @@ -301,19 +301,18 @@ FileSaver::SaveToFile(const string &file_path, const ge::ModelData &model, const return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status -FileSaver::SaveToFile(const string &file_path, ModelFileHeader &file_header, ModelPartitionTable &model_partition_table, - const std::vector &partition_datas) { +Status FileSaver::SaveToFile(const string &file_path, ModelFileHeader &file_header, + ModelPartitionTable &model_partition_table, + const std::vector &partition_datas) { const Status ret = SaveWithFileHeader(file_path, file_header, model_partition_table, partition_datas); GE_CHK_BOOL_RET_STATUS(ret == SUCCESS, FAILED, "save file failed, file_path:%s, file header len:%u.", file_path.c_str(), file_header.length); return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status -FileSaver::SaveToFile(const string &file_path, ModelFileHeader &file_header, - vector &model_partition_tables, - const vector> &all_partition_datas) { +Status FileSaver::SaveToFile(const string &file_path, ModelFileHeader &file_header, + vector &model_partition_tables, + const vector> &all_partition_datas) { const Status ret = SaveWithFileHeader(file_path, file_header, model_partition_tables, all_partition_datas); GE_CHK_BOOL_RET_STATUS(ret == SUCCESS, FAILED, "save file failed, file_path:%s, file header len:%u.", file_path.c_str(), file_header.length); @@ -372,8 +371,7 @@ Status FileSaver::SaveWithFileHeader(const std::string &file_path, const ModelFi return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status FileSaver::SaveToFile(const string &file_path, const void *data, - int len) { +Status FileSaver::SaveToFile(const string &file_path, const void *data, int len) { if (data == nullptr || len <= 0) { GELOGE(FAILED, "[Check][Param]Failed, model_data is null or the " "length[%d] is less than 1.", len); diff --git a/ge/graph/common/bcast.cc b/ge/common/bcast.cc similarity index 98% rename from ge/graph/common/bcast.cc rename to ge/common/bcast.cc index fcc8f9a1..a4e8d1a1 100644 --- a/ge/graph/common/bcast.cc +++ b/ge/common/bcast.cc @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "graph/common/bcast.h" +#include "common/bcast.h" #include #include "common/math_util.h" -#include "framework/common/util.h" +#include "common/util.h" using domi::Status; diff --git a/ge/graph/common/bcast.h b/ge/common/bcast.h similarity index 98% rename from ge/graph/common/bcast.h rename to ge/common/bcast.h index 184751fe..a8399896 100644 --- a/ge/graph/common/bcast.h +++ b/ge/common/bcast.h @@ -21,11 +21,11 @@ #include #include -#include "framework/common/debug/log.h" -#include "framework/common/types.h" +#include "common/debug/log.h" +#include "common/types.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" -#include "external/graph/attr_value.h" +#include "graph/attr_value.h" #include "graph/ge_tensor.h" #include "graph/utils/tensor_adapter.h" diff --git a/ge/common/context/ctx.cc b/ge/common/context/ctx.cc index 9fe2f8c7..8e138ade 100755 --- a/ge/common/context/ctx.cc +++ b/ge/common/context/ctx.cc @@ -18,7 +18,7 @@ using ge::OmgContext; namespace domi { -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY OmgContext &GetContext() { +OmgContext &GetContext() { static OmgContext context; return context; } diff --git a/ge/common/cust_aicpu_kernel_store.h b/ge/common/cust_aicpu_kernel_store.h index 033a636b..38124587 100755 --- a/ge/common/cust_aicpu_kernel_store.h +++ b/ge/common/cust_aicpu_kernel_store.h @@ -21,7 +21,7 @@ namespace ge { -class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY CustAICPUKernelStore : public KernelStore { +class CustAICPUKernelStore : public KernelStore { public: CustAICPUKernelStore(); ~CustAICPUKernelStore() {} diff --git a/ge/common/debug/memory_dumper.cc b/ge/common/debug/memory_dumper.cc index 78ef2daa..f4a49440 100644 --- a/ge/common/debug/memory_dumper.cc +++ b/ge/common/debug/memory_dumper.cc @@ -30,13 +30,12 @@ const int kInvalidFd = (-1); } // namespace namespace ge { -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY MemoryDumper::MemoryDumper() : fd_(kInvalidFd) {} +MemoryDumper::MemoryDumper() : fd_(kInvalidFd) {} -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY MemoryDumper::~MemoryDumper() { Close(); } +MemoryDumper::~MemoryDumper() { Close(); } // Dump the data to the file -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status MemoryDumper::DumpToFile(const char *filename, void *data, - int64_t len) { +Status MemoryDumper::DumpToFile(const char *filename, void *data, int64_t len) { #ifdef FMK_SUPPORT_DUMP GE_CHECK_NOTNULL(filename); GE_CHECK_NOTNULL(data); @@ -81,7 +80,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status MemoryDumper::DumpToFile } // Open file -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status MemoryDumper::Open(const char *filename) { +Status MemoryDumper::Open(const char *filename) { GE_CHK_BOOL_RET_STATUS(filename != nullptr, FAILED, "Incorrect parameter. filename is nullptr"); // Try to remove file first for reduce the close time by overwriting way @@ -104,7 +103,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status MemoryDumper::Open(const } // Dump the data to file -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status MemoryDumper::Dump(void *data, uint32_t len) const { +Status MemoryDumper::Dump(void *data, uint32_t len) const { GE_CHK_BOOL_RET_STATUS(data != nullptr, FAILED, "Incorrect parameter. data is nullptr"); #ifdef FMK_SUPPORT_DUMP diff --git a/ge/common/dump/dump_manager.cc b/ge/common/dump/dump_manager.cc index ebe16fed..da8160ff 100644 --- a/ge/common/dump/dump_manager.cc +++ b/ge/common/dump/dump_manager.cc @@ -15,6 +15,7 @@ */ #include "common/dump/dump_manager.h" + #include "framework/common/debug/ge_log.h" #include "framework/common/debug/log.h" @@ -26,7 +27,7 @@ const uint64_t kInferSessionId = 0; const uint32_t kAllOverflow = 3; } // namespace namespace ge { -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY DumpManager &DumpManager::GetInstance() { +DumpManager &DumpManager::GetInstance() { static DumpManager instance; return instance; } @@ -74,7 +75,7 @@ void DumpManager::SetDumpList(const DumpConfig &dump_config, DumpProperties &dum Status DumpManager::SetNormalDumpConf(const DumpConfig &dump_config, DumpProperties &dump_properties) { if (dump_config.dump_status == kDumpOn) { - GELOGI("Only do normal dump process, dump status is %s.", dump_config.dump_status.c_str()); + GELOGI("Only do normal dump process, dump status is %s", dump_config.dump_status.c_str()); dump_properties.SetDumpStatus(dump_config.dump_status); std::string dump_op_switch = dump_config.dump_op_switch; dump_properties.SetDumpOpSwitch(dump_op_switch); @@ -104,8 +105,8 @@ Status DumpManager::SetNormalDumpConf(const DumpConfig &dump_config, DumpPropert Status DumpManager::SetDumpPath(const DumpConfig &dump_config, DumpProperties &dump_properties) { std::string dump_path = dump_config.dump_path; if (dump_path.empty()) { - GELOGE(PARAM_INVALID, "[Check][DumpPath]It is empty"); - REPORT_INNER_ERROR("E19999", "Dump path check is empty"); + GELOGE(PARAM_INVALID, "[Check][DumpPath]It is empty."); + REPORT_INNER_ERROR("E19999", "Dump path check is empty."); return PARAM_INVALID; } if (dump_path[dump_path.size() - 1] != '/') { @@ -117,7 +118,7 @@ Status DumpManager::SetDumpPath(const DumpConfig &dump_config, DumpProperties &d return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpManager::SetDumpConf(const DumpConfig &dump_config) { +Status DumpManager::SetDumpConf(const DumpConfig &dump_config) { DumpProperties dump_properties; if (!NeedDoDump(dump_config, dump_properties)) { GELOGD("No need do dump process."); @@ -131,8 +132,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpManager::SetDumpConf return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY const DumpProperties &DumpManager::GetDumpProperties( - uint64_t session_id) { +const DumpProperties &DumpManager::GetDumpProperties(uint64_t session_id) { std::lock_guard lock(mutex_); auto iter = dump_properties_map_.find(session_id); if (iter != dump_properties_map_.end()) { @@ -142,13 +142,12 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY const DumpProperties &DumpManag return default_properties; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpManager::AddDumpProperties( - uint64_t session_id, const DumpProperties &dump_properties) { +void DumpManager::AddDumpProperties(uint64_t session_id, const DumpProperties &dump_properties) { std::lock_guard lock(mutex_); dump_properties_map_.emplace(session_id, dump_properties); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpManager::RemoveDumpProperties(uint64_t session_id) { +void DumpManager::RemoveDumpProperties(uint64_t session_id) { std::lock_guard lock(mutex_); auto iter = dump_properties_map_.find(session_id); if (iter != dump_properties_map_.end()) { diff --git a/ge/common/dump/dump_properties.cc b/ge/common/dump/dump_properties.cc index 099920e7..3bed76d9 100644 --- a/ge/common/dump/dump_properties.cc +++ b/ge/common/dump/dump_properties.cc @@ -38,9 +38,7 @@ const uint32_t kAtomicOverflow = (0x1 << 1); const uint32_t kAllOverflow = (kAicoreOverflow | kAtomicOverflow); } // namespace namespace ge { -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpProperties::Split(const std::string &s, - std::vector &result, - const char *delchar) { +void DumpProperties::Split(const std::string &s, std::vector &result, const char *delchar) { if (s.empty()) { return; } @@ -68,7 +66,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpProperties::Split(cons delete[] buffer; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpProperties::CheckDumpStep(const std::string &dump_step) { +Status DumpProperties::CheckDumpStep(const std::string &dump_step) { std::string modified_dum_step = dump_step + "|"; std::smatch result; std::vector match_vecs; @@ -126,7 +124,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpProperties::CheckDum return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpProperties::CheckDumpMode(const std::string &dump_mode) { +Status DumpProperties::CheckDumpMode(const std::string &dump_mode) { const std::set dump_mode_list = {"input", "output", "all"}; std::set::iterator iter; @@ -143,7 +141,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpProperties::CheckDum return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpProperties::CheckDumpPath(const std::string &input) { +Status DumpProperties::CheckDumpPath(const std::string &input) { if (mmIsDir(input.c_str()) != EN_OK) { REPORT_INPUT_ERROR("E10001", std::vector({"parameter", "value", "reason"}), std::vector({ @@ -175,7 +173,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpProperties::CheckDum return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpProperties::CheckEnableDump(const std::string &input) { +Status DumpProperties::CheckEnableDump(const std::string &input) { std::set enable_dump_option_list = {"1", "0"}; auto it = enable_dump_option_list.find(input); if (it == enable_dump_option_list.end()) { @@ -191,17 +189,16 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpProperties::CheckEna return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY DumpProperties::DumpProperties(const DumpProperties &other) { +DumpProperties::DumpProperties(const DumpProperties &other) { CopyFrom(other); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY DumpProperties &DumpProperties::operator=( - const DumpProperties &other) { +DumpProperties &DumpProperties::operator=(const DumpProperties &other) { CopyFrom(other); return *this; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpProperties::SetDumpOptions() { +Status DumpProperties::SetDumpOptions() { if (enable_dump_ == kEnableFlag) { std::string dump_step; if (GetContext().GetOption(OPTION_EXEC_DUMP_STEP, dump_step) == GRAPH_SUCCESS && !dump_step.empty()) { @@ -220,7 +217,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpProperties::SetDumpO return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpProperties::InitByOptions() { +Status DumpProperties::InitByOptions() { enable_dump_.clear(); enable_dump_debug_.clear(); dump_path_.clear(); @@ -281,8 +278,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status DumpProperties::InitByOp } // The following is the new dump scenario of the fusion operator -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpProperties::AddPropertyValue( - const std::string &model, const std::set &layers) { +void DumpProperties::AddPropertyValue(const std::string &model, const std::set &layers) { for (const std::string &layer : layers) { GELOGI("This model %s config to dump layer %s", model.c_str(), layer.c_str()); } @@ -290,18 +286,18 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpProperties::AddPropert model_dump_properties_map_[model] = layers; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpProperties::DeletePropertyValue(const std::string &model) { +void DumpProperties::DeletePropertyValue(const std::string &model) { auto iter = model_dump_properties_map_.find(model); if (iter != model_dump_properties_map_.end()) { model_dump_properties_map_.erase(iter); } } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpProperties::ClearDumpPropertyValue() { +void DumpProperties::ClearDumpPropertyValue() { model_dump_properties_map_.clear(); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpProperties::ClearDumpInfo() { +void DumpProperties::ClearDumpInfo() { enable_dump_.clear(); enable_dump_debug_.clear(); dump_path_.clear(); @@ -314,7 +310,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpProperties::ClearDumpI op_debug_mode_ = 0; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY std::set DumpProperties::GetAllDumpModel() const { +std::set DumpProperties::GetAllDumpModel() const { std::set model_list; for (auto &iter : model_dump_properties_map_) { model_list.insert(iter.first); @@ -323,8 +319,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY std::set DumpPrope return model_list; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY std::set DumpProperties::GetPropertyValue( - const std::string &model) const { +std::set DumpProperties::GetPropertyValue(const std::string &model) const { auto iter = model_dump_properties_map_.find(model); if (iter != model_dump_properties_map_.end()) { return iter->second; @@ -332,8 +327,8 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY std::set DumpPrope return {}; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool DumpProperties::IsLayerNeedDump( - const std::string &model, const std::string &om_name, const std::string &op_name) const { +bool DumpProperties::IsLayerNeedDump(const std::string &model, const std::string &om_name, + const std::string &op_name) const { // if dump all GELOGD("model name is %s om name is %s op is %s in layer need dump", model.c_str(), om_name.c_str(), op_name.c_str()); if (model_dump_properties_map_.find(DUMP_ALL_MODEL) != model_dump_properties_map_.end()) { @@ -353,67 +348,66 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool DumpProperties::IsLayerNee return model_iter->second.find(op_name) != model_iter->second.end(); } - GELOGD("Model %s is not seated to be dump.", model.c_str()); + GELOGD("Model %s is not seated to be dump", model.c_str()); return false; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpProperties::SetDumpPath(const std::string &path) { +void DumpProperties::SetDumpPath(const std::string &path) { dump_path_ = path; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY const std::string &DumpProperties::GetDumpPath() const { +const std::string &DumpProperties::GetDumpPath() const { return dump_path_; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpProperties::SetDumpStep(const std::string &step) { +void DumpProperties::SetDumpStep(const std::string &step) { dump_step_ = step; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY const std::string &DumpProperties::GetDumpStep() const { +const std::string &DumpProperties::GetDumpStep() const { return dump_step_; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpProperties::SetDumpMode(const std::string &mode) { +void DumpProperties::SetDumpMode(const std::string &mode) { dump_mode_ = mode; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY const std::string &DumpProperties::GetDumpMode() const { +const std::string &DumpProperties::GetDumpMode() const { return dump_mode_; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpProperties::SetDumpStatus(const std::string &status) { +void DumpProperties::SetDumpStatus(const std::string &status) { dump_status_ = status; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY const std::string &DumpProperties::GetDumpStatus() const { +const std::string &DumpProperties::GetDumpStatus() const { return dump_status_; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpProperties::InitInferOpDebug() { +void DumpProperties::InitInferOpDebug() { is_infer_op_debug_ = true; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpProperties::SetOpDebugMode(const uint32_t &op_debug_mode) { +void DumpProperties::SetOpDebugMode(const uint32_t &op_debug_mode) { op_debug_mode_ = op_debug_mode; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void DumpProperties::SetDumpOpSwitch( - const std::string &dump_op_switch) { +void DumpProperties::SetDumpOpSwitch(const std::string &dump_op_switch) { dump_op_switch_ = dump_op_switch; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY const std::string &DumpProperties::GetDumpOpSwitch() const { +const std::string &DumpProperties::GetDumpOpSwitch() const { return dump_op_switch_; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool DumpProperties::IsSingleOpNeedDump() const { +bool DumpProperties::IsSingleOpNeedDump() const { if (dump_op_switch_ == kDumpStatusOpen) { return true; } return false; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool DumpProperties::IsDumpOpen() const { +bool DumpProperties::IsDumpOpen() const { if (enable_dump_ == kEnableFlag || dump_status_ == kDumpStatusOpen) { return true; } @@ -441,7 +435,7 @@ Status DumpProperties::SetDumpDebugOptions() { if (enable_dump_debug_ == kEnableFlag) { std::string dump_debug_mode; if (GetContext().GetOption(OPTION_EXEC_DUMP_DEBUG_MODE, dump_debug_mode) == GRAPH_SUCCESS) { - GELOGD("Get ge.exec.dumpDebugMode %s successfully", dump_debug_mode.c_str()); + GELOGD("Get ge.exec.dumpDebugMode %s successfully.", dump_debug_mode.c_str()); } else { GELOGW("ge.exec.dumpDebugMode is not set."); return SUCCESS; @@ -469,7 +463,7 @@ Status DumpProperties::SetDumpDebugOptions() { return PARAM_INVALID; } } else { - GELOGI("ge.exec.enableDumpDebug is false or is not set."); + GELOGI("ge.exec.enableDumpDebug is false or is not set"); } return SUCCESS; } diff --git a/ge/common/fmk_error_codes.cc b/ge/common/fmk_error_codes.cc index ddb8089d..180af0e2 100755 --- a/ge/common/fmk_error_codes.cc +++ b/ge/common/fmk_error_codes.cc @@ -17,19 +17,18 @@ #include "framework/common/fmk_error_codes.h" namespace domi { -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY StatusFactory *StatusFactory::Instance() { +StatusFactory *StatusFactory::Instance() { static StatusFactory instance; return &instance; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void StatusFactory::RegisterErrorNo(uint32_t err, - const std::string &desc) { +void StatusFactory::RegisterErrorNo(uint32_t err, const std::string &desc) { if (err_desc_.find(err) != err_desc_.end()) { return; } err_desc_[err] = desc; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY std::string StatusFactory::GetErrDesc(uint32_t err) { +std::string StatusFactory::GetErrDesc(uint32_t err) { auto iter_find = err_desc_.find(err); if (iter_find == err_desc_.end()) { return ""; diff --git a/ge/common/formats/format_transfers/format_transfer_transpose.h b/ge/common/formats/format_transfers/format_transfer_transpose.h index 7fa19ff0..b608777c 100755 --- a/ge/common/formats/format_transfers/format_transfer_transpose.h +++ b/ge/common/formats/format_transfers/format_transfer_transpose.h @@ -33,7 +33,6 @@ Status TransposeWithShapeCheck(const uint8_t *src, const std::vector &s Status GetPermByForamt(Format src_format, Format dst_format, std::vector &perm); - class FormatTransferTranspose : public FormatTransfer { public: Status TransFormat(const TransArgs &args, TransResult &result) override; diff --git a/ge/common/formats/formats.cc b/ge/common/formats/formats.cc index 9e97a4d2..5a454d60 100755 --- a/ge/common/formats/formats.cc +++ b/ge/common/formats/formats.cc @@ -17,6 +17,7 @@ #include "common/formats/formats.h" #include + #include #include #include @@ -32,7 +33,7 @@ namespace ge { namespace formats { -GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Status TransFormat(const TransArgs &args, TransResult &result) { +Status TransFormat(const TransArgs &args, TransResult &result) { auto transfer = BuildFormatTransfer(args); if (transfer == nullptr) { std::string error = "Failed to trans data from format " + @@ -56,11 +57,8 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Status TransFormat(const TransArg return transfer->TransFormat(args, result); } -GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Status TransShape(Format src_format, - const std::vector &src_shape, - DataType data_type, - Format dst_format, - std::vector &dst_shape) { +Status TransShape(Format src_format, const std::vector &src_shape, DataType data_type, Format dst_format, + std::vector &dst_shape) { formats::TransArgs args; args.src_format = src_format; args.dst_format = dst_format; @@ -76,7 +74,7 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Status TransShape(Format src_form return transfer->TransShape(src_format, src_shape, data_type, dst_format, dst_shape); } -GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Status TransDataType(const CastArgs &args, TransResult &result) { +Status TransDataType(const CastArgs &args, TransResult &result) { auto transfer = BuildDataTypeTransfer(args); if (transfer == nullptr) { std::string error = "Failed to trans data from datatype " + @@ -95,11 +93,11 @@ GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Status TransDataType(const CastAr return transfer->TransDataType(args, result); } -GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool IsTransFormatSupport(const TransArgs &args) { +bool IsTransFormatSupport(const TransArgs &args) { return FormatTransferExists(args); } -GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY bool IsTransDataTypeSupport(const CastArgs &args) { +bool IsTransDataTypeSupport(const CastArgs &args) { return DataTypeTransferExists(args); } } // namespace formats diff --git a/ge/common/formats/utils/formats_trans_utils.cc b/ge/common/formats/utils/formats_trans_utils.cc index db1812d0..63ad424f 100755 --- a/ge/common/formats/utils/formats_trans_utils.cc +++ b/ge/common/formats/utils/formats_trans_utils.cc @@ -41,15 +41,14 @@ int64_t GetCubeSizeByDataType(DataType data_type) { } } -GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY std::string ShapeToString(const GeShape &shape) { +std::string ShapeToString(const GeShape &shape) { return ShapeToString(shape.GetDims()); } -GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY std::string ShapeToString(const std::vector &shape) { +std::string ShapeToString(const std::vector &shape) { return JoinToString(shape); } -GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY std::string RangeToString(const std::vector> &ranges) { bool first = true; std::stringstream ss; diff --git a/ge/common/fp16_t.cc b/ge/common/fp16_t.cc index 2f94323d..adb55dfb 100755 --- a/ge/common/fp16_t.cc +++ b/ge/common/fp16_t.cc @@ -1180,20 +1180,40 @@ fp16_t &fp16_t::operator=(const double &d_val) { } // convert -fp16_t::operator float() const { return Fp16ToFloat(val); } -fp16_t::operator double() const { return Fp16ToDouble(val); } -fp16_t::operator int8_t() const { return Fp16ToInt8(val); } -fp16_t::operator uint8_t() const { return Fp16ToUInt8(val); } -fp16_t::operator int16_t() const { return Fp16ToInt16(val); } -fp16_t::operator uint16_t() const { return Fp16ToUInt16(val); } -fp16_t::operator int32_t() const { return Fp16ToInt32(val); } -fp16_t::operator uint32_t() const { return Fp16ToUInt32(val); } +fp16_t::operator float() const { + return Fp16ToFloat(val); +} +fp16_t::operator double() const { + return Fp16ToDouble(val); +} +fp16_t::operator int8_t() const { + return Fp16ToInt8(val); +} +fp16_t::operator uint8_t() const { + return Fp16ToUInt8(val); +} +fp16_t::operator int16_t() const { + return Fp16ToInt16(val); +} +fp16_t::operator uint16_t() const { + return Fp16ToUInt16(val); +} +fp16_t::operator int32_t() const { + return Fp16ToInt32(val); +} +fp16_t::operator uint32_t() const { + return Fp16ToUInt32(val); +} // Cannot be used, just in order to solve the compile error -fp16_t::operator int64_t() const { return 0; } +fp16_t::operator int64_t() const { + return 0; +} // Cannot be used, just in order to solve the compile error -fp16_t::operator uint64_t() const { return 0; } +fp16_t::operator uint64_t() const { + return 0; +} -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY int fp16_t::IsInf() { +int fp16_t::IsInf() { if ((val & kFp16AbsMax) == kFp16ExpMask) { if (val & kFp16SignMask) { return -1; @@ -1205,12 +1225,28 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY int fp16_t::IsInf() { } } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY float fp16_t::ToFloat() const { return Fp16ToFloat(val); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY double fp16_t::ToDouble() const { return Fp16ToDouble(val); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY int8_t fp16_t::ToInt8() const { return Fp16ToInt8(val); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY uint8_t fp16_t::ToUInt8() const { return Fp16ToUInt8(val); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY int16_t fp16_t::ToInt16() const { return Fp16ToInt16(val); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY uint16_t fp16_t::ToUInt16() const { return Fp16ToUInt16(val); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY int32_t fp16_t::ToInt32() const { return Fp16ToInt32(val); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY uint32_t fp16_t::ToUInt32() const { return Fp16ToUInt32(val); } +float fp16_t::ToFloat() const { + return Fp16ToFloat(val); +} +double fp16_t::ToDouble() const { + return Fp16ToDouble(val); +} +int8_t fp16_t::ToInt8() const { + return Fp16ToInt8(val); +} +uint8_t fp16_t::ToUInt8() const { + return Fp16ToUInt8(val); +} +int16_t fp16_t::ToInt16() const { + return Fp16ToInt16(val); +} +uint16_t fp16_t::ToUInt16() const { + return Fp16ToUInt16(val); +} +int32_t fp16_t::ToInt32() const { + return Fp16ToInt32(val); +} +uint32_t fp16_t::ToUInt32() const { + return Fp16ToUInt32(val); +} } // namespace ge diff --git a/ge/common/ge/datatype_util.h b/ge/common/ge/datatype_util.h index c3b41b81..82c8d259 100644 --- a/ge/common/ge/datatype_util.h +++ b/ge/common/ge/datatype_util.h @@ -42,7 +42,7 @@ static std::map CONST_OPDATA_TYPE_SIZE_MAP = { {ge::DT_UINT8, kGeSizeUint8}, {ge::DT_UINT16, kGeSizeUint16}, {ge::DT_UINT32, kGeSizeUint32}, {ge::DT_UINT64, kGeSizeUint64}, {ge::DT_DOUBLE, kGeSizeDouble}, {ge::DT_BOOL, kGeSizeBool}}; -class GE_FUNC_HOST_VISIBILITY GE_FUNC_DEV_VISIBILITY DataTypeUtil { +class DataTypeUtil { public: static bool DataTypeTranslatable(const ge::DataType &src_out_data_type, const ge::DataType &dst_in_data_type); static const std::vector &GetTranslatableDataTypesBySrc(const ge::DataType &src_out_data_type); diff --git a/ge/common/ge/tbe_plugin_manager.cc b/ge/common/ge/tbe_plugin_manager.cc index 70c1ab94..3680a8bb 100755 --- a/ge/common/ge/tbe_plugin_manager.cc +++ b/ge/common/ge/tbe_plugin_manager.cc @@ -42,7 +42,7 @@ const int kBaseInt = 10; std::map TBEPluginManager::options_ = {}; // Get Singleton Instance -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY TBEPluginManager &TBEPluginManager::Instance() { +TBEPluginManager &TBEPluginManager::Instance() { static TBEPluginManager instance_ptr_; return instance_ptr_; } @@ -61,7 +61,7 @@ Status TBEPluginManager::ClearHandles_() { return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status TBEPluginManager::Finalize() { +Status TBEPluginManager::Finalize() { Status ret = ClearHandles_(); return ret; } @@ -207,7 +207,6 @@ void TBEPluginManager::LoadCustomOpLib() { } } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void TBEPluginManager::LoadPluginSo(const std::map &options) { vector file_list; string caffe_parser_path; @@ -246,7 +245,6 @@ void TBEPluginManager::LoadPluginSo(const std::map &options) { } } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void TBEPluginManager::InitPreparation(const std::map &options) { options_.insert(options.begin(), options.end()); // Load TBE plugin diff --git a/ge/graph/common/ge_call_wrapper.h b/ge/common/ge_call_wrapper.h similarity index 100% rename from ge/graph/common/ge_call_wrapper.h rename to ge/common/ge_call_wrapper.h diff --git a/ge/common/ge_format_util.cc b/ge/common/ge_format_util.cc index f3dee571..0ffa686f 100755 --- a/ge/common/ge_format_util.cc +++ b/ge/common/ge_format_util.cc @@ -18,9 +18,7 @@ #include "common/formats/formats.h" namespace ge { -GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY Status GeFormatUtil::TransShape(const TensorDesc &src_desc, - Format dst_format, - std::vector &dst_shape) { +Status GeFormatUtil::TransShape(const TensorDesc &src_desc, Format dst_format, std::vector &dst_shape) { return formats::TransShape(src_desc.GetFormat(), src_desc.GetShape().GetDims(), src_desc.GetDataType(), dst_format, dst_shape); } diff --git a/ge/common/helper/model_cache_helper.h b/ge/common/helper/model_cache_helper.h index 13253cbe..f0831075 100755 --- a/ge/common/helper/model_cache_helper.h +++ b/ge/common/helper/model_cache_helper.h @@ -24,7 +24,7 @@ #include "external/ge/ge_api_error_codes.h" #include "graph/compute_graph.h" #include "graph/manager/graph_var_manager.h" -#include "model/ge_model.h" +#include "common/model/ge_model.h" namespace ge { using Json = nlohmann::json; diff --git a/ge/common/helper/model_helper.cc b/ge/common/helper/model_helper.cc index 4e760a4a..2608b1e1 100644 --- a/ge/common/helper/model_helper.cc +++ b/ge/common/helper/model_helper.cc @@ -33,7 +33,7 @@ const uint32_t kStatiOmFileModelNum = 1; namespace ge { -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ModelHelper::~ModelHelper() { (void)ReleaseLocalModelData(); } +ModelHelper::~ModelHelper() { (void)ReleaseLocalModelData(); } Status ModelHelper::SaveModelPartition(std::shared_ptr &om_file_save_helper, ModelPartitionType type, const uint8_t *data, size_t size, size_t model_index) { @@ -108,8 +108,8 @@ Status ModelHelper::SaveSizeToModelDef(const GeModelPtr &ge_model) { return SUCCESS; } -Status ModelHelper::SaveModelDef(std::shared_ptr &om_file_save_helper, - const GeModelPtr &ge_model, ge::Buffer &model_buffer, size_t model_index) { +Status ModelHelper::SaveModelDef(std::shared_ptr &om_file_save_helper, const GeModelPtr &ge_model, + ge::Buffer &model_buffer, size_t model_index) { ModelPtr model_tmp = ge::MakeShared(ge_model->GetName(), ge_model->GetPlatformVersion()); if (model_tmp == nullptr) { GELOGE(FAILED, "[Creat][Model]Failed, Model %s Ptr", ge_model->GetName().c_str()); @@ -143,8 +143,8 @@ Status ModelHelper::SaveModelDef(std::shared_ptr &om_file_save return SUCCESS; } -Status ModelHelper::SaveModelWeights(std::shared_ptr &om_file_save_helper, - const GeModelPtr &ge_model, size_t model_index) { +Status ModelHelper::SaveModelWeights(std::shared_ptr &om_file_save_helper, const GeModelPtr &ge_model, + size_t model_index) { auto ge_model_weight = ge_model->GetWeight(); GELOGD("WEIGHTS_DATA size is %zu, %p", ge_model_weight.GetSize(), ge_model_weight.GetData()); // weight is not necessary @@ -187,8 +187,8 @@ Status ModelHelper::SaveModelCustAICPU(std::shared_ptr &om_fil return SUCCESS; } -Status ModelHelper::SaveModelTaskDef(std::shared_ptr &om_file_save_helper, - const GeModelPtr &ge_model, ge::Buffer &task_buffer, size_t model_index) { +Status ModelHelper::SaveModelTaskDef(std::shared_ptr &om_file_save_helper, const GeModelPtr &ge_model, + ge::Buffer &task_buffer, size_t model_index) { std::shared_ptr model_task_def = ge_model->GetModelTaskDefPtr(); if (model_task_def == nullptr) { GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Creat][ModelTaskDef]Failed, it is nullptr, " @@ -231,8 +231,8 @@ Status ModelHelper::SaveModelTaskDef(std::shared_ptr &om_file_ return SUCCESS; } -Status ModelHelper::SaveModelHeader(std::shared_ptr &om_file_save_helper, - const GeModelPtr &ge_model, size_t model_num) { +Status ModelHelper::SaveModelHeader(std::shared_ptr &om_file_save_helper, const GeModelPtr &ge_model, + size_t model_num) { // Save target/version to model_header ModelFileHeader &model_header = om_file_save_helper->GetModelFileHeader(); model_header.platform_type = ge_model->GetPlatformType(); @@ -246,8 +246,10 @@ Status ModelHelper::SaveModelHeader(std::shared_ptr &om_file_s if (err != EOK) { GELOGE(ACL_ERROR_GE_MEMORY_ALLOCATION, "[Save][Model]Failed while allocating memory for platform_version %s, model %s, " - "errno %d", platform_version.c_str(), ge_model->GetName().c_str(), err); - REPORT_CALL_ERROR("E19999", "ModelHelper save model %s failed while " + "errno %d", + platform_version.c_str(), ge_model->GetName().c_str(), err); + REPORT_CALL_ERROR("E19999", + "ModelHelper save model %s failed while " "allocating memory for platform_version %s, errno %d", ge_model->GetName().c_str(), platform_version.c_str(), err); return ACL_ERROR_GE_MEMORY_ALLOCATION; @@ -271,9 +273,9 @@ Status ModelHelper::SaveModelHeader(std::shared_ptr &om_file_s return SUCCESS; } -Status ModelHelper::SaveAllModelPartiton(std::shared_ptr& om_file_save_helper, - const GeModelPtr &ge_model, ge::Buffer &model_buffer, - ge::Buffer &task_buffer, size_t model_index) { +Status ModelHelper::SaveAllModelPartiton(std::shared_ptr &om_file_save_helper, + const GeModelPtr &ge_model, ge::Buffer &model_buffer, ge::Buffer &task_buffer, + size_t model_index) { if (SaveModelDef(om_file_save_helper, ge_model, model_buffer, model_index) != SUCCESS) { GELOGE(FAILED, "[Save][ModelDef]Failed, model %s, model index %zu", ge_model->GetName().c_str(), model_index); @@ -316,10 +318,8 @@ Status ModelHelper::SaveAllModelPartiton(std::shared_ptr& om_f return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::SaveToOmModel(const GeModelPtr &ge_model, - const SaveParam &save_param, - const std::string &output_file, - ModelBufferData& model) { +Status ModelHelper::SaveToOmModel(const GeModelPtr &ge_model, const SaveParam &save_param, + const std::string &output_file, ModelBufferData &model) { if (output_file.empty()) { GELOGE(FAILED, "[Save][Model]GraphBuilder SaveModel received invalid file name prefix, " "model %s", ge_model->GetName().c_str()); @@ -367,13 +367,8 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::SaveToOmMod return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::SaveToOmRootModel( - const GeRootModelPtr &ge_root_model, - const SaveParam &save_param, - const std::string &output_file, - ModelBufferData& model, - bool is_unknown_shape) { - +Status ModelHelper::SaveToOmRootModel(const GeRootModelPtr &ge_root_model, const SaveParam &save_param, + const std::string &output_file, ModelBufferData &model, bool is_unknown_shape) { GE_CHECK_NOTNULL(ge_root_model); GE_IF_BOOL_EXEC(ge_root_model == nullptr, GELOGE(FAILED, "[Check][GERootModel]Ge_root_model is nullptr"); @@ -466,8 +461,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::SaveToOmRoo return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status -ModelHelper::SaveOriginalGraphToOmModel(const ge::Graph &graph, const std::string &output_file) { +Status ModelHelper::SaveOriginalGraphToOmModel(const ge::Graph &graph, const std::string &output_file) { if (output_file.empty()) { GELOGE(FAILED, "[Save][Model]Received invalid file name prefix, output_file %s", output_file.c_str()); REPORT_INNER_ERROR("E19999", "Save model received invalid file name prefix, output_file %s", output_file.c_str()); @@ -545,7 +539,7 @@ ModelHelper::SaveOriginalGraphToOmModel(const ge::Graph &graph, const std::strin return (ret == SUCCESS ? SUCCESS : FAILED); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::LoadModel(const ge::ModelData &model_data) { +Status ModelHelper::LoadModel(const ge::ModelData &model_data) { if (model_data.model_data == nullptr || model_data.model_len == 0) { GELOGE(ACL_ERROR_GE_EXEC_MODEL_DATA_SIZE_INVALID, "[Load][Model]Model_data is nullptr or model_data_size is 0"); @@ -597,7 +591,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::LoadModel(c return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::LoadRootModel(const ge::ModelData &model_data) { +Status ModelHelper::LoadRootModel(const ge::ModelData &model_data) { if (model_data.model_data == nullptr || model_data.model_len == 0) { GELOGE(ACL_ERROR_GE_EXEC_MODEL_DATA_SIZE_INVALID, "[Load][RootModel] " "Model_data is nullptr or model data is empty."); @@ -783,7 +777,6 @@ Status ModelHelper::LoadModelData(OmFileLoadHelper &om_load_helper, GeModelPtr & return SUCCESS; } - Status ModelHelper::LoadWeights(OmFileLoadHelper &om_load_helper) { ModelPartition partition; if (om_load_helper.GetModelPartition(ModelPartitionType::WEIGHTS_DATA, partition) != SUCCESS) { @@ -814,7 +807,7 @@ Status ModelHelper::LoadWeights(OmFileLoadHelper &om_load_helper, GeModelPtr &cu return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::LoadTask(OmFileLoadHelper &om_load_helper) { +Status ModelHelper::LoadTask(OmFileLoadHelper &om_load_helper) { ModelPartition task_partition; if (om_load_helper.GetModelPartition(ModelPartitionType::TASK_INFO, task_partition) != SUCCESS) { GELOGE(FAILED, "[Get][ModelTaskPartition]Failed, task_partition size:%u", task_partition.size); @@ -838,9 +831,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::LoadTask(Om return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::LoadTask(OmFileLoadHelper &om_load_helper, - GeModelPtr &cur_model, - size_t mode_index) { +Status ModelHelper::LoadTask(OmFileLoadHelper &om_load_helper, GeModelPtr &cur_model, size_t mode_index) { ModelPartition task_partition; if (om_load_helper.GetModelPartition(ModelPartitionType::TASK_INFO, task_partition, mode_index) != SUCCESS) { GELOGE(FAILED, "Get task model partition failed."); @@ -915,8 +906,8 @@ Status ModelHelper::LoadCustAICPUKernelStore(OmFileLoadHelper &om_load_helper) { return SUCCESS; } -Status ModelHelper::LoadCustAICPUKernelStore(OmFileLoadHelper &om_load_helper, - GeModelPtr &cur_model, size_t mode_index) { +Status ModelHelper::LoadCustAICPUKernelStore(OmFileLoadHelper &om_load_helper, GeModelPtr &cur_model, + size_t mode_index) { // Load cust aicpu kernels ModelPartition partition_kernel_def; CustAICPUKernelStore kernel_store; @@ -933,7 +924,7 @@ Status ModelHelper::LoadCustAICPUKernelStore(OmFileLoadHelper &om_load_helper, return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY GeModelPtr ModelHelper::GetGeModel() { +GeModelPtr ModelHelper::GetGeModel() { if (model_ != nullptr) { return model_; } @@ -946,7 +937,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY GeModelPtr ModelHelper::GetGeMo return out_model; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY GeRootModelPtr ModelHelper::GetGeRootModel() { +GeRootModelPtr ModelHelper::GetGeRootModel() { if (root_model_ != nullptr) { return root_model_; } @@ -959,7 +950,6 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY GeRootModelPtr ModelHelper::Get return out_model; } - Status ModelHelper::ReleaseLocalModelData() noexcept { Status result = SUCCESS; if (model_addr_tmp_ != nullptr) { @@ -976,8 +966,7 @@ Status ModelHelper::ReleaseLocalModelData() noexcept { return result; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::GetBaseNameFromFileName( - const string &file_name, string &base_name) { +Status ModelHelper::GetBaseNameFromFileName(const string &file_name, string &base_name) { GELOGD("Get base_name from file, file_name:%s", file_name.c_str()); GE_CHK_BOOL_EXEC_WARN(!file_name.empty(), return FAILED, "File path may not valid, check params --output"); size_t start_position = 0; @@ -992,8 +981,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::GetBaseName return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelHelper::GetModelNameFromMergedGraphName( - const string &graph_name, string &model_name) { +Status ModelHelper::GetModelNameFromMergedGraphName(const string &graph_name, string &model_name) { GELOGD("Get model_name from graph_name, graph_name:%s", graph_name.c_str()); // this can only be used after merged graph(graph name will be append with "_x", x is index); GE_CHK_BOOL_EXEC_WARN(!graph_name.empty(), return FAILED, "File path may not valid, check params --output"); @@ -1035,8 +1023,7 @@ Status ModelTool::GetModelInfoFromOm(const char *model_file, ge::proto::ModelDef ErrorManager::GetInstance().ATCReportErrMessage("E10003", {"parameter", "value", "reason"}, {"om", model_file, "invalid om file, can't be parsed"}); GELOGE(ACL_ERROR_GE_PARAM_INVALID, - "[Parse][ModelContent]Failed because of invalid om file %s, please check om param", - model_file); + "[Parse][ModelContent]Failed because of invalid om file %s, please check om param", model_file); return ret; } diff --git a/ge/common/helper/om_file_helper.cc b/ge/common/helper/om_file_helper.cc index cd13c5d8..a42316ff 100644 --- a/ge/common/helper/om_file_helper.cc +++ b/ge/common/helper/om_file_helper.cc @@ -18,10 +18,11 @@ #include #include -#include "common/math/math_util.h" + #include "common/auth/file_saver.h" -#include "framework/common/debug/log.h" +#include "common/math/math_util.h" #include "framework/common/debug/ge_log.h" +#include "framework/common/debug/log.h" #include "framework/common/ge_inner_error_codes.h" #include "framework/common/util.h" @@ -32,7 +33,7 @@ const int32_t kOptionalNum = 2; } namespace ge { // For Load -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status OmFileLoadHelper::Init(const ge::ModelData &model) { +Status OmFileLoadHelper::Init(const ge::ModelData &model) { if (CheckModelValid(model) != SUCCESS) { return FAILED; } @@ -42,8 +43,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status OmFileLoadHelper::Init(c return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status OmFileLoadHelper::Init(uint8_t *model_data, - const uint32_t model_data_size) { +Status OmFileLoadHelper::Init(uint8_t *model_data, const uint32_t model_data_size) { Status status = LoadModelPartitionTable(model_data, model_data_size); if (status != SUCCESS) { return status; @@ -52,9 +52,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status OmFileLoadHelper::Init(u return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status OmFileLoadHelper::Init(uint8_t *model_data, - uint32_t model_data_size, - uint32_t model_num) { +Status OmFileLoadHelper::Init(uint8_t *model_data, uint32_t model_data_size, uint32_t model_num) { Status status = LoadModelPartitionTable(model_data, model_data_size, model_num); if (status != SUCCESS) { return status; @@ -64,8 +62,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status OmFileLoadHelper::Init(u } // Use both -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status OmFileLoadHelper::GetModelPartition(ModelPartitionType type, - ModelPartition &partition) { +Status OmFileLoadHelper::GetModelPartition(ModelPartitionType type, ModelPartition &partition) { if (!is_inited_) { GELOGE(PARAM_INVALID, "OmFileLoadHelper has not been initialized!"); return PARAM_INVALID; @@ -90,9 +87,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status OmFileLoadHelper::GetMod return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status OmFileLoadHelper::GetModelPartition(ModelPartitionType type, - ModelPartition &partition, - size_t model_index) { +Status OmFileLoadHelper::GetModelPartition(ModelPartitionType type, ModelPartition &partition, size_t model_index) { if (!is_inited_) { GELOGE(PARAM_INVALID, "OmFileLoadHelper has not been initialized!"); return PARAM_INVALID; @@ -248,12 +243,11 @@ Status OmFileLoadHelper::LoadModelPartitionTable(uint8_t *model_data, uint32_t m return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY const std::vector - &OmFileSaveHelper::GetModelPartitions() const { +const std::vector &OmFileSaveHelper::GetModelPartitions() const { return context_.partition_datas_; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ModelPartitionTable *OmFileSaveHelper::GetPartitionTable() { +ModelPartitionTable *OmFileSaveHelper::GetPartitionTable() { auto partition_size = static_cast(context_.partition_datas_.size()); // Build ModelPartitionTable, flex array context_.partition_table_.clear(); @@ -272,8 +266,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ModelPartitionTable *OmFileSave return partition_table; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ModelPartitionTable *OmFileSaveHelper::GetPartitionTable( - size_t cur_ctx_index) { +ModelPartitionTable *OmFileSaveHelper::GetPartitionTable(size_t cur_ctx_index) { auto &cur_ctx = model_contexts_[cur_ctx_index]; auto partition_size = static_cast(cur_ctx.partition_datas_.size()); // Build ModelPartitionTable, flex array @@ -293,8 +286,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ModelPartitionTable *OmFileSave return partition_table; } - -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status OmFileSaveHelper::AddPartition(ModelPartition &partition) { +Status OmFileSaveHelper::AddPartition(ModelPartition &partition) { if (ge::CheckUint32AddOverflow(context_.model_data_len_, partition.size) != SUCCESS) { GELOGE(FAILED, "UINT32 %u and %u addition can result in overflow!", context_.model_data_len_, partition.size); return FAILED; @@ -379,8 +371,8 @@ Status OmFileSaveHelper::SaveModelToFile(const char *output_file, ModelBufferDat #endif } -Status OmFileSaveHelper::SaveRootModel(const SaveParam &save_param, const char *output_file, - ModelBufferData &model, bool is_offline) { +Status OmFileSaveHelper::SaveRootModel(const SaveParam &save_param, const char *output_file, ModelBufferData &model, + bool is_offline) { (void)save_param.cert_file; (void)save_param.ek_file; (void)save_param.encode_mode; @@ -409,8 +401,8 @@ Status OmFileSaveHelper::SaveRootModel(const SaveParam &save_param, const char * model_header_.length += size_of_table + cur_model_data_len; model_partition_tabels.push_back(tmp_table); all_model_partitions.push_back(cur_ctx.partition_datas_); - GELOGD("sizeof(ModelPartitionTable):%u, cur_model_data_len:%u, cur_context_index:%zu", - size_of_table, cur_model_data_len, ctx_index); + GELOGD("sizeof(ModelPartitionTable):%u, cur_model_data_len:%u, cur_context_index:%zu", size_of_table, + cur_model_data_len, ctx_index); } Status ret; if (is_offline) { diff --git a/ge/common/kernel_store.h b/ge/common/kernel_store.h index b3f4a62e..e7b867a3 100755 --- a/ge/common/kernel_store.h +++ b/ge/common/kernel_store.h @@ -48,7 +48,7 @@ struct KernelStoreItemHead { uint32_t bin_len; }; -class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY KernelStore { +class KernelStore { public: KernelStore() = default; virtual ~KernelStore() = default; diff --git a/ge/graph/common/local_context.cc b/ge/common/local_context.cc similarity index 97% rename from ge/graph/common/local_context.cc rename to ge/common/local_context.cc index bd747021..e31f2342 100644 --- a/ge/graph/common/local_context.cc +++ b/ge/common/local_context.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "graph/common/local_context.h" +#include "common/local_context.h" #include "framework/common/debug/ge_log.h" diff --git a/ge/graph/common/local_context.h b/ge/common/local_context.h similarity index 100% rename from ge/graph/common/local_context.h rename to ge/common/local_context.h diff --git a/ge/common/math/fp16_math.cc b/ge/common/math/fp16_math.cc index 6a9c2fb3..c2dfeb61 100755 --- a/ge/common/math/fp16_math.cc +++ b/ge/common/math/fp16_math.cc @@ -18,7 +18,7 @@ #include "external/register/register_types.h" namespace ge { -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t sqrt(fp16_t fp) { +fp16_t sqrt(fp16_t fp) { fp16_t ret; // Convert half precision float number to double double dVal = fp; @@ -29,7 +29,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t sqrt(fp16_t fp) { return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t rsqrt(fp16_t fp) { +fp16_t rsqrt(fp16_t fp) { fp16_t ret; // Convert half precision float number to double double dVal = fp; @@ -40,7 +40,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t rsqrt(fp16_t fp) { return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t rcp(fp16_t fp) { +fp16_t rcp(fp16_t fp) { fp16_t ret; // Convert half precision float number to double double dVal = fp; @@ -51,7 +51,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t rcp(fp16_t fp) { return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t exp(fp16_t fp) { +fp16_t exp(fp16_t fp) { fp16_t ret; // Convert half precision float number to double double dVal = fp; @@ -63,7 +63,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t exp(fp16_t fp) { return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t pow2(fp16_t fp) { +fp16_t pow2(fp16_t fp) { fp16_t ret; // Convert half precision float number to double double dVal = fp; @@ -75,7 +75,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t pow2(fp16_t fp) { return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t pow10(fp16_t fp) { +fp16_t pow10(fp16_t fp) { fp16_t ret; // Convert half precision float number to double double dVal = fp; @@ -87,7 +87,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t pow10(fp16_t fp) { return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t ln(fp16_t fp) { +fp16_t ln(fp16_t fp) { fp16_t ret; // Convert half precision float number to double double dVal = fp; @@ -99,7 +99,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t ln(fp16_t fp) { return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t log2(fp16_t fp) { +fp16_t log2(fp16_t fp) { fp16_t ret; // Convert half precision float number to double double dVal = fp; @@ -111,7 +111,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t log2(fp16_t fp) { return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t log10(fp16_t fp) { +fp16_t log10(fp16_t fp) { fp16_t ret; // Convert half precision float number to double double dVal = fp; @@ -123,7 +123,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t log10(fp16_t fp) { return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t cos(fp16_t fp) { +fp16_t cos(fp16_t fp) { fp16_t ret; // Convert half precision float number to double double dVal = fp; @@ -135,7 +135,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t cos(fp16_t fp) { return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t sin(fp16_t fp) { +fp16_t sin(fp16_t fp) { fp16_t ret; // Convert half precision float number to double double dVal = fp; @@ -147,13 +147,13 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t sin(fp16_t fp) { return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t abs(fp16_t fp) { +fp16_t abs(fp16_t fp) { fp16_t ret; ret.val = (fp.val & kFp16AbsMax); return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t max(fp16_t fp1, fp16_t fp2) { +fp16_t max(fp16_t fp1, fp16_t fp2) { if (fp1 >= fp2) { return fp1; } else { @@ -161,7 +161,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t max(fp16_t fp1, fp16_t f } } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY fp16_t min(fp16_t fp1, fp16_t fp2) { +fp16_t min(fp16_t fp1, fp16_t fp2) { if (fp1 <= fp2) { return fp1; } else { diff --git a/ge/model/ge_model.cc b/ge/common/model/ge_model.cc similarity index 99% rename from ge/model/ge_model.cc rename to ge/common/model/ge_model.cc index 1bf35afc..7fc58b6d 100755 --- a/ge/model/ge_model.cc +++ b/ge/common/model/ge_model.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "model/ge_model.h" +#include "common/model/ge_model.h" #include #include "framework/common/debug/log.h" #include "graph/debug/ge_attr_define.h" diff --git a/ge/model/ge_model.h b/ge/common/model/ge_model.h similarity index 90% rename from ge/model/ge_model.h rename to ge/common/model/ge_model.h index 6356c621..0e791746 100755 --- a/ge/model/ge_model.h +++ b/ge/common/model/ge_model.h @@ -31,7 +31,7 @@ namespace ge { const uint32_t INVALID_MODEL_ID = 0xFFFFFFFFUL; -class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY GeModel : public AttrHolder { +class GeModel : public AttrHolder { public: GeModel(); ~GeModel() = default; @@ -82,13 +82,13 @@ class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY GeModel : public AttrHolder private: void Init(); - ProtoAttrMapHelper attrs_; + ProtoAttrMapHelper attrs_; /*lint !e148*/ Graph graph_; - std::shared_ptr task_; - TBEKernelStore tbe_kernal_store_; - CustAICPUKernelStore cust_aicpu_kernal_store_; - Buffer weights_buffer_; + std::shared_ptr task_; /*lint !e148*/ + TBEKernelStore tbe_kernal_store_; /*lint !e148*/ + CustAICPUKernelStore cust_aicpu_kernal_store_; /*lint !e148*/ + Buffer weights_buffer_; /*lint !e148*/ std::string name_; uint32_t version_ = {0}; diff --git a/ge/model/ge_root_model.cc b/ge/common/model/ge_root_model.cc similarity index 95% rename from ge/model/ge_root_model.cc rename to ge/common/model/ge_root_model.cc index b6a1e175..3fe10991 100644 --- a/ge/model/ge_root_model.cc +++ b/ge/common/model/ge_root_model.cc @@ -14,8 +14,9 @@ * limitations under the License. */ -#include "model/ge_root_model.h" +#include "common/model/ge_root_model.h" #include "graph/debug/ge_attr_define.h" + namespace ge { void GeRootModel::SetSubgraphInstanceNameToModel(string instance_name, GeModelPtr ge_model) { subgraph_instance_name_to_model_.insert(std::pair(instance_name, ge_model)); diff --git a/ge/model/ge_root_model.h b/ge/common/model/ge_root_model.h similarity index 98% rename from ge/model/ge_root_model.h rename to ge/common/model/ge_root_model.h index 9e8e116e..e9ba3da6 100755 --- a/ge/model/ge_root_model.h +++ b/ge/common/model/ge_root_model.h @@ -15,7 +15,7 @@ */ #include #include "graph/compute_graph.h" -#include "model/ge_model.h" +#include "common/model/ge_model.h" #ifndef GE_MODEL_GE_ROOT_MODEL_H_ #define GE_MODEL_GE_ROOT_MODEL_H_ diff --git a/ge/common/model_parser/model_parser.cc b/ge/common/model_parser/model_parser.cc index 7447cdf8..5d1869be 100644 --- a/ge/common/model_parser/model_parser.cc +++ b/ge/common/model_parser/model_parser.cc @@ -23,12 +23,10 @@ #include "framework/common/helper/model_helper.h" namespace ge { -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ModelParserBase::ModelParserBase() {} -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ModelParserBase::~ModelParserBase() {} +ModelParserBase::ModelParserBase() {} +ModelParserBase::~ModelParserBase() {} -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelParserBase::LoadFromFile(const char *model_path, - int32_t priority, - ge::ModelData &model_data) { +Status ModelParserBase::LoadFromFile(const char *model_path, int32_t priority, ge::ModelData &model_data) { std::string real_path = RealPath(model_path); if (real_path.empty()) { GELOGE(ACL_ERROR_GE_EXEC_MODEL_PATH_INVALID, "[Check][Param]Model file path %s is invalid", @@ -81,9 +79,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelParserBase::LoadFro return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelParserBase::ParseModelContent(const ge::ModelData &model, - uint8_t *&model_data, - uint32_t &model_len) { +Status ModelParserBase::ParseModelContent(const ge::ModelData &model, uint8_t *&model_data, uint32_t &model_len) { // Parameter validity check GE_CHECK_NOTNULL(model.model_data); diff --git a/ge/common/model_saver.cc b/ge/common/model_saver.cc index 24e837f7..56045030 100755 --- a/ge/common/model_saver.cc +++ b/ge/common/model_saver.cc @@ -29,8 +29,7 @@ namespace ge { const uint32_t kInteval = 2; -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ModelSaver::SaveJsonToFile(const char *file_path, - const Json &model) { +Status ModelSaver::SaveJsonToFile(const char *file_path, const Json &model) { Status ret = SUCCESS; if (file_path == nullptr || SUCCESS != CheckPath(file_path)) { GELOGE(FAILED, "[Check][OutputFile]Failed, file %s", file_path); diff --git a/ge/graph/common/omg_util.cc b/ge/common/omg_util.cc similarity index 95% rename from ge/graph/common/omg_util.cc rename to ge/common/omg_util.cc index b2017e4d..31e4270a 100644 --- a/ge/graph/common/omg_util.cc +++ b/ge/common/omg_util.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/debug/ge_attr_define.h" #include "graph/utils/graph_utils.h" @@ -59,8 +59,8 @@ Status SetStreamLabel(const ge::NodePtr &node, const std::string &label) { if (!AttrUtils::SetStr(tmp_desc, ge::ATTR_NAME_STREAM_LABEL, label)) { REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_STREAM_LABEL.c_str(), node->GetName().c_str(), node->GetType().c_str()); - GELOGE(FAILED, "[Set][Attr] %s fail for op:%s(%s)", ATTR_NAME_STREAM_LABEL.c_str(), - node->GetName().c_str(), node->GetType().c_str()); + GELOGE(FAILED, "[Set][Attr] %s fail for op:%s(%s)", ATTR_NAME_STREAM_LABEL.c_str(), node->GetName().c_str(), + node->GetType().c_str()); return FAILED; } @@ -100,8 +100,8 @@ Status SetActiveLabelList(const ge::NodePtr &node, const std::vectorGetName().c_str(), node->GetType().c_str()); - GELOGE(FAILED, "[Set][Attr] %s fail for op:%s(%s)", ATTR_NAME_ACTIVE_LABEL_LIST.c_str(), - node->GetName().c_str(), node->GetType().c_str()); + GELOGE(FAILED, "[Set][Attr] %s fail for op:%s(%s)", ATTR_NAME_ACTIVE_LABEL_LIST.c_str(), node->GetName().c_str(), + node->GetType().c_str()); return FAILED; } @@ -163,8 +163,8 @@ Status SetOriginalNodeName(const ge::NodePtr &node, const std::string &orig_name if (!AttrUtils::SetStr(tmp_desc, ge::ATTR_NAME_ORIG_NODE_NAME, orig_name)) { REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_ORIG_NODE_NAME.c_str(), node->GetName().c_str(), node->GetType().c_str()); - GELOGE(FAILED, "[Set][Attr] %s fail for op:%s(%s)", ATTR_NAME_ORIG_NODE_NAME.c_str(), - node->GetName().c_str(), node->GetType().c_str()); + GELOGE(FAILED, "[Set][Attr] %s fail for op:%s(%s)", ATTR_NAME_ORIG_NODE_NAME.c_str(), node->GetName().c_str(), + node->GetType().c_str()); return FAILED; } @@ -207,8 +207,8 @@ Status SetNextIteration(const NodePtr &node, const NodePtr &next) { if (!AttrUtils::SetStr(op_desc, ATTR_NAME_NEXT_ITERATION, name)) { REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_NEXT_ITERATION.c_str(), op_desc->GetName().c_str(), op_desc->GetType().c_str()); - GELOGE(FAILED, "[Set][Attr] %s fail for op:%s(%s)", ATTR_NAME_NEXT_ITERATION.c_str(), - op_desc->GetName().c_str(), op_desc->GetType().c_str()); + GELOGE(FAILED, "[Set][Attr] %s fail for op:%s(%s)", ATTR_NAME_NEXT_ITERATION.c_str(), op_desc->GetName().c_str(), + op_desc->GetType().c_str()); return FAILED; } return SUCCESS; @@ -290,8 +290,8 @@ void SetControlFlowGroup(const NodePtr &node, int64_t group) { if (!AttrUtils::SetInt(op_desc, ATTR_NAME_CONTROL_FLOW_GROUP, group)) { REPORT_INNER_ERROR("E19999", "Set Attr:%s fail for op:%s(%s)", ATTR_NAME_CONTROL_FLOW_GROUP.c_str(), node->GetName().c_str(), node->GetType().c_str()); - GELOGE(FAILED, "[Set][Attr] %s fail for op:%s(%s)", ATTR_NAME_CONTROL_FLOW_GROUP.c_str(), - node->GetName().c_str(), node->GetType().c_str()); + GELOGE(FAILED, "[Set][Attr] %s fail for op:%s(%s)", ATTR_NAME_CONTROL_FLOW_GROUP.c_str(), node->GetName().c_str(), + node->GetType().c_str()); } } } // namespace ge diff --git a/ge/graph/common/omg_util.h b/ge/common/omg_util.h similarity index 100% rename from ge/graph/common/omg_util.h rename to ge/common/omg_util.h diff --git a/ge/common/op/attr_value_util.cc b/ge/common/op/attr_value_util.cc index 8be0ecd1..fd5b842a 100644 --- a/ge/common/op/attr_value_util.cc +++ b/ge/common/op/attr_value_util.cc @@ -77,37 +77,33 @@ DEFINE_SET_ATTR_VALUE_LIST(const std::string &, s); } \ } while (0); -#define DEFINE_ADD_ATTR_VALUE(KEY_TYPE, VALUE_TYPE) \ - FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void AddOpAttr(KEY_TYPE map_key, VALUE_TYPE value, OpDef *op_def) { \ - GE_CHECK_NOTNULL_JUST_RETURN(op_def); \ - auto attr = op_def->mutable_attr(); \ - ADD_TO_ATTR_MAP(map_key, value, attr) \ - } \ - FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void AddOpAttr(KEY_TYPE map_key, VALUE_TYPE value, \ - AttrDefMap *attr_map) { \ - ADD_TO_ATTR_MAP(map_key, value, attr_map) \ - } \ - FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void AddModelAttr(KEY_TYPE map_key, VALUE_TYPE value, \ - ModelDef *model_def) { \ - GE_CHECK_NOTNULL_JUST_RETURN(model_def); \ - auto attr = model_def->mutable_attr(); \ - ADD_TO_ATTR_MAP(map_key, value, attr) \ +#define DEFINE_ADD_ATTR_VALUE(KEY_TYPE, VALUE_TYPE) \ + void AddOpAttr(KEY_TYPE map_key, VALUE_TYPE value, OpDef *op_def) { \ + GE_CHECK_NOTNULL_JUST_RETURN(op_def); \ + auto attr = op_def->mutable_attr(); \ + ADD_TO_ATTR_MAP(map_key, value, attr) \ + } \ + void AddOpAttr(KEY_TYPE map_key, VALUE_TYPE value, AttrDefMap *attr_map) { \ + ADD_TO_ATTR_MAP(map_key, value, attr_map) \ + } \ + void AddModelAttr(KEY_TYPE map_key, VALUE_TYPE value, ModelDef *model_def) { \ + GE_CHECK_NOTNULL_JUST_RETURN(model_def); \ + auto attr = model_def->mutable_attr(); \ + ADD_TO_ATTR_MAP(map_key, value, attr) \ } -#define DEFINE_ADD_ATTR_VALUE_LIST(KEY_TYPE, VALUE_TYPE) \ - FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void AddOpAttrList(KEY_TYPE map_key, VALUE_TYPE value, \ - OpDef *op_def) { \ - GE_CHECK_NOTNULL_JUST_RETURN(op_def); \ - auto attr = op_def->mutable_attr(); \ - ADD_TO_ATTR_MAP_LIST(map_key, value, attr) \ - } \ - FMK_FUNC_DEV_VISIBILITY void AddOpAttrList(KEY_TYPE map_key, VALUE_TYPE value, AttrDefMap *attr_map) { \ - ADD_TO_ATTR_MAP_LIST(map_key, value, attr_map) \ - } \ - FMK_FUNC_DEV_VISIBILITY void AddModelAttrList(KEY_TYPE map_key, VALUE_TYPE value, ModelDef *model_def) { \ - GE_CHECK_NOTNULL_JUST_RETURN(model_def); \ - auto attr = model_def->mutable_attr(); \ - ADD_TO_ATTR_MAP_LIST(map_key, value, attr) \ +#define DEFINE_ADD_ATTR_VALUE_LIST(KEY_TYPE, VALUE_TYPE) \ + void AddOpAttrList(KEY_TYPE map_key, VALUE_TYPE value, OpDef *op_def) { \ + GE_CHECK_NOTNULL_JUST_RETURN(op_def); \ + auto attr = op_def->mutable_attr(); \ + ADD_TO_ATTR_MAP_LIST(map_key, value, attr) \ + } \ + void AddOpAttrList(KEY_TYPE map_key, VALUE_TYPE value, AttrDefMap *attr_map) { \ + ADD_TO_ATTR_MAP_LIST(map_key, value, attr_map)} FMK_FUNC_DEV_VISIBILITY void \ + AddModelAttrList(KEY_TYPE map_key, VALUE_TYPE value, ModelDef *model_def) { \ + GE_CHECK_NOTNULL_JUST_RETURN(model_def); \ + auto attr = model_def->mutable_attr(); \ + ADD_TO_ATTR_MAP_LIST(map_key, value, attr) \ } DEFINE_ADD_ATTR_VALUE(const std::string &, const std::string &); @@ -127,46 +123,42 @@ DEFINE_ADD_ATTR_VALUE_LIST(const std::string &, const bool); DEFINE_ADD_ATTR_VALUE_LIST(const std::string &, const int64_t); DEFINE_ADD_ATTR_VALUE_LIST(const std::string &, const std::string &); -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void AddOpAttr(const std::string &map_key, AttrDef &attr, - OpDef *op_def) { +void AddOpAttr(const std::string &map_key, AttrDef &attr, OpDef *op_def) { GE_CHECK_NOTNULL_JUST_RETURN(op_def); GE_CHECK_NOTNULL_JUST_RETURN(op_def->mutable_attr()); (void)op_def->mutable_attr()->insert(AttrDefPair(map_key, attr)); } -#define DEFINE_GET_ATTR_VALUE(ARG_TYPE_KEY, ARG_TYPE_VALUE, FIELD) \ - FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool GetAttrDefValue(ARG_TYPE_KEY map_key, ARG_TYPE_VALUE value, \ - const AttrDefMap &attr) { \ - auto it = attr.find(map_key); \ - if (it != attr.end()) { \ - *value = it->second.FIELD(); \ - return true; \ - } \ - return false; \ +#define DEFINE_GET_ATTR_VALUE(ARG_TYPE_KEY, ARG_TYPE_VALUE, FIELD) \ + bool GetAttrDefValue(ARG_TYPE_KEY map_key, ARG_TYPE_VALUE value, const AttrDefMap &attr) { \ + auto it = attr.find(map_key); \ + if (it != attr.end()) { \ + *value = it->second.FIELD(); \ + return true; \ + } \ + return false; \ } -#define DEFINE_GET_ATTR_POINT_REF(ARG_TYPE_KEY, ARG_TYPE_VALUE, FIELD) \ - FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool GetAttrDefValue(ARG_TYPE_KEY map_key, ARG_TYPE_VALUE *&value, \ - AttrDefMap *attr) { \ - GE_RT_FALSE_CHECK_NOTNULL(attr); \ - auto it = attr->find(map_key); \ - if (it != attr->end()) { \ - value = it->second.mutable_##FIELD(); \ - return true; \ - } \ - return false; \ +#define DEFINE_GET_ATTR_POINT_REF(ARG_TYPE_KEY, ARG_TYPE_VALUE, FIELD) \ + bool GetAttrDefValue(ARG_TYPE_KEY map_key, ARG_TYPE_VALUE *&value, AttrDefMap *attr) { \ + GE_RT_FALSE_CHECK_NOTNULL(attr); \ + auto it = attr->find(map_key); \ + if (it != attr->end()) { \ + value = it->second.mutable_##FIELD(); \ + return true; \ + } \ + return false; \ } -#define DEFINE_GET_ATTR_CONST_POINT_REF(ARG_TYPE_KEY, ARG_TYPE_VALUE, FIELD) \ - FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool GetAttrDefValue( \ - ARG_TYPE_KEY map_key, const ARG_TYPE_VALUE *&value, const AttrDefMap &attr) { \ - auto it = attr.find(map_key); \ - if (it == attr.end()) { \ - return false; \ - } \ - \ - value = &(it->second.FIELD()); \ - return true; \ +#define DEFINE_GET_ATTR_CONST_POINT_REF(ARG_TYPE_KEY, ARG_TYPE_VALUE, FIELD) \ + bool GetAttrDefValue(ARG_TYPE_KEY map_key, const ARG_TYPE_VALUE *&value, const AttrDefMap &attr) { \ + auto it = attr.find(map_key); \ + if (it == attr.end()) { \ + return false; \ + } \ + \ + value = &(it->second.FIELD()); \ + return true; \ } #define DEFINE_GET_BYTES_ATTR_VALUE(ARG_TYPE_KEY, ARG_TYPE_VALUE) \ @@ -216,16 +208,14 @@ DEFINE_GET_ATTR_CONST_POINT_REF(const std::string &, NamedAttrs, func); DEFINE_GET_BYTES_ATTR_VALUE(const std::string &, std::string *); -#define DEFINE_GET_OP_ATTR(ARG_TYPE_KEY, ARG_TYPE_VALUE) \ - FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool GetOpAttr(ARG_TYPE_KEY map_key, ARG_TYPE_VALUE value, \ - const OpDef *op_def) { \ - GE_RT_FALSE_CHECK_NOTNULL(op_def); \ - return GetAttrDefValue(map_key, value, op_def->attr()); \ - } \ - FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool GetModelAttr(ARG_TYPE_KEY map_key, ARG_TYPE_VALUE value, \ - const ModelDef *model_def) { \ - GE_RT_FALSE_CHECK_NOTNULL(model_def); \ - return GetAttrDefValue(map_key, value, model_def->attr()); \ +#define DEFINE_GET_OP_ATTR(ARG_TYPE_KEY, ARG_TYPE_VALUE) \ + bool GetOpAttr(ARG_TYPE_KEY map_key, ARG_TYPE_VALUE value, const OpDef *op_def) { \ + GE_RT_FALSE_CHECK_NOTNULL(op_def); \ + return GetAttrDefValue(map_key, value, op_def->attr()); \ + } \ + bool GetModelAttr(ARG_TYPE_KEY map_key, ARG_TYPE_VALUE value, const ModelDef *model_def) { \ + GE_RT_FALSE_CHECK_NOTNULL(model_def); \ + return GetAttrDefValue(map_key, value, model_def->attr()); \ } DEFINE_GET_OP_ATTR(const std::string &, std::string *); @@ -238,8 +228,7 @@ DEFINE_GET_OP_ATTR(const std::string &, bool *); DEFINE_GET_OP_ATTR(const std::string &, AttrDef_ListValue *); #define DEFINE_GET_BT_ATTR(ARG_TYPE_KEY, ARG_TYPE_VALUE) \ - FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool GetBytesAttr(ARG_TYPE_KEY key, ARG_TYPE_VALUE value, \ - const OpDef *op_def) { \ + bool GetBytesAttr(ARG_TYPE_KEY key, ARG_TYPE_VALUE value, const OpDef *op_def) { \ GE_RT_FALSE_CHECK_NOTNULL(op_def); \ return GetBytesValue(key, value, op_def->attr()); \ } \ @@ -250,7 +239,7 @@ DEFINE_GET_OP_ATTR(const std::string &, AttrDef_ListValue *); DEFINE_GET_BT_ATTR(const std::string &, std::string *); -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool HasOpAttr(const OpDef *op_def, const std::string &attr_name) { +bool HasOpAttr(const OpDef *op_def, const std::string &attr_name) { if (op_def == nullptr) { return false; } @@ -263,8 +252,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool HasOpAttr(const OpDef *op_ return false; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void AddModelAttr(const std::string &map_key, const void *value, - size_t size, ModelDef *model_def) { +void AddModelAttr(const std::string &map_key, const void *value, size_t size, ModelDef *model_def) { if (model_def == nullptr) { return; } @@ -280,8 +268,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void AddModelAttr(const std::st } } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void AddOpBytesAttr(const std::string &key, const void *value, - size_t size, OpDef *op_def) { +void AddOpBytesAttr(const std::string &key, const void *value, size_t size, OpDef *op_def) { if (op_def == nullptr) { return; } diff --git a/ge/common/op/ge_op_utils.cc b/ge/common/op/ge_op_utils.cc index 99b5733c..429ce909 100644 --- a/ge/common/op/ge_op_utils.cc +++ b/ge/common/op/ge_op_utils.cc @@ -115,8 +115,7 @@ const int NORMAL_TENSOR_SIZE = 4; #define AIPP_CONVERT_LIST_FLOAT(KEY, REQUIRED) AIPP_CONVERT_LIST_FORMAT(KEY, float, REQUIRED, GeAttrValue::FLOAT) -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status -OpUtils::ConvertAippParams(const GeAttrValue::NAMED_ATTRS &aipp_attr, domi::AippOpParams *aipp_params) { +Status OpUtils::ConvertAippParams(const GeAttrValue::NAMED_ATTRS &aipp_attr, domi::AippOpParams *aipp_params) { GE_CHECK_NOTNULL(aipp_params); AIPP_CONVERT_FORMAT_EX(aipp_mode, domi::AippOpParams::AippMode, int32_t, GeAttrValue::INT); AIPP_CONVERT_INT(related_input_rank); @@ -178,8 +177,7 @@ OpUtils::ConvertAippParams(const GeAttrValue::NAMED_ATTRS &aipp_attr, domi::Aipp return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status OpUtils::TransferDim(const std::vector &dim, - std::vector &dim_vector) { +Status OpUtils::TransferDim(const std::vector &dim, std::vector &dim_vector) { size_t input_shape_size = dim.size(); std::list new_dim_list; for (auto dim_temp : dim) { @@ -301,9 +299,9 @@ Status OpUtils::SetOutputSliceDataByDataType(void *data, int64_t data_size, cons return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status OpUtils::SetOutputSliceData( - void *data, int64_t data_size, int32_t data_type, std::vector &input_dims, std::vector &begin, - std::vector &output_dims, GeTensor *output, std::vector &stride) { +Status OpUtils::SetOutputSliceData(void *data, int64_t data_size, int32_t data_type, std::vector &input_dims, + std::vector &begin, std::vector &output_dims, GeTensor *output, + std::vector &stride) { if (data == nullptr || output == nullptr) { GELOGE(PARAM_INVALID, "[Check][Param]Input param is nullptr"); REPORT_INNER_ERROR("E19999", "Input param is nullptr"); @@ -352,9 +350,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status OpUtils::SetOutputSliceD return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void OpUtils::TransDataHWCK2KCHW(const void *input, int64_t h, - int64_t w, int64_t c, int64_t k, - void **output) { +void OpUtils::TransDataHWCK2KCHW(const void *input, int64_t h, int64_t w, int64_t c, int64_t k, void **output) { if (input == nullptr) { return; } @@ -386,9 +382,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void OpUtils::TransDataHWCK2KCH *output = buf; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void OpUtils::TransDataKCHW2HWCK(const void *input, int64_t k, - int64_t c, int64_t h, int64_t w, - void *output) { +void OpUtils::TransDataKCHW2HWCK(const void *input, int64_t k, int64_t c, int64_t h, int64_t w, void *output) { if ((input == nullptr) || (output == nullptr)) { GELOGD("%s[%d]: input param is nullptr.", __FILE__, __LINE__); return; @@ -417,31 +411,22 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void OpUtils::TransDataKCHW2HWC vector OpUtils::GetWeights(const ge::Node &node) { return OpDescUtils::GetWeights(node); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY vector OpUtils::GetWeights(ge::ConstNodePtr node) { - return OpDescUtils::GetWeights(node); -} +vector OpUtils::GetWeights(ge::ConstNodePtr node) { return OpDescUtils::GetWeights(node); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY vector OpUtils::MutableWeights(const ge::Node &node) { - return OpDescUtils::MutableWeights(node); -} +vector OpUtils::MutableWeights(const ge::Node &node) { return OpDescUtils::MutableWeights(node); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY vector OpUtils::MutableWeights(const ge::NodePtr node) { - return OpDescUtils::MutableWeights(node); -} +vector OpUtils::MutableWeights(const ge::NodePtr node) { return OpDescUtils::MutableWeights(node); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status OpUtils::SetWeights(ge::Node &node, - const vector &weights) { +Status OpUtils::SetWeights(ge::Node &node, const vector &weights) { return OpDescUtils::SetWeights(node, weights); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status OpUtils::SetWeights(ge::NodePtr node, - const vector &weights) { +Status OpUtils::SetWeights(ge::NodePtr node, const vector &weights) { return OpDescUtils::SetWeights(node, weights); } // The caller guarantees that the input sensor is constant -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status -OpUtils::GetShapeDataFromConstTensor(const ConstGeTensorPtr &tensor, DataType type, std::vector &dims) { +Status OpUtils::GetShapeDataFromConstTensor(const ConstGeTensorPtr &tensor, DataType type, std::vector &dims) { if (tensor == nullptr) { GELOGE(PARAM_INVALID, "[Check][Param]Input tensor is nullptr"); REPORT_INNER_ERROR("E19999", "Input tensor is nullptr"); diff --git a/ge/common/profiling/ge_profiling.cc b/ge/common/profiling/ge_profiling.cc index fcd01a12..a5857b35 100644 --- a/ge/common/profiling/ge_profiling.cc +++ b/ge/common/profiling/ge_profiling.cc @@ -23,7 +23,7 @@ #include "graph/ge_context.h" #include "init/gelib.h" #include "framework/common/ge_inner_error_codes.h" -#include "model/ge_model.h" +#include "common/model/ge_model.h" #include "framework/omg/omg_inner_types.h" namespace { diff --git a/ge/common/profiling/profiling_manager.cc b/ge/common/profiling/profiling_manager.cc index 0464491d..e8f41cc4 100644 --- a/ge/common/profiling/profiling_manager.cc +++ b/ge/common/profiling/profiling_manager.cc @@ -77,12 +77,12 @@ ProfilingManager::ProfilingManager() ProfilingManager::~ProfilingManager() {} -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ProfilingManager &ProfilingManager::Instance() { +ProfilingManager &ProfilingManager::Instance() { static ProfilingManager profiling_manager; return profiling_manager; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ge::Status ProfilingManager::Init(const Options &options) { +ge::Status ProfilingManager::Init(const Options &options) { #ifdef DAVINCI_SUPPORT_PROFILING vector().swap(device_id_); subscribe_count_ = 0; @@ -221,7 +221,7 @@ ge::Status ProfilingManager::ParseOptions(const std::string &options) { return ge::SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::StopProfiling() { +void ProfilingManager::StopProfiling() { #ifdef DAVINCI_SUPPORT_PROFILING uint64_t module = GetProfilingModule(); // The following if case will not be executed in normal case, inc case of ProfStopProfiling is abnormal @@ -259,8 +259,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::StopProf #endif } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::ProfilingOpInputOutInfo( - const TaskDescInfo &task, Json &task_json) { +void ProfilingManager::ProfilingOpInputOutInfo(const TaskDescInfo &task, Json &task_json) { #ifdef DAVINCI_SUPPORT_PROFILING for (size_t i = 0; i < task.input_format.size(); i++) { Json tmp_input; @@ -286,8 +285,8 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::Profilin #endif } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::ProfilingTaskDescInfo( - uint32_t model_id, const std::vector &task_desc_info, const int32_t &device_id) { +void ProfilingManager::ProfilingTaskDescInfo(uint32_t model_id, const std::vector &task_desc_info, + const int32_t &device_id) { #ifdef DAVINCI_SUPPORT_PROFILING for (const auto &task : task_desc_info) { Json task_info; @@ -324,8 +323,8 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::Profilin #endif } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::ProfileStepInfo( - uint64_t index_id, uint64_t model_id, uint16_t tag_id, rtStream_t stream, int32_t device_id) { +Status ProfilingManager::ProfileStepInfo(uint64_t index_id, uint64_t model_id, uint16_t tag_id, rtStream_t stream, + int32_t device_id) { #ifdef DAVINCI_SUPPORT_PROFILING if (!is_load_profiling_ && subscribe_count_ == 0) { GELOGD("Profiling is not turned on, no need to profile step info."); @@ -385,8 +384,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::Profil return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::ReportData( - const int32_t &device_id, const string &data, const string &tag_name) { +void ProfilingManager::ReportData(const int32_t &device_id, const string &data, const string &tag_name) { #ifdef DAVINCI_SUPPORT_PROFILING ReporterData reporter_data{}; int ret = -1; @@ -426,8 +424,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::ReportDa #endif } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::ReportProfilingData( - uint32_t model_id, const std::vector &task_desc_info) { +void ProfilingManager::ReportProfilingData(uint32_t model_id, const std::vector &task_desc_info) { #ifdef DAVINCI_SUPPORT_PROFILING int32_t logic_device_id = 0; rtError_t rt_ret = rtGetDevice(&logic_device_id); @@ -443,7 +440,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::ReportPr #endif } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY uint64_t ProfilingManager::GetProfilingModule() { +uint64_t ProfilingManager::GetProfilingModule() { uint64_t module = PROF_MODEL_EXECUTE_MASK | PROF_RUNTIME_API_MASK | PROF_RUNTIME_TRACE_MASK | @@ -485,8 +482,7 @@ void ProfilingManager::UpdateSubscribeDeviceModuleMap(std::string prof_type, uin #endif } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::ProfModelSubscribe( - uint64_t module, void *model) { +Status ProfilingManager::ProfModelSubscribe(uint64_t module, void *model) { #ifdef DAVINCI_SUPPORT_PROFILING std::lock_guard lock(mutex_); uint64_t model_load_mask = module & PROF_MODEL_LOAD_MASK; @@ -526,8 +522,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::ProfMo return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::ProfModelUnsubscribe( - void *model) { +Status ProfilingManager::ProfModelUnsubscribe(void *model) { #ifdef DAVINCI_SUPPORT_PROFILING std::lock_guard lock(mutex_); if (subscribe_count_ == 0) { @@ -568,7 +563,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::ProfMo return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::ProfInit(uint64_t module) { +Status ProfilingManager::ProfInit(uint64_t module) { #ifdef DAVINCI_SUPPORT_PROFILING std::lock_guard lock(mutex_); uint64_t model_load_mask = module & PROF_MODEL_LOAD_MASK; @@ -602,7 +597,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::ProfIn return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::ProfFinalize() { +Status ProfilingManager::ProfFinalize() { #ifdef DAVINCI_SUPPORT_PROFILING std::lock_guard lock(mutex_); is_load_profiling_ = false; @@ -697,8 +692,8 @@ Status ProfilingManager::ProfParseDeviceId(const std::map &config_para, - int32_t &device_num, vector &device_list) { +Status ProfilingManager::ProfParseParam(const std::map &config_para, int32_t &device_num, + vector &device_list) { #ifdef DAVINCI_SUPPORT_PROFILING // device num auto iter = config_para.find(kConfigNumsdev); @@ -747,8 +742,7 @@ Status ProfilingManager::ProfParseParam(const std::map return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::ProfStartProfiling( - uint64_t module, const std::map &config_para) { +Status ProfilingManager::ProfStartProfiling(uint64_t module, const std::map &config_para) { #ifdef DAVINCI_SUPPORT_PROFILING std::lock_guard lock(mutex_); uint64_t training_trace_mask = module & PROF_TRAINING_TRACE_MASK; @@ -803,8 +797,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::ProfSt return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::ProfStopProfiling(uint64_t module, - const std::map &config_para) { +Status ProfilingManager::ProfStopProfiling(uint64_t module, const std::map &config_para) { #ifdef DAVINCI_SUPPORT_PROFILING std::lock_guard lock(mutex_); int32_t device_num = 0; @@ -855,8 +848,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::ProfSt return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::UpdateDeviceIdModuleMap(string prof_type, - uint64_t module, const vector &device_list) { +void ProfilingManager::UpdateDeviceIdModuleMap(string prof_type, uint64_t module, const vector &device_list) { #ifdef DAVINCI_SUPPORT_PROFILING if (prof_type == kProfStart) { for (uint32_t i = 0; i < device_list.size(); i++) { @@ -886,7 +878,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::UpdateDe #endif } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool ProfilingManager::ProfilingModelExecuteOn() const { +bool ProfilingManager::ProfilingModelExecuteOn() const { int32_t logic_device_id = 0; rtError_t rt_ret = rtGetDevice(&logic_device_id); if (rt_ret != RT_ERROR_NONE) { @@ -904,7 +896,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool ProfilingManager::Profilin return execute_model_prof_on; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::PluginInit() { +Status ProfilingManager::PluginInit() { if (prof_cb_.msprofReporterCallback == nullptr) { GELOGE(ge::PARAM_INVALID, "[Check][Param]MsprofReporterCallback callback is nullptr"); REPORT_INNER_ERROR("E19999", "MsprofReporterCallback callback is nullptr"); @@ -933,7 +925,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::Plugin return SUCCESS; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::PluginUnInit() const { +void ProfilingManager::PluginUnInit() const { #ifdef DAVINCI_SUPPORT_PROFILING if (prof_cb_.msprofReporterCallback == nullptr) { GELOGE(ge::PARAM_INVALID, "[Check][Param]MsprofReporterCallback callback is nullptr"); @@ -950,8 +942,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::PluginUn #endif } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status ProfilingManager::CallMsprofReport( - ReporterData &reporter_data) const { +Status ProfilingManager::CallMsprofReport(ReporterData &reporter_data) const { if (prof_cb_.msprofReporterCallback == nullptr) { GELOGE(ge::PARAM_INVALID, "[Check][Param]MsprofReporterCallback callback is nullptr"); REPORT_INNER_ERROR("E19999", "MsprofReporterCallback callback is nullptr"); @@ -1007,14 +998,12 @@ void ProfilingManager::GetOpOutputInfo(const OpDescPtr &op, TaskDescInfo &task_d task_desc_info.output_data_type = output_data_type.empty() ? data_type_default : output_data_type; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::GetOpInputOutputInfo( - const OpDescPtr &op, TaskDescInfo &task_desc_info) const { +void ProfilingManager::GetOpInputOutputInfo(const OpDescPtr &op, TaskDescInfo &task_desc_info) const { GetOpInputInfo(op, task_desc_info); GetOpOutputInfo(op, task_desc_info); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::GetFpBpPoint( - std::string &fp_point, std::string &bp_point) { +void ProfilingManager::GetFpBpPoint(std::string &fp_point, std::string &bp_point) { // Env or options mode, fp_point_/bp_point_ have initiliazed on profiling init if (!fp_point_.empty() && !bp_point_.empty()) { fp_point = fp_point_; @@ -1025,7 +1014,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void ProfilingManager::GetFpBpP } // ProfApi mode and training trace is set // Parse options first - char env_profiling_options[MSPROF_OPTIONS_DEF_LEN_MAX] = { 0x00 }; + char env_profiling_options[MSPROF_OPTIONS_DEF_LEN_MAX] = {0x00}; bool is_profiling_valid = false; std::string profiling_options; if (ge::GetContext().GetOption(OPTION_EXEC_PROFILING_OPTIONS, profiling_options) == SUCCESS && diff --git a/ge/common/profiling/profiling_manager.h b/ge/common/profiling/profiling_manager.h index e5137562..86371d51 100755 --- a/ge/common/profiling/profiling_manager.h +++ b/ge/common/profiling/profiling_manager.h @@ -73,7 +73,7 @@ struct MsprofCallback { MsprofReporterCallback msprofReporterCallback; }; -class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ProfilingManager { +class ProfilingManager { public: ProfilingManager(); virtual ~ProfilingManager(); diff --git a/ge/common/properties_manager.cc b/ge/common/properties_manager.cc index 0c5ef1fe..aeabb008 100644 --- a/ge/common/properties_manager.cc +++ b/ge/common/properties_manager.cc @@ -35,13 +35,13 @@ PropertiesManager::PropertiesManager() : is_inited_(false), delimiter("=") {} PropertiesManager::~PropertiesManager() {} // singleton -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY PropertiesManager &PropertiesManager::Instance() { +PropertiesManager &PropertiesManager::Instance() { static PropertiesManager instance; return instance; } // Initialize property configuration -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool PropertiesManager::Init(const std::string &file_path) { +bool PropertiesManager::Init(const std::string &file_path) { std::lock_guard lock(mutex_); if (is_inited_) { GELOGW("Already inited, will be initialized again"); @@ -139,8 +139,7 @@ std::string PropertiesManager::Trim(const std::string &str) { } // Get property value, if not found, return "" -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY std::string PropertiesManager::GetPropertyValue( - const std::string &map_key) { +std::string PropertiesManager::GetPropertyValue(const std::string &map_key) { std::lock_guard lock(mutex_); auto iter = properties_map_.find(map_key); if (properties_map_.end() != iter) { @@ -151,21 +150,19 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY std::string PropertiesManager:: } // Set property value -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void PropertiesManager::SetPropertyValue(const std::string &map_key, - const std::string &value) { +void PropertiesManager::SetPropertyValue(const std::string &map_key, const std::string &value) { std::lock_guard lock(mutex_); properties_map_[map_key] = value; } // return properties_map_ -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY std::map -PropertiesManager::GetPropertyMap() { +std::map PropertiesManager::GetPropertyMap() { std::lock_guard lock(mutex_); return properties_map_; } // Set separator -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY void PropertiesManager::SetPropertyDelimiter(const std::string &de) { +void PropertiesManager::SetPropertyDelimiter(const std::string &de) { std::lock_guard lock(mutex_); delimiter = de; } diff --git a/ge/common/tbe_kernel_store.h b/ge/common/tbe_kernel_store.h index 6304af50..1492bdd9 100755 --- a/ge/common/tbe_kernel_store.h +++ b/ge/common/tbe_kernel_store.h @@ -21,7 +21,7 @@ namespace ge { -class FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY TBEKernelStore : public KernelStore { +class TBEKernelStore : public KernelStore { public: TBEKernelStore(); ~TBEKernelStore() {} diff --git a/ge/common/thread_pool.cc b/ge/common/thread_pool.cc index f9b7bb99..56f8ee60 100644 --- a/ge/common/thread_pool.cc +++ b/ge/common/thread_pool.cc @@ -26,7 +26,7 @@ #include "external/register/register_types.h" namespace ge { -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ThreadPool::ThreadPool(uint32_t size) : is_stoped_(false) { +ThreadPool::ThreadPool(uint32_t size) : is_stoped_(false) { idle_thrd_num_ = size < 1 ? 1 : size; for (uint32_t i = 0; i < idle_thrd_num_; ++i) { @@ -34,7 +34,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ThreadPool::ThreadPool(uint32_t } } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY ThreadPool::~ThreadPool() { +ThreadPool::~ThreadPool() { is_stoped_.store(true); { std::unique_lock lock{m_lock_}; diff --git a/ge/common/thread_pool.h b/ge/common/thread_pool.h index 7e52edcc..777a3c9b 100755 --- a/ge/common/thread_pool.h +++ b/ge/common/thread_pool.h @@ -37,7 +37,7 @@ namespace ge { using ThreadTask = std::function; -class GE_FUNC_DEV_VISIBILITY GE_FUNC_HOST_VISIBILITY ThreadPool { +class ThreadPool { public: explicit ThreadPool(uint32_t size = 4); ~ThreadPool(); diff --git a/ge/graph/common/transop_util.cc b/ge/common/transop_util.cc similarity index 97% rename from ge/graph/common/transop_util.cc rename to ge/common/transop_util.cc index 871ecdb1..914e80aa 100755 --- a/ge/graph/common/transop_util.cc +++ b/ge/common/transop_util.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "graph/common/transop_util.h" +#include "common/transop_util.h" -#include "framework/common/types.h" +#include "common/types.h" #include "graph/utils/type_utils.h" #include "framework/common/debug/ge_log.h" diff --git a/ge/graph/common/transop_util.h b/ge/common/transop_util.h similarity index 95% rename from ge/graph/common/transop_util.h rename to ge/common/transop_util.h index 883ae41b..57e4adad 100644 --- a/ge/graph/common/transop_util.h +++ b/ge/common/transop_util.h @@ -23,7 +23,7 @@ #include "graph/node.h" namespace ge { -class GE_FUNC_HOST_VISIBILITY GE_FUNC_DEV_VISIBILITY TransOpUtil { +class TransOpUtil { public: static bool IsTransOp(const NodePtr &node); diff --git a/ge/common/util.cc b/ge/common/util.cc index dfb5bac4..6d77dbc8 100644 --- a/ge/common/util.cc +++ b/ge/common/util.cc @@ -70,7 +70,7 @@ static bool ReadProtoFromCodedInputStream(CodedInputStream &coded_stream, Messag return proto->ParseFromCodedStream(&coded_stream); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool ReadProtoFromArray(const void *data, int size, Message *proto) { +bool ReadProtoFromArray(const void *data, int size, Message *proto) { GE_CHK_BOOL_TRUE_EXEC_WITH_LOG((proto == nullptr || data == nullptr || size == 0), return false, "incorrect parameter. proto is nullptr || data is nullptr || size is 0"); @@ -112,8 +112,7 @@ long GetFileLength(const std::string &input_file) { * @return false fail * @return true success */ -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool ReadBytesFromBinaryFile(const char *file_name, char **buffer, - int &length) { +bool ReadBytesFromBinaryFile(const char *file_name, char **buffer, int &length) { GE_CHK_BOOL_TRUE_EXEC_WITH_LOG((file_name == nullptr), return false, "incorrect parameter. file is nullptr"); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG((buffer == nullptr), return false, "incorrect parameter. buffer is nullptr"); @@ -141,8 +140,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool ReadBytesFromBinaryFile(co return true; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool ReadBytesFromBinaryFile(const char *file_name, - std::vector &buffer) { +bool ReadBytesFromBinaryFile(const char *file_name, std::vector &buffer) { GE_CHK_BOOL_TRUE_EXEC_WITH_LOG((file_name == nullptr), return false, "incorrect parameter. file path is null"); std::string real_path = RealPath(file_name); @@ -177,7 +175,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool ReadBytesFromBinaryFile(co * @return -1 fail * @return 0 success */ -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY int CreateDirectory(const std::string &directory_path) { +int CreateDirectory(const std::string &directory_path) { GE_CHK_BOOL_EXEC(!directory_path.empty(), return -1, "directory path is empty."); auto dir_path_len = directory_path.length(); if (dir_path_len >= MMPA_MAX_PATH) { @@ -219,7 +217,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY int CreateDirectory(const std:: return 0; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY std::string CurrentTimeInStr() { +std::string CurrentTimeInStr() { std::time_t now = std::time(nullptr); std::tm *ptm = std::localtime(&now); if (ptm == nullptr) { @@ -235,8 +233,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY std::string CurrentTimeInStr() return std::string(buffer); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool ReadProtoFromText(const char *file, - google::protobuf::Message *message) { +bool ReadProtoFromText(const char *file, google::protobuf::Message *message) { GE_CHK_BOOL_TRUE_EXEC_WITH_LOG((file == nullptr || message == nullptr), return false, "incorrect parameter. nullptr == file || nullptr == message"); @@ -266,8 +263,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool ReadProtoFromText(const ch return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool ReadProtoFromMem(const char *data, int size, - google::protobuf::Message *message) { +bool ReadProtoFromMem(const char *data, int size, google::protobuf::Message *message) { GE_CHK_BOOL_TRUE_EXEC_WITH_LOG((data == nullptr || message == nullptr), return false, "incorrect parameter. data is nullptr || message is nullptr"); std::string str(data, static_cast(size)); @@ -281,7 +277,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool ReadProtoFromMem(const cha return ret; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY uint64_t GetCurrentTimestamp() { +uint64_t GetCurrentTimestamp() { mmTimeval tv{}; int ret = mmGetTimeOfDay(&tv, nullptr); GE_LOGE_IF(ret != EN_OK, "Func gettimeofday may failed, ret:%d, errmsg:%s", ret, strerror(errno)); @@ -289,7 +285,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY uint64_t GetCurrentTimestamp() return static_cast(total_use_time); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY uint32_t GetCurrentSecondTimestap() { +uint32_t GetCurrentSecondTimestap() { mmTimeval tv{}; int ret = mmGetTimeOfDay(&tv, nullptr); GE_LOGE_IF(ret != EN_OK, "Func gettimeofday may failed, ret:%d, errmsg:%s", ret, strerror(errno)); @@ -297,7 +293,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY uint32_t GetCurrentSecondTimest return static_cast(total_use_time); } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool CheckInt64MulOverflow(int64_t a, int64_t b) { +bool CheckInt64MulOverflow(int64_t a, int64_t b) { if (a > 0) { if (b > 0) { if (a > (INT64_MAX / b)) { @@ -322,7 +318,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool CheckInt64MulOverflow(int6 return true; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY std::string RealPath(const char *path) { +std::string RealPath(const char *path) { GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(path == nullptr, return "", "path pointer is NULL."); GE_CHK_BOOL_TRUE_EXEC_WITH_LOG(strlen(path) >= MMPA_MAX_PATH, ErrorManager::GetInstance().ATCReportErrMessage("E19002", {"filepath", "size"}, @@ -349,8 +345,7 @@ void PathValidErrReport(const std::string &file_path, const std::string &atc_par } } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool CheckInputPathValid(const std::string &file_path, - const std::string &atc_param) { +bool CheckInputPathValid(const std::string &file_path, const std::string &atc_param) { // The specified path is empty std::map args_map; if (file_path.empty()) { @@ -395,8 +390,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool CheckInputPathValid(const return true; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY bool CheckOutputPathValid(const std::string &file_path, - const std::string &atc_param) { +bool CheckOutputPathValid(const std::string &file_path, const std::string &atc_param) { // The specified path is empty if (file_path.empty()) { if (!atc_param.empty()) { @@ -552,7 +546,7 @@ FMK_FUNC_HOST_VISIBILITY bool IsValidFile(const char *file_path) { return true; } -FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY Status CheckPath(const char *path, size_t length) { +Status CheckPath(const char *path, size_t length) { if (path == nullptr) { GELOGE(PARAM_INVALID, "[Check][Param]Config path is invalid"); REPORT_CALL_ERROR("E19999", "Config path is invalid"); diff --git a/ge/executor/CMakeLists.txt b/ge/executor/CMakeLists.txt index 44ba3131..54cb7639 100755 --- a/ge/executor/CMakeLists.txt +++ b/ge/executor/CMakeLists.txt @@ -1,13 +1,9 @@ set(SRC_LIST "ge_executor.cc" "../common/profiling/profiling_manager.cc" - "../common/ge/plugin_manager.cc" - "../common/ge/op_tiling_manager.cc" - "../common/dump/dump_properties.cc" - "../common/dump/exception_dumper.cc" - "../common/dump/dump_manager.cc" "../common/dump/dump_op.cc" "../common/dump/opdebug_register.cc" + "../common/dump/exception_dumper.cc" "../common/profiling/ge_profiling.cc" "../graph/load/graph_loader.cc" "../graph/execute/graph_execute.cc" @@ -22,8 +18,6 @@ set(SRC_LIST "../graph/manager/rdma_pool_allocator.cc" "../graph/manager/host_mem_allocator.cc" "../hybrid/node_executor/aicpu/aicpu_ext_info.cc" - "../model/ge_model.cc" - "../model/ge_root_model.cc" "../graph/load/model_manager/davinci_model.cc" "../graph/load/model_manager/model_manager.cc" "../graph/load/model_manager/tbe_handle_store.cc" @@ -55,7 +49,6 @@ set(SRC_LIST "../graph/load/model_manager/task_info/model_exit_task_info.cc" "../graph/load/model_manager/task_info/super_kernel/super_kernel_factory.cc" "../graph/load/model_manager/task_info/super_kernel/super_kernel.cc" - "../graph/common/local_context.cc" "../opskernel_manager/ops_kernel_builder_manager.cc" "../single_op/single_op_manager.cc" "../single_op/single_op_model.cc" @@ -102,7 +95,6 @@ set(SRC_LIST "../hybrid/node_executor/task_context.cc" "../hybrid/hybrid_davinci_model.cc" "../ge_local_engine/engine/host_cpu_engine.cc" - "../graph/common/omg_util.cc" "../graph/manager/host_mem_manager.cc" "../graph/build/memory/var_mem_assign_util.cc" "../host_kernels/transpose_kernel.cc" @@ -144,10 +136,6 @@ set(SRC_LIST "../host_kernels/transdata_kernel.cc" "../host_kernels/unpack_kernel.cc" "../graph/passes/pass_utils.cc" - "../graph/common/bcast.cc" - "../common/fp16_t.cc" - "../common/formats/format_transfers/format_transfer_transpose.cc" - "../common/formats/utils/formats_trans_utils.cc" ) ######## libge_executor.a ######## diff --git a/ge/executor/module.mk b/ge/executor/module.mk index 7a7e2b51..430efa75 100644 --- a/ge/executor/module.mk +++ b/ge/executor/module.mk @@ -63,7 +63,7 @@ local_ge_executor_src_files := \ ../single_op/task/aicpu_task_builder.cc \ ../single_op/task/aicpu_kernel_task_builder.cc \ ../hybrid/node_executor/aicpu/aicpu_ext_info.cc \ - ../graph/common/local_context.cc \ + ../common/local_context.cc \ ../hybrid/common/tensor_value.cc \ ../hybrid/common/npu_memory_allocator.cc \ ../hybrid/executor/rt_callback_manager.cc \ @@ -102,7 +102,7 @@ local_ge_executor_src_files := \ ../hybrid/node_executor/task_context.cc \ ../hybrid/hybrid_davinci_model.cc \ ../ge_local_engine/engine/host_cpu_engine.cc \ - ../graph/common/omg_util.cc \ + ../common/omg_util.cc \ ../graph/manager/host_mem_manager.cc \ ../graph/build/memory/var_mem_assign_util.cc \ ../host_kernels/transpose_kernel.cc \ @@ -144,7 +144,7 @@ local_ge_executor_src_files := \ ../host_kernels/transdata_kernel.cc \ ../host_kernels/unpack_kernel.cc \ ../graph/passes/pass_utils.cc \ - ../graph/common/bcast.cc \ + ../common/bcast.cc \ ../common/fp16_t.cc \ ../common/formats/format_transfers/format_transfer_transpose.cc \ ../common/formats/utils/formats_trans_utils.cc \ diff --git a/ge/ge_inference.mk b/ge/ge_inference.mk index a56eaadf..3fd8be1a 100755 --- a/ge/ge_inference.mk +++ b/ge/ge_inference.mk @@ -80,7 +80,7 @@ ANALYZER_SRC_FILES:= \ OMG_HOST_SRC_FILES := \ model/ge_model.cc \ model/ge_root_model.cc \ - graph/common/transop_util.cc \ + common/transop_util.cc \ graph/passes/pass_manager.cc \ graph/passes/resource_pair_add_control_pass.cc \ graph/passes/resource_pair_remove_control_pass.cc \ @@ -115,9 +115,9 @@ OMG_HOST_SRC_FILES := \ graph/passes/mark_graph_unknown_status_pass.cc \ graph/passes/mark_node_unknown_shape_pass.cc \ graph/passes/mark_agnostic_pass.cc \ - graph/common/omg_util.cc \ - graph/common/bcast.cc \ - graph/common/local_context.cc \ + common/omg_util.cc \ + common/bcast.cc \ + common/local_context.cc \ graph/passes/dimension_compute_pass.cc \ graph/passes/dimension_adjust_pass.cc \ graph/passes/get_original_format_pass.cc \ diff --git a/ge/ge_runner.mk b/ge/ge_runner.mk index 8ca8572c..d6462542 100644 --- a/ge/ge_runner.mk +++ b/ge/ge_runner.mk @@ -43,10 +43,10 @@ LIBGE_LOCAL_SRC_FILES := \ graph/build/stream_allocator.cc \ graph/build/stream_graph_optimizer.cc \ graph/build/task_generator.cc \ - graph/common/bcast.cc \ - graph/common/local_context.cc \ - graph/common/omg_util.cc \ - graph/common/transop_util.cc \ + common/bcast.cc \ + common/local_context.cc \ + common/omg_util.cc \ + common/transop_util.cc \ graph/execute/graph_execute.cc \ graph/label/case_label_maker.cc \ graph/label/if_label_maker.cc \ diff --git a/ge/generator/ge_generator.cc b/ge/generator/ge_generator.cc index 07355ab5..45eaed59 100644 --- a/ge/generator/ge_generator.cc +++ b/ge/generator/ge_generator.cc @@ -36,7 +36,7 @@ #include "graph/utils/graph_utils.h" #include "graph/utils/type_utils.h" #include "init/gelib.h" -#include "model/ge_model.h" +#include "common/model/ge_model.h" #include "analyzer/analyzer.h" using std::map; diff --git a/ge/graph/build/graph_builder.cc b/ge/graph/build/graph_builder.cc index 96dea02e..e1398d1f 100644 --- a/ge/graph/build/graph_builder.cc +++ b/ge/graph/build/graph_builder.cc @@ -21,14 +21,14 @@ #include "graph/build/logical_stream_allocator.h" #include "graph/build/run_context.h" #include "graph/build/stream_graph_optimizer.h" -#include "graph/common/ge_call_wrapper.h" +#include "common/ge_call_wrapper.h" #include "graph/ge_context.h" #include "graph/manager/graph_var_manager.h" #include "graph/passes/mark_same_addr_pass.h" #include "graph/utils/node_utils.h" #include "graph/utils/type_utils.h" #include "init/gelib.h" -#include "model/ge_model.h" +#include "common/model/ge_model.h" #include "graph/ge_context.h" #include "opskernel_manager/ops_kernel_builder_manager.h" #include "graph/utils/op_desc_utils.h" diff --git a/ge/graph/build/graph_builder.h b/ge/graph/build/graph_builder.h index c4b16814..6ed14dae 100644 --- a/ge/graph/build/graph_builder.h +++ b/ge/graph/build/graph_builder.h @@ -38,7 +38,7 @@ #include "graph/partition/graph_partition.h" #include "graph/utils/graph_utils.h" #include "graph/utils/tensor_utils.h" -#include "model/ge_root_model.h" +#include "common/model/ge_root_model.h" namespace ge { class GraphBuilder { diff --git a/ge/graph/build/logical_stream_allocator.cc b/ge/graph/build/logical_stream_allocator.cc index 58763aa9..3d6ca74a 100644 --- a/ge/graph/build/logical_stream_allocator.cc +++ b/ge/graph/build/logical_stream_allocator.cc @@ -22,7 +22,7 @@ #include "framework/common/types.h" #include "graph/debug/ge_attr_define.h" #include "graph/utils/graph_utils.h" -#include "graph/common/ge_call_wrapper.h" +#include "common/ge_call_wrapper.h" using std::map; using std::set; diff --git a/ge/graph/build/memory/block_mem_assigner.cc b/ge/graph/build/memory/block_mem_assigner.cc index 159e68a7..7d0db676 100755 --- a/ge/graph/build/memory/block_mem_assigner.cc +++ b/ge/graph/build/memory/block_mem_assigner.cc @@ -34,7 +34,7 @@ #include "graph/debug/ge_attr_define.h" -#include "graph/common/local_context.h" +#include "common/local_context.h" #include "graph/optimize/common/params.h" #include "framework/omg/omg_inner_types.h" #include "runtime/mem.h" diff --git a/ge/graph/build/memory/buffer_pool_mem_assigner.cc b/ge/graph/build/memory/buffer_pool_mem_assigner.cc index d66fe038..ca197e02 100644 --- a/ge/graph/build/memory/buffer_pool_mem_assigner.cc +++ b/ge/graph/build/memory/buffer_pool_mem_assigner.cc @@ -15,7 +15,7 @@ */ #include "graph/build/memory/buffer_pool_mem_assigner.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/utils/tensor_utils.h" #include "framework/common/util.h" #include "graph/compute_graph.h" diff --git a/ge/graph/build/memory/graph_mem_assigner.cc b/ge/graph/build/memory/graph_mem_assigner.cc index e086940a..f8878383 100755 --- a/ge/graph/build/memory/graph_mem_assigner.cc +++ b/ge/graph/build/memory/graph_mem_assigner.cc @@ -24,7 +24,7 @@ #include "graph/build/memory/hybrid_mem_assigner.h" #include "graph/build/memory/var_mem_assign_util.h" #include "graph/build/memory/block_mem_assigner.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/debug/ge_attr_define.h" #include "graph/ge_attr_value.h" #include "graph/manager/graph_var_manager.h" diff --git a/ge/graph/build/memory/var_mem_assign_util.cc b/ge/graph/build/memory/var_mem_assign_util.cc index adddf6bd..dc7c3b01 100755 --- a/ge/graph/build/memory/var_mem_assign_util.cc +++ b/ge/graph/build/memory/var_mem_assign_util.cc @@ -18,7 +18,7 @@ #include #include "framework/common/types.h" #include "framework/common/debug/ge_log.h" -#include "graph/common/transop_util.h" +#include "common/transop_util.h" #include "graph/debug/ge_attr_define.h" #include "graph/manager/graph_mem_allocator.h" #include "graph/manager/graph_var_manager.h" diff --git a/ge/graph/build/model_builder.cc b/ge/graph/build/model_builder.cc index 2816f170..897be1f8 100755 --- a/ge/graph/build/model_builder.cc +++ b/ge/graph/build/model_builder.cc @@ -25,9 +25,9 @@ #include "external/graph/attr_value.h" #include "graph/buffer.h" #include "graph/build/stream_allocator.h" -#include "graph/common/omg_util.h" -#include "graph/common/ge_call_wrapper.h" -#include "graph/common/local_context.h" +#include "common/omg_util.h" +#include "common/ge_call_wrapper.h" +#include "common/local_context.h" #include "graph/debug/ge_attr_define.h" #include "graph/ge_attr_value.h" #include "graph/ge_context.h" diff --git a/ge/graph/build/model_builder.h b/ge/graph/build/model_builder.h index 151e6006..d87976dd 100644 --- a/ge/graph/build/model_builder.h +++ b/ge/graph/build/model_builder.h @@ -32,7 +32,7 @@ #include "graph/manager/graph_manager_utils.h" #include "graph/model.h" #include "graph/node.h" -#include "model/ge_model.h" +#include "common/model/ge_model.h" #include "framework/omg/omg_inner_types.h" namespace ge { diff --git a/ge/graph/build/run_context.cc b/ge/graph/build/run_context.cc index e7f07c0a..e629bddc 100644 --- a/ge/graph/build/run_context.cc +++ b/ge/graph/build/run_context.cc @@ -18,7 +18,7 @@ #include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "graph/debug/ge_attr_define.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" namespace ge { RunContextUtil::~RunContextUtil() { DestroyRtModelResources(); } diff --git a/ge/graph/build/stream_allocator.cc b/ge/graph/build/stream_allocator.cc index bc34a228..987a77f7 100644 --- a/ge/graph/build/stream_allocator.cc +++ b/ge/graph/build/stream_allocator.cc @@ -22,7 +22,7 @@ #include "framework/common/fmk_error_codes.h" #include "framework/common/types.h" #include "graph/build/logical_stream_allocator.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/debug/ge_attr_define.h" #include "graph/ge_context.h" #include "graph/utils/graph_utils.h" diff --git a/ge/graph/build/task_generator.cc b/ge/graph/build/task_generator.cc index 67289f73..7bb2e2f6 100755 --- a/ge/graph/build/task_generator.cc +++ b/ge/graph/build/task_generator.cc @@ -29,7 +29,7 @@ #include "graph/utils/node_utils.h" #include "graph/utils/tensor_utils.h" #include "graph/utils/type_utils.h" -#include "graph/common/ge_call_wrapper.h" +#include "common/ge_call_wrapper.h" #include "init/gelib.h" #include "graph/ge_local_context.h" #include "external/ge/ge_api_types.h" diff --git a/ge/graph/execute/model_executor.cc b/ge/graph/execute/model_executor.cc index d1683f1d..993ba8c3 100644 --- a/ge/graph/execute/model_executor.cc +++ b/ge/graph/execute/model_executor.cc @@ -18,8 +18,8 @@ #include "graph/ge_context.h" #include "graph/debug/ge_attr_define.h" -#include "graph/common/ge_call_wrapper.h" -#include "graph/common/local_context.h" +#include "common/ge_call_wrapper.h" +#include "common/local_context.h" #include "graph/manager/graph_var_manager.h" #include "graph/utils/tensor_adapter.h" #include "graph/load/graph_loader.h" diff --git a/ge/graph/load/model_manager/davinci_model.cc b/ge/graph/load/model_manager/davinci_model.cc index 1d6f7aff..aba06173 100755 --- a/ge/graph/load/model_manager/davinci_model.cc +++ b/ge/graph/load/model_manager/davinci_model.cc @@ -32,7 +32,7 @@ #include "common/thread_pool.h" #include "framework/common/debug/ge_log.h" #include "framework/common/util.h" -#include "graph/common/ge_call_wrapper.h" +#include "common/ge_call_wrapper.h" #include "graph/compute_graph.h" #include "graph/debug/ge_attr_define.h" #include "graph/ge_context.h" @@ -57,9 +57,9 @@ #include "runtime/rt_model.h" #include "runtime/stream.h" #include "securec.h" -#include "graph/common/local_context.h" +#include "common/local_context.h" #include "common/formats/utils/formats_trans_utils.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/build/memory/block_mem_assigner.h" #include "graph/manager/session_scope_mem_allocator.h" #include "framework/omg/omg_inner_types.h" diff --git a/ge/graph/load/model_manager/davinci_model.h b/ge/graph/load/model_manager/davinci_model.h index 4ff36677..fe89f66f 100755 --- a/ge/graph/load/model_manager/davinci_model.h +++ b/ge/graph/load/model_manager/davinci_model.h @@ -49,7 +49,7 @@ #include "mmpa/mmpa_api.h" #include "proto/task.pb.h" #include "graph/load/model_manager/task_info/task_info.h" -#include "graph/common/local_context.h" +#include "common/local_context.h" using std::mutex; using std::thread; diff --git a/ge/graph/load/model_manager/model_manager.cc b/ge/graph/load/model_manager/model_manager.cc index 5af503b2..d0d88e66 100755 --- a/ge/graph/load/model_manager/model_manager.cc +++ b/ge/graph/load/model_manager/model_manager.cc @@ -23,9 +23,9 @@ #include "common/dump/dump_manager.h" #include "framework/common/l2_cache_optimize.h" #include "common/profiling/profiling_manager.h" -#include "graph/common/ge_call_wrapper.h" +#include "common/ge_call_wrapper.h" #include "graph/load/model_manager/davinci_model.h" -#include "model/ge_root_model.h" +#include "common/model/ge_root_model.h" #include "common/formats/utils/formats_trans_utils.h" namespace ge { diff --git a/ge/graph/load/model_manager/model_manager.h b/ge/graph/load/model_manager/model_manager.h index 63a03dd7..6389d6db 100755 --- a/ge/graph/load/model_manager/model_manager.h +++ b/ge/graph/load/model_manager/model_manager.h @@ -17,7 +17,7 @@ #ifndef GE_GRAPH_LOAD_NEW_MODEL_MANAGER_MODEL_MANAGER_H_ #define GE_GRAPH_LOAD_NEW_MODEL_MANAGER_MODEL_MANAGER_H_ -#include +#include #include #include #include diff --git a/ge/graph/manager/graph_manager.cc b/ge/graph/manager/graph_manager.cc index 84ed3ab0..7d72d85b 100755 --- a/ge/graph/manager/graph_manager.cc +++ b/ge/graph/manager/graph_manager.cc @@ -29,9 +29,9 @@ #include "common/dump/dump_manager.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" -#include "graph/common/transop_util.h" +#include "common/ge_call_wrapper.h" +#include "common/local_context.h" +#include "common/transop_util.h" #include "graph/ge_context.h" #include "graph/ge_global_options.h" #include "graph/manager/util/rt_context_util.h" @@ -103,8 +103,8 @@ #include "inc/pass_manager.h" #include "init/gelib.h" #include "ir_build/option_utils.h" -#include "graph/common/local_context.h" -#include "graph/common/omg_util.h" +#include "common/local_context.h" +#include "common/omg_util.h" #include "common/formats/utils/formats_trans_utils.h" #include "register/custom_pass_helper.h" #include "external/graph/types.h" diff --git a/ge/graph/manager/graph_manager.h b/ge/graph/manager/graph_manager.h index 763654bd..84d2b11e 100644 --- a/ge/graph/manager/graph_manager.h +++ b/ge/graph/manager/graph_manager.h @@ -38,7 +38,7 @@ #include "graph/partition/graph_partition.h" #include "graph/preprocess/graph_preprocess.h" #include "graph/tuning_utils.h" -#include "model/ge_model.h" +#include "common/model/ge_model.h" #include "common/executor.h" namespace ge { diff --git a/ge/graph/manager/graph_manager_utils.h b/ge/graph/manager/graph_manager_utils.h index 9cec6b6d..14eb67f2 100644 --- a/ge/graph/manager/graph_manager_utils.h +++ b/ge/graph/manager/graph_manager_utils.h @@ -33,11 +33,11 @@ #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "graph/compute_graph.h" -#include "graph/common/local_context.h" +#include "common/local_context.h" #include "external/graph/graph.h" #include "graph/model.h" -#include "model/ge_model.h" -#include "model/ge_root_model.h" +#include "common/model/ge_model.h" +#include "common/model/ge_root_model.h" #include "external/register/register_fmk_types.h" #include "external/ge/ge_api_types.h" diff --git a/ge/graph/optimize/graph_optimize.cc b/ge/graph/optimize/graph_optimize.cc index 55f374eb..a321ed43 100644 --- a/ge/graph/optimize/graph_optimize.cc +++ b/ge/graph/optimize/graph_optimize.cc @@ -17,7 +17,7 @@ #include "graph/optimize/graph_optimize.h" #include "graph/ge_context.h" -#include "graph/common/local_context.h" +#include "common/local_context.h" #include "graph/passes/dimension_adjust_pass.h" #include "inc/pass_manager.h" #include "init/gelib.h" diff --git a/ge/graph/optimize/mem_rw_conflict_optimize.cc b/ge/graph/optimize/mem_rw_conflict_optimize.cc index 7e7ab908..2edb1828 100644 --- a/ge/graph/optimize/mem_rw_conflict_optimize.cc +++ b/ge/graph/optimize/mem_rw_conflict_optimize.cc @@ -17,7 +17,7 @@ #include #include "common/ge/ge_util.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/debug/ge_attr_define.h" #include "graph/optimize/graph_optimize.h" #include "graph/utils/graph_utils.h" diff --git a/ge/graph/partition/dynamic_shape_partition.cc b/ge/graph/partition/dynamic_shape_partition.cc index 8fc19ff2..cd98b6c5 100755 --- a/ge/graph/partition/dynamic_shape_partition.cc +++ b/ge/graph/partition/dynamic_shape_partition.cc @@ -31,7 +31,7 @@ #include "graph/debug/ge_attr_define.h" #include "graph/utils/graph_utils.h" #include "graph/utils/op_desc_utils.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #define REQUIRE(cond, ...) \ do { \ diff --git a/ge/graph/partition/graph_partition.cc b/ge/graph/partition/graph_partition.cc index 6f221d97..86c9f1fd 100755 --- a/ge/graph/partition/graph_partition.cc +++ b/ge/graph/partition/graph_partition.cc @@ -28,7 +28,7 @@ #include "framework/common/types.h" #include "graph/debug/ge_attr_define.h" #include "graph/manager/graph_manager_utils.h" -#include "graph/common/ge_call_wrapper.h" +#include "common/ge_call_wrapper.h" #include "graph/utils/graph_utils.h" #include "graph/utils/op_desc_utils.h" #include "graph/utils/type_utils.h" diff --git a/ge/graph/partition/graph_partition.h b/ge/graph/partition/graph_partition.h index 560aa9e7..6c21fabe 100644 --- a/ge/graph/partition/graph_partition.h +++ b/ge/graph/partition/graph_partition.h @@ -70,6 +70,8 @@ class GraphPartitioner { // Return all subgraphs const Graph2SubGraphInfoList &GetSubGraphMap(); + const Graph2InputNodesSubGraphInfo &GetSubGraphInfoMap() {return graph_2_input_subgraph_; } + private: Status MergeSubGraph(ge::ComputeGraphPtr &output_merged_compute_graph, const ge::ComputeGraphPtr &original_compute_graph); diff --git a/ge/graph/passes/atomic_addr_clean_pass.cc b/ge/graph/passes/atomic_addr_clean_pass.cc index cc22d126..13700e2e 100755 --- a/ge/graph/passes/atomic_addr_clean_pass.cc +++ b/ge/graph/passes/atomic_addr_clean_pass.cc @@ -24,7 +24,7 @@ #include "framework/common/ge_inner_error_codes.h" #include "common/ge/ge_util.h" -#include "graph/common/ge_call_wrapper.h" +#include "common/ge_call_wrapper.h" #include "graph/debug/ge_attr_define.h" #include "graph/utils/node_utils.h" #include "init/gelib.h" diff --git a/ge/graph/passes/attach_stream_label_pass.cc b/ge/graph/passes/attach_stream_label_pass.cc index bcf86bc2..71d74500 100644 --- a/ge/graph/passes/attach_stream_label_pass.cc +++ b/ge/graph/passes/attach_stream_label_pass.cc @@ -16,7 +16,7 @@ #include "graph/passes/attach_stream_label_pass.h" #include "external/ge/ge_api_types.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" using std::string; diff --git a/ge/graph/passes/buffer_pool_memory_pass.cc b/ge/graph/passes/buffer_pool_memory_pass.cc index 8a64da59..deb25325 100644 --- a/ge/graph/passes/buffer_pool_memory_pass.cc +++ b/ge/graph/passes/buffer_pool_memory_pass.cc @@ -18,7 +18,7 @@ #include #include -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/utils/node_utils.h" #include "graph/utils/tensor_utils.h" #include "graph/utils/op_desc_utils.h" diff --git a/ge/graph/passes/cast_remove_pass.cc b/ge/graph/passes/cast_remove_pass.cc index 564b311d..1e1f4eb4 100644 --- a/ge/graph/passes/cast_remove_pass.cc +++ b/ge/graph/passes/cast_remove_pass.cc @@ -18,7 +18,7 @@ #include #include #include "framework/common/debug/ge_log.h" -#include "graph/common/transop_util.h" +#include "common/transop_util.h" #include "graph/debug/ge_attr_define.h" #include "graph/utils/type_utils.h" diff --git a/ge/graph/passes/cast_translate_pass.cc b/ge/graph/passes/cast_translate_pass.cc index d49424c8..704faeda 100644 --- a/ge/graph/passes/cast_translate_pass.cc +++ b/ge/graph/passes/cast_translate_pass.cc @@ -22,7 +22,7 @@ #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/debug/ge_attr_define.h" #include "graph/passes/pass_utils.h" #include "graph/utils/node_utils.h" diff --git a/ge/graph/passes/compile_nodes_pass.cc b/ge/graph/passes/compile_nodes_pass.cc index 1e734178..c5976f11 100755 --- a/ge/graph/passes/compile_nodes_pass.cc +++ b/ge/graph/passes/compile_nodes_pass.cc @@ -22,7 +22,7 @@ #include "framework/common/ge_inner_error_codes.h" #include "framework/common/debug/ge_log.h" #include "graph/debug/ge_attr_define.h" -#include "graph/common/ge_call_wrapper.h" +#include "common/ge_call_wrapper.h" #include "graph/op_desc.h" using domi::ImplyType; diff --git a/ge/graph/passes/control_trigger_pass.cc b/ge/graph/passes/control_trigger_pass.cc index 85505dc5..d81edefd 100644 --- a/ge/graph/passes/control_trigger_pass.cc +++ b/ge/graph/passes/control_trigger_pass.cc @@ -17,7 +17,7 @@ #include "graph/passes/control_trigger_pass.h" #include #include "common/ge/ge_util.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/utils/type_utils.h" namespace ge { diff --git a/ge/graph/passes/dimension_adjust_pass.h b/ge/graph/passes/dimension_adjust_pass.h index a84f0d8d..cba283ed 100755 --- a/ge/graph/passes/dimension_adjust_pass.h +++ b/ge/graph/passes/dimension_adjust_pass.h @@ -21,7 +21,7 @@ #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "framework/common/types.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/passes/base_pass.h" #include "graph/utils/attr_utils.h" #include "graph/utils/graph_utils.h" diff --git a/ge/graph/passes/flow_ctrl_pass.cc b/ge/graph/passes/flow_ctrl_pass.cc index 87896dc3..e75a4592 100755 --- a/ge/graph/passes/flow_ctrl_pass.cc +++ b/ge/graph/passes/flow_ctrl_pass.cc @@ -22,7 +22,7 @@ #include "framework/common/debug/ge_log.h" #include "graph/debug/ge_attr_define.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "common/ge/ge_util.h" #include "graph/manager/graph_var_manager.h" #include "graph/passes/pass_utils.h" diff --git a/ge/graph/passes/get_original_format_pass.cc b/ge/graph/passes/get_original_format_pass.cc index 4b27dd0e..0da4c5cc 100644 --- a/ge/graph/passes/get_original_format_pass.cc +++ b/ge/graph/passes/get_original_format_pass.cc @@ -25,7 +25,7 @@ #include "framework/omg/omg_inner_types.h" #include "graph/utils/attr_utils.h" #include "graph/utils/op_desc_utils.h" -#include "graph/common/local_context.h" +#include "common/local_context.h" using domi::DOMI_TENSOR_NCHW; using domi::DOMI_TENSOR_NHWC; diff --git a/ge/graph/passes/guarantee_const_pass.cc b/ge/graph/passes/guarantee_const_pass.cc index b1df73a9..06bc821c 100644 --- a/ge/graph/passes/guarantee_const_pass.cc +++ b/ge/graph/passes/guarantee_const_pass.cc @@ -21,7 +21,7 @@ #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" #include "framework/common/types.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/utils/attr_utils.h" #include "graph/utils/graph_utils.h" #include "graph/utils/type_utils.h" diff --git a/ge/graph/passes/hccl_tailing_optimization_pass.cc b/ge/graph/passes/hccl_tailing_optimization_pass.cc index d952885d..fe606067 100644 --- a/ge/graph/passes/hccl_tailing_optimization_pass.cc +++ b/ge/graph/passes/hccl_tailing_optimization_pass.cc @@ -14,7 +14,7 @@ * limitations under the License. */ #include "graph/passes/hccl_tailing_optimization_pass.h" -#include "graph/common/transop_util.h" +#include "common/transop_util.h" namespace ge { Status HcclTailingOptimizationPass::Run(ComputeGraphPtr graph) { diff --git a/ge/graph/passes/identity_pass.cc b/ge/graph/passes/identity_pass.cc index f0653983..0a346bb1 100755 --- a/ge/graph/passes/identity_pass.cc +++ b/ge/graph/passes/identity_pass.cc @@ -19,7 +19,7 @@ #include #include #include "framework/common/debug/ge_log.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/utils/node_utils.h" #include "graph/utils/attr_utils.h" #include "graph/debug/ge_attr_define.h" diff --git a/ge/graph/passes/infershape_pass.cc b/ge/graph/passes/infershape_pass.cc index 60a2f09a..a5e64519 100755 --- a/ge/graph/passes/infershape_pass.cc +++ b/ge/graph/passes/infershape_pass.cc @@ -22,7 +22,7 @@ #include "graph/shape_refiner.h" #include "graph/utils/graph_utils.h" #include "graph/utils/node_utils.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/debug/ge_attr_define.h" #include "graph/utils/tensor_utils.h" #include "graph/utils/type_utils.h" diff --git a/ge/graph/passes/iterator_op_pass.cc b/ge/graph/passes/iterator_op_pass.cc index d1de809d..57416017 100644 --- a/ge/graph/passes/iterator_op_pass.cc +++ b/ge/graph/passes/iterator_op_pass.cc @@ -26,7 +26,7 @@ #include "common/ge/ge_util.h" #include "framework/common/debug/ge_log.h" #include "graph/anchor.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "external/graph/graph.h" #include "graph/node.h" #include "graph/passes/pass_utils.h" diff --git a/ge/graph/passes/mark_force_unknown_for_cond_pass.cc b/ge/graph/passes/mark_force_unknown_for_cond_pass.cc index 67b6c617..3989e54f 100644 --- a/ge/graph/passes/mark_force_unknown_for_cond_pass.cc +++ b/ge/graph/passes/mark_force_unknown_for_cond_pass.cc @@ -17,7 +17,7 @@ #include "graph/passes/mark_force_unknown_for_cond_pass.h" #include "graph/utils/node_utils.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" namespace ge { namespace { diff --git a/ge/graph/passes/mark_node_unknown_shape_pass.cc b/ge/graph/passes/mark_node_unknown_shape_pass.cc index c040e846..eadd3ca7 100644 --- a/ge/graph/passes/mark_node_unknown_shape_pass.cc +++ b/ge/graph/passes/mark_node_unknown_shape_pass.cc @@ -17,7 +17,7 @@ #include "graph/passes/mark_node_unknown_shape_pass.h" #include "graph/utils/node_utils.h" #include "graph/debug/ge_attr_define.h" -#include "graph/common/local_context.h" +#include "common/local_context.h" namespace ge { namespace { diff --git a/ge/graph/passes/merge_input_memcpy_pass.cc b/ge/graph/passes/merge_input_memcpy_pass.cc index 044d4ad9..97a17d99 100644 --- a/ge/graph/passes/merge_input_memcpy_pass.cc +++ b/ge/graph/passes/merge_input_memcpy_pass.cc @@ -18,7 +18,7 @@ #include "common/ge/ge_util.h" #include "external/ge/ge_api_types.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" namespace ge { Status MergeInputMemcpyPass::Run(ComputeGraphPtr graph) { diff --git a/ge/graph/passes/merge_pass.cc b/ge/graph/passes/merge_pass.cc index fec9c6d0..2ddfcaab 100644 --- a/ge/graph/passes/merge_pass.cc +++ b/ge/graph/passes/merge_pass.cc @@ -22,7 +22,7 @@ #include "framework/common/debug/ge_log.h" #include "common/ge/ge_util.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/debug/ge_attr_define.h" #include "graph/utils/graph_utils.h" #include "graph/passes/pass_utils.h" diff --git a/ge/graph/passes/merge_to_stream_merge_pass.cc b/ge/graph/passes/merge_to_stream_merge_pass.cc index c58def59..e91410e1 100644 --- a/ge/graph/passes/merge_to_stream_merge_pass.cc +++ b/ge/graph/passes/merge_to_stream_merge_pass.cc @@ -17,7 +17,7 @@ #include "graph/passes/merge_to_stream_merge_pass.h" #include "common/ge/ge_util.h" #include "external/ge/ge_api_types.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" namespace ge { Status MergeToStreamMergePass::Run(ComputeGraphPtr graph) { diff --git a/ge/graph/passes/multi_batch_clone_pass.cc b/ge/graph/passes/multi_batch_clone_pass.cc index d36b4186..b25239b1 100755 --- a/ge/graph/passes/multi_batch_clone_pass.cc +++ b/ge/graph/passes/multi_batch_clone_pass.cc @@ -18,14 +18,14 @@ #include "common/formats/utils/formats_trans_utils.h" #include "common/ge/ge_util.h" -#include "graph/common/local_context.h" +#include "common/local_context.h" #include "graph/preprocess/multi_batch_options.h" #include "graph/utils/node_utils.h" #include "graph/utils/op_desc_utils.h" #include "graph/utils/tensor_utils.h" #include "graph/utils/type_utils.h" #include "register/op_registry.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" namespace ge { namespace { diff --git a/ge/graph/passes/multi_batch_pass.cc b/ge/graph/passes/multi_batch_pass.cc index 25d629fa..9fba362c 100644 --- a/ge/graph/passes/multi_batch_pass.cc +++ b/ge/graph/passes/multi_batch_pass.cc @@ -19,7 +19,7 @@ #include #include #include "common/ge/ge_util.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/utils/type_utils.h" #include "common/formats/utils/formats_trans_utils.h" diff --git a/ge/graph/passes/net_output_pass.cc b/ge/graph/passes/net_output_pass.cc index 30455fa0..9aea4863 100644 --- a/ge/graph/passes/net_output_pass.cc +++ b/ge/graph/passes/net_output_pass.cc @@ -27,7 +27,7 @@ #include "framework/common/ge_inner_error_codes.h" #include "framework/omg/omg_inner_types.h" #include "graph/debug/ge_attr_define.h" -#include "graph/common/local_context.h" +#include "common/local_context.h" #include "graph/passes/pass_utils.h" #include "graph/utils/tensor_utils.h" #include "graph/utils/type_utils.h" diff --git a/ge/graph/passes/next_iteration_pass.cc b/ge/graph/passes/next_iteration_pass.cc index 1c2d7218..af3e4d2d 100644 --- a/ge/graph/passes/next_iteration_pass.cc +++ b/ge/graph/passes/next_iteration_pass.cc @@ -17,7 +17,7 @@ #include "graph/passes/next_iteration_pass.h" #include "common/ge/ge_util.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/utils/node_utils.h" using std::string; diff --git a/ge/graph/passes/pass_manager.cc b/ge/graph/passes/pass_manager.cc index 7c9aa414..afd2e4a7 100644 --- a/ge/graph/passes/pass_manager.cc +++ b/ge/graph/passes/pass_manager.cc @@ -19,7 +19,7 @@ #include "framework/common/types.h" #include "framework/common/util.h" #include "graph/utils/node_utils.h" -#include "graph/common/ge_call_wrapper.h" +#include "common/ge_call_wrapper.h" #include "framework/omg/omg_inner_types.h" namespace ge { diff --git a/ge/graph/passes/pass_utils.cc b/ge/graph/passes/pass_utils.cc index d5306f5f..0e056a0f 100644 --- a/ge/graph/passes/pass_utils.cc +++ b/ge/graph/passes/pass_utils.cc @@ -27,7 +27,7 @@ #include "common/ge/ge_util.h" #include "framework/common/op/ge_op_utils.h" #include "framework/common/types.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/debug/ge_attr_define.h" #include "graph/ge_tensor.h" #include "graph/manager/graph_var_manager.h" diff --git a/ge/graph/passes/permute_pass.cc b/ge/graph/passes/permute_pass.cc index 21222b2c..f3045b1a 100644 --- a/ge/graph/passes/permute_pass.cc +++ b/ge/graph/passes/permute_pass.cc @@ -24,7 +24,7 @@ #include "inc/kernel.h" #include "inc/kernel_factory.h" #include "framework/omg/omg_inner_types.h" -#include "graph/common/local_context.h" +#include "common/local_context.h" using domi::DOMI_TENSOR_ND; using domi::DOMI_TENSOR_NHWC; diff --git a/ge/graph/passes/placeholder_with_default_pass.cc b/ge/graph/passes/placeholder_with_default_pass.cc index 893ee798..bc51b217 100644 --- a/ge/graph/passes/placeholder_with_default_pass.cc +++ b/ge/graph/passes/placeholder_with_default_pass.cc @@ -18,7 +18,7 @@ #include #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" namespace ge { Status PlaceholderWithDefaultPass::Run(NodePtr &node) { diff --git a/ge/graph/passes/prevent_gradient_pass.cc b/ge/graph/passes/prevent_gradient_pass.cc index c531fd2f..8b8b17bd 100644 --- a/ge/graph/passes/prevent_gradient_pass.cc +++ b/ge/graph/passes/prevent_gradient_pass.cc @@ -19,7 +19,7 @@ #include #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" namespace ge { Status PreventGradientPass::Run(NodePtr &node) { diff --git a/ge/graph/passes/print_op_pass.h b/ge/graph/passes/print_op_pass.h index 7ee19d5d..96501dc5 100755 --- a/ge/graph/passes/print_op_pass.h +++ b/ge/graph/passes/print_op_pass.h @@ -20,7 +20,7 @@ #include "framework/common/debug/ge_log.h" #include "framework/common/types.h" #include "graph/debug/ge_attr_define.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "external/graph/graph.h" #include "graph/passes/base_pass.h" #include "graph/utils/graph_utils.h" diff --git a/ge/graph/passes/ref_identity_delete_op_pass.cc b/ge/graph/passes/ref_identity_delete_op_pass.cc index 7bc5804b..46bc7467 100644 --- a/ge/graph/passes/ref_identity_delete_op_pass.cc +++ b/ge/graph/passes/ref_identity_delete_op_pass.cc @@ -17,7 +17,7 @@ #include "graph/passes/ref_identity_delete_op_pass.h" #include #include -#include "graph/common/transop_util.h" +#include "common/transop_util.h" namespace ge { Status RefIdentityDeleteOpPass::Run(ComputeGraphPtr graph) { diff --git a/ge/graph/passes/replace_transshape_pass.cc b/ge/graph/passes/replace_transshape_pass.cc index c7844619..0e1701ab 100644 --- a/ge/graph/passes/replace_transshape_pass.cc +++ b/ge/graph/passes/replace_transshape_pass.cc @@ -21,7 +21,7 @@ #include "common/ge/ge_util.h" #include "framework/common/ge_inner_error_codes.h" #include "framework/common/debug/ge_log.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/utils/graph_utils.h" namespace ge { diff --git a/ge/graph/passes/snapshot_pass.cc b/ge/graph/passes/snapshot_pass.cc index 95733e67..a6cd79a3 100644 --- a/ge/graph/passes/snapshot_pass.cc +++ b/ge/graph/passes/snapshot_pass.cc @@ -18,7 +18,7 @@ #include #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" namespace ge { Status SnapshotPass::Run(NodePtr &node) { diff --git a/ge/graph/passes/stop_gradient_pass.h b/ge/graph/passes/stop_gradient_pass.h index 5132b889..5f022200 100755 --- a/ge/graph/passes/stop_gradient_pass.h +++ b/ge/graph/passes/stop_gradient_pass.h @@ -20,7 +20,7 @@ #include "framework/common/debug/ge_log.h" #include "framework/common/types.h" #include "framework/common/ge_inner_error_codes.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/passes/base_pass.h" namespace ge { diff --git a/ge/graph/passes/switch_dead_branch_elimination.cc b/ge/graph/passes/switch_dead_branch_elimination.cc index 3c6c57d0..284111ba 100644 --- a/ge/graph/passes/switch_dead_branch_elimination.cc +++ b/ge/graph/passes/switch_dead_branch_elimination.cc @@ -19,7 +19,7 @@ #include #include #include "framework/common/debug/ge_log.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/passes/pass_utils.h" #include "graph/utils/graph_utils.h" diff --git a/ge/graph/passes/switch_to_stream_switch_pass.cc b/ge/graph/passes/switch_to_stream_switch_pass.cc index 7fecae31..acbf27e3 100644 --- a/ge/graph/passes/switch_to_stream_switch_pass.cc +++ b/ge/graph/passes/switch_to_stream_switch_pass.cc @@ -18,7 +18,7 @@ #include #include "common/ge/ge_util.h" #include "external/ge/ge_api_types.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/ge_context.h" #include "graph/utils/type_utils.h" diff --git a/ge/graph/passes/transop_breadth_fusion_pass.cc b/ge/graph/passes/transop_breadth_fusion_pass.cc index 5b8e1940..88db9501 100644 --- a/ge/graph/passes/transop_breadth_fusion_pass.cc +++ b/ge/graph/passes/transop_breadth_fusion_pass.cc @@ -20,7 +20,7 @@ #include #include "framework/common/types.h" -#include "graph/common/transop_util.h" +#include "common/transop_util.h" #include "graph/utils/node_utils.h" namespace ge { diff --git a/ge/graph/passes/transop_depth_fusion_pass.cc b/ge/graph/passes/transop_depth_fusion_pass.cc index 66ce346a..3ce54e50 100755 --- a/ge/graph/passes/transop_depth_fusion_pass.cc +++ b/ge/graph/passes/transop_depth_fusion_pass.cc @@ -23,7 +23,7 @@ #include "graph/ge_tensor.h" #include "graph/op_desc.h" #include "graph/utils/graph_utils.h" -#include "graph/common/transop_util.h" +#include "common/transop_util.h" #include "graph/utils/node_utils.h" namespace ge { diff --git a/ge/graph/passes/transop_nearby_allreduce_fusion_pass.cc b/ge/graph/passes/transop_nearby_allreduce_fusion_pass.cc index 483575a4..437926ef 100644 --- a/ge/graph/passes/transop_nearby_allreduce_fusion_pass.cc +++ b/ge/graph/passes/transop_nearby_allreduce_fusion_pass.cc @@ -19,7 +19,7 @@ #include "framework/common/debug/log.h" #include "framework/common/types.h" #include "graph/utils/graph_utils.h" -#include "graph/common/transop_util.h" +#include "common/transop_util.h" namespace ge { Status TransOpNearbyAllreduceFusionPass::Run(NodePtr &node) { diff --git a/ge/graph/passes/transop_symmetry_elimination_pass.cc b/ge/graph/passes/transop_symmetry_elimination_pass.cc index fe0e48f9..2bd00206 100644 --- a/ge/graph/passes/transop_symmetry_elimination_pass.cc +++ b/ge/graph/passes/transop_symmetry_elimination_pass.cc @@ -18,7 +18,7 @@ #include "common/formats/utils/formats_trans_utils.h" #include "framework/common/debug/ge_log.h" #include "framework/common/util.h" -#include "graph/common/transop_util.h" +#include "common/transop_util.h" #include "graph/debug/ge_attr_define.h" #include "graph/utils/graph_utils.h" #include "graph/utils/node_utils.h" diff --git a/ge/graph/passes/transop_without_reshape_fusion_pass.cc b/ge/graph/passes/transop_without_reshape_fusion_pass.cc index 10e619b9..58145fe7 100644 --- a/ge/graph/passes/transop_without_reshape_fusion_pass.cc +++ b/ge/graph/passes/transop_without_reshape_fusion_pass.cc @@ -22,7 +22,7 @@ #include "common/ge/ge_util.h" #include "framework/common/ge_inner_error_codes.h" #include "framework/common/types.h" -#include "graph/common/transop_util.h" +#include "common/transop_util.h" #include "graph/compute_graph.h" #include "graph/debug/ge_attr_define.h" #include "graph/ge_tensor.h" diff --git a/ge/graph/passes/variable_op_pass.h b/ge/graph/passes/variable_op_pass.h index d442fdf4..e314fd12 100755 --- a/ge/graph/passes/variable_op_pass.h +++ b/ge/graph/passes/variable_op_pass.h @@ -18,7 +18,7 @@ #define GE_GRAPH_PASSES_VARIABLE_OP_PASS_H_ #include #include -#include "graph/common/transop_util.h" +#include "common/transop_util.h" #include "external/graph/graph.h" #include "graph/manager/graph_var_manager.h" #include "graph/manager/util/variable_accelerate_ctrl.h" diff --git a/ge/graph/passes/variable_prepare_op_pass.cc b/ge/graph/passes/variable_prepare_op_pass.cc index 3bb9a2fa..288ff185 100644 --- a/ge/graph/passes/variable_prepare_op_pass.cc +++ b/ge/graph/passes/variable_prepare_op_pass.cc @@ -21,7 +21,7 @@ #include "common/ge/ge_util.h" #include "external/graph/graph.h" #include "framework/common/debug/ge_log.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/debug/ge_attr_define.h" #include "graph/node.h" #include "graph/utils/tensor_utils.h" diff --git a/ge/graph/preprocess/graph_preprocess.cc b/ge/graph/preprocess/graph_preprocess.cc index 8d59d9f9..2efe623e 100644 --- a/ge/graph/preprocess/graph_preprocess.cc +++ b/ge/graph/preprocess/graph_preprocess.cc @@ -28,9 +28,9 @@ #include "common/math/math_util.h" #include "framework/common/op/ge_op_utils.h" #include "ir_build/option_utils.h" -#include "graph/common/ge_call_wrapper.h" -#include "graph/common/local_context.h" -#include "graph/common/transop_util.h" +#include "common/ge_call_wrapper.h" +#include "common/local_context.h" +#include "common/transop_util.h" #include "graph/ge_context.h" #include "graph/shape_refiner.h" #include "graph/manager/graph_var_manager.h" diff --git a/ge/graph/preprocess/insert_op/ge_aipp_op.cc b/ge/graph/preprocess/insert_op/ge_aipp_op.cc index 48bfa3e6..7a89a1f4 100755 --- a/ge/graph/preprocess/insert_op/ge_aipp_op.cc +++ b/ge/graph/preprocess/insert_op/ge_aipp_op.cc @@ -39,7 +39,7 @@ #include "graph/utils/tensor_utils.h" #include "graph/utils/type_utils.h" #include "proto/insert_op.pb.h" -#include "graph/common/local_context.h" +#include "common/local_context.h" #define SAVE_AIPP_ATTR(KEY, SAVE_TYPE) \ do { \ diff --git a/ge/graph/preprocess/multi_batch_copy_graph.cc b/ge/graph/preprocess/multi_batch_copy_graph.cc index fd3a4e91..d88cf6cd 100644 --- a/ge/graph/preprocess/multi_batch_copy_graph.cc +++ b/ge/graph/preprocess/multi_batch_copy_graph.cc @@ -38,8 +38,8 @@ #include "graph/utils/tensor_utils.h" #include "graph/utils/type_utils.h" #include "inc/pass_manager.h" -#include "graph/common/local_context.h" -#include "graph/common/omg_util.h" +#include "common/local_context.h" +#include "common/omg_util.h" using std::set; using std::string; diff --git a/ge/graph/preprocess/multi_batch_options.cc b/ge/graph/preprocess/multi_batch_options.cc index 21cbc0c2..9cda6194 100644 --- a/ge/graph/preprocess/multi_batch_options.cc +++ b/ge/graph/preprocess/multi_batch_options.cc @@ -25,11 +25,11 @@ #include "graph/debug/ge_attr_define.h" #include "graph/utils/node_utils.h" #include "graph/ge_context.h" -#include "graph/common/local_context.h" +#include "common/local_context.h" #include "framework/common/types.h" #include "graph/compute_graph.h" #include "graph/utils/graph_utils.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" namespace ge { namespace multibatch { diff --git a/ge/host_kernels/add_kernel.cc b/ge/host_kernels/add_kernel.cc index 1c206018..eb0ea86d 100644 --- a/ge/host_kernels/add_kernel.cc +++ b/ge/host_kernels/add_kernel.cc @@ -19,7 +19,7 @@ #include #include "common/math/math_util.h" -#include "graph/common/bcast.h" +#include "common/bcast.h" #include "graph/utils/type_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/host_kernels/broadcast_args_kernel.cc b/ge/host_kernels/broadcast_args_kernel.cc index 796142f4..660717ad 100644 --- a/ge/host_kernels/broadcast_args_kernel.cc +++ b/ge/host_kernels/broadcast_args_kernel.cc @@ -22,7 +22,7 @@ #include "framework/common/types.h" #include "framework/common/util.h" #include "framework/common/ge_inner_error_codes.h" -#include "graph/common/bcast.h" +#include "common/bcast.h" #include "graph/passes/pass_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/host_kernels/broadcast_gradient_args_kernel.cc b/ge/host_kernels/broadcast_gradient_args_kernel.cc index 59993171..8b9e3fb5 100644 --- a/ge/host_kernels/broadcast_gradient_args_kernel.cc +++ b/ge/host_kernels/broadcast_gradient_args_kernel.cc @@ -22,7 +22,7 @@ #include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" -#include "graph/common/bcast.h" +#include "common/bcast.h" #include "graph/passes/pass_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/host_kernels/cast_kernel.cc b/ge/host_kernels/cast_kernel.cc index 3f09974f..2d2f463c 100644 --- a/ge/host_kernels/cast_kernel.cc +++ b/ge/host_kernels/cast_kernel.cc @@ -28,7 +28,7 @@ #include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" -#include "graph/common/bcast.h" +#include "common/bcast.h" #include "host_kernels/kernel_utils.h" #include "graph/utils/type_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/host_kernels/floormod_kernel.cc b/ge/host_kernels/floormod_kernel.cc index bef6d014..1d101667 100644 --- a/ge/host_kernels/floormod_kernel.cc +++ b/ge/host_kernels/floormod_kernel.cc @@ -23,7 +23,7 @@ #include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" -#include "graph/common/bcast.h" +#include "common/bcast.h" #include "graph/utils/type_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/host_kernels/greater_kernel.cc b/ge/host_kernels/greater_kernel.cc index 3e62db04..0cc895c4 100644 --- a/ge/host_kernels/greater_kernel.cc +++ b/ge/host_kernels/greater_kernel.cc @@ -25,7 +25,7 @@ #include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" -#include "graph/common/bcast.h" +#include "common/bcast.h" #include "graph/utils/type_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/host_kernels/maximum_kernel.cc b/ge/host_kernels/maximum_kernel.cc index 314bc7be..0e28fcdc 100644 --- a/ge/host_kernels/maximum_kernel.cc +++ b/ge/host_kernels/maximum_kernel.cc @@ -25,7 +25,7 @@ #include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" -#include "graph/common/bcast.h" +#include "common/bcast.h" #include "graph/utils/type_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/host_kernels/mul_kernel.cc b/ge/host_kernels/mul_kernel.cc index e3657197..608f351d 100644 --- a/ge/host_kernels/mul_kernel.cc +++ b/ge/host_kernels/mul_kernel.cc @@ -25,7 +25,7 @@ #include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" -#include "graph/common/bcast.h" +#include "common/bcast.h" #include "graph/utils/type_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/host_kernels/permute_kernel.cc b/ge/host_kernels/permute_kernel.cc index 93d56415..9e9462b6 100755 --- a/ge/host_kernels/permute_kernel.cc +++ b/ge/host_kernels/permute_kernel.cc @@ -24,7 +24,7 @@ #include "framework/common/op/ge_op_utils.h" #include "framework/common/types.h" #include "framework/common/util.h" -#include "graph/common/bcast.h" +#include "common/bcast.h" #include "graph/utils/type_utils.h" #include "inc/kernel_factory.h" #include "common/formats/formats.h" diff --git a/ge/host_kernels/sub_kernel.cc b/ge/host_kernels/sub_kernel.cc index 84c334b0..0aebb946 100644 --- a/ge/host_kernels/sub_kernel.cc +++ b/ge/host_kernels/sub_kernel.cc @@ -23,7 +23,7 @@ #include "framework/common/debug/log.h" #include "common/math/math_util.h" #include "framework/common/op/ge_op_utils.h" -#include "graph/common/bcast.h" +#include "common/bcast.h" #include "graph/utils/type_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/host_kernels/transdata_kernel.cc b/ge/host_kernels/transdata_kernel.cc index a06db78b..7d44fdae 100644 --- a/ge/host_kernels/transdata_kernel.cc +++ b/ge/host_kernels/transdata_kernel.cc @@ -28,7 +28,7 @@ #include "framework/common/util.h" #include "framework/common/debug/ge_log.h" #include "framework/common/ge_inner_error_codes.h" -#include "graph/common/bcast.h" +#include "common/bcast.h" #include "host_kernels/kernel_utils.h" #include "graph/utils/type_utils.h" #include "inc/kernel_factory.h" diff --git a/ge/hybrid/hybrid_davinci_model.h b/ge/hybrid/hybrid_davinci_model.h index 34503b01..abab74f6 100644 --- a/ge/hybrid/hybrid_davinci_model.h +++ b/ge/hybrid/hybrid_davinci_model.h @@ -20,7 +20,7 @@ #include #include "external/ge/ge_api_error_codes.h" #include "graph/load/model_manager/data_inputer.h" -#include "model/ge_root_model.h" +#include "common/model/ge_root_model.h" namespace ge { namespace hybrid { diff --git a/ge/hybrid/model/hybrid_model.h b/ge/hybrid/model/hybrid_model.h index 77246e20..3cb936f6 100644 --- a/ge/hybrid/model/hybrid_model.h +++ b/ge/hybrid/model/hybrid_model.h @@ -27,7 +27,7 @@ #include "hybrid/common/tensor_value.h" #include "hybrid/model/node_item.h" #include "hybrid/model/graph_item.h" -#include "model/ge_root_model.h" +#include "common/model/ge_root_model.h" namespace ge { namespace hybrid { diff --git a/ge/hybrid/model/hybrid_model_builder.cc b/ge/hybrid/model/hybrid_model_builder.cc index c722d269..44115240 100755 --- a/ge/hybrid/model/hybrid_model_builder.cc +++ b/ge/hybrid/model/hybrid_model_builder.cc @@ -21,7 +21,7 @@ #include "graph/ge_context.h" #include "graph/build/memory/var_mem_assign_util.h" #include "graph/debug/ge_attr_define.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" #include "graph/load/model_manager/model_utils.h" #include "graph/load/model_manager/model_manager.h" #include "graph/manager/graph_var_manager.h" diff --git a/ge/hybrid/model/hybrid_model_builder.h b/ge/hybrid/model/hybrid_model_builder.h index 05830e82..3592d3d2 100644 --- a/ge/hybrid/model/hybrid_model_builder.h +++ b/ge/hybrid/model/hybrid_model_builder.h @@ -25,7 +25,7 @@ #include "graph/node.h" #include "hybrid/model/hybrid_model.h" #include "hybrid/model/node_item.h" -#include "model/ge_model.h" +#include "common/model/ge_model.h" namespace ge { class VarManager; diff --git a/ge/init/gelib.cc b/ge/init/gelib.cc index 1a2f0d5b..2491715b 100644 --- a/ge/init/gelib.cc +++ b/ge/init/gelib.cc @@ -34,7 +34,7 @@ #include "analyzer/analyzer.h" #include "external/ge/ge_api_types.h" #include "ge_local_engine/engine/host_cpu_engine.h" -#include "graph/common/ge_call_wrapper.h" +#include "common/ge_call_wrapper.h" #include "graph/ge_context.h" #include "graph/ge_global_options.h" #include "graph/manager/graph_mem_manager.h" diff --git a/ge/ir_build/attr_options/utils.cc b/ge/ir_build/attr_options/utils.cc index 5398c220..23bb0b7b 100644 --- a/ge/ir_build/attr_options/utils.cc +++ b/ge/ir_build/attr_options/utils.cc @@ -17,7 +17,7 @@ #include #include "graph/debug/ge_attr_define.h" #include "framework/common/debug/ge_log.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" namespace ge { namespace { const std::string CFG_PRE_OPTYPE = "OpType::"; diff --git a/ge/ir_build/ge_ir_build.cc b/ge/ir_build/ge_ir_build.cc index e1cd5d29..cafc534d 100644 --- a/ge/ir_build/ge_ir_build.cc +++ b/ge/ir_build/ge_ir_build.cc @@ -33,7 +33,7 @@ #include "graph/ge_global_options.h" #include "init/gelib.h" #include "ir_build/option_utils.h" -#include "model/ge_model.h" +#include "common/model/ge_model.h" #include "graph/shape_refiner.h" #include "graph/opsproto_manager.h" #include "inc/pass_manager.h" diff --git a/ge/session/inner_session.cc b/ge/session/inner_session.cc index 1dcc2996..b9c44ef1 100755 --- a/ge/session/inner_session.cc +++ b/ge/session/inner_session.cc @@ -29,7 +29,7 @@ #include "graph/ge_context.h" #include "graph/ge_global_options.h" #include "graph/ge_local_context.h" -#include "graph/common/local_context.h" +#include "common/local_context.h" #include "graph/manager/graph_var_manager.h" #include "graph/manager/graph_mem_manager.h" #include "graph/utils/tensor_adapter.h" diff --git a/inc/framework/common/helper/model_helper.h b/inc/framework/common/helper/model_helper.h index e25d5d6f..2a63291c 100644 --- a/inc/framework/common/helper/model_helper.h +++ b/inc/framework/common/helper/model_helper.h @@ -22,10 +22,10 @@ #include "common/fmk_types.h" #include "common/helper/om_file_helper.h" +#include "common/model/ge_model.h" +#include "common/model/ge_root_model.h" #include "common/types.h" #include "graph/model.h" -#include "model/ge_model.h" -#include "model/ge_root_model.h" namespace ge { class GE_FUNC_VISIBILITY ModelHelper { @@ -42,13 +42,21 @@ class GE_FUNC_VISIBILITY ModelHelper { Status LoadRootModel(const ge::ModelData &model_data); Status GetModelBufferData(ge::ModelBufferData &model); - const ModelFileHeader *GetFileHeader() const { return file_header_; } + const ModelFileHeader *GetFileHeader() const { + return file_header_; + } GeModelPtr GetGeModel(); GeRootModelPtr GetGeRootModel(); - void SetSaveMode(bool val) { is_offline_ = val; } - bool GetSaveMode(void) const { return is_offline_; } - bool GetModelType() const { return is_unknown_shape_model_; }; + void SetSaveMode(bool val) { + is_offline_ = val; + } + bool GetSaveMode(void) const { + return is_offline_; + } + bool GetModelType() const { + return is_unknown_shape_model_; + }; Status GetBaseNameFromFileName(const std::string &file_name, std::string &base_name); Status GetModelNameFromMergedGraphName(const std::string &graph_name, std::string &model_name); diff --git a/tests/ut/ge/CMakeLists.txt b/tests/ut/ge/CMakeLists.txt index 42fa6128..856d9d43 100755 --- a/tests/ut/ge/CMakeLists.txt +++ b/tests/ut/ge/CMakeLists.txt @@ -104,8 +104,8 @@ set(COMMON_SRC_FILES "${GE_CODE_DIR}/ge/opskernel_manager/ops_kernel_manager.cc" "${GE_CODE_DIR}/ge/generator/ge_generator.cc" "${GE_CODE_DIR}/ge/generator/generator_api.cc" - "${GE_CODE_DIR}/ge/graph/common/omg_util.cc" - "${GE_CODE_DIR}/ge/graph/common/bcast.cc" + "${GE_CODE_DIR}/ge/common/omg_util.cc" + "${GE_CODE_DIR}/ge/common/bcast.cc" "${GE_CODE_DIR}/ge/common/util.cc" "${GE_CODE_DIR}/ge/common/ge/op_tiling_manager.cc" "${GE_CODE_DIR}/ge/init/gelib.cc" @@ -124,12 +124,12 @@ set(COMMON_SRC_FILES "${GE_CODE_DIR}/ge/common/dump/opdebug_register.cc" "${GE_CODE_DIR}/ge/common/dump/dump_op.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/ge_root_model.cc" "${GE_CODE_DIR}/ge/common/model_parser/model_parser.cc" "${GE_CODE_DIR}/ge/common/dump/dump_server.cc" "${GE_CODE_DIR}/ge/graph/preprocess/multi_batch_copy_graph.cc" "${GE_CODE_DIR}/ge/graph/optimize/mem_rw_conflict_optimize.cc" - "${GE_CODE_DIR}/ge/model/ge_model.cc" + "${GE_CODE_DIR}/ge/common/model/ge_model.cc" "${GE_CODE_DIR}/ge/common/cust_aicpu_kernel_store.cc" "${GE_CODE_DIR}/ge/common/kernel_store.cc" "${GE_CODE_DIR}/ge/common/tbe_kernel_store.cc" @@ -169,10 +169,10 @@ set(COMMON_SRC_FILES "${GE_CODE_DIR}/ge/graph/manager/graph_var_manager.cc" "${GE_CODE_DIR}/ge/analyzer/analyzer.cc" "${GE_CODE_DIR}/ge/common/thread_pool.cc" - "${GE_CODE_DIR}/ge/graph/common/transop_util.cc" + "${GE_CODE_DIR}/ge/common/transop_util.cc" "${GE_CODE_DIR}/ge/graph/manager/graph_manager_utils.cc" "${GE_CODE_DIR}/ge/graph/manager/trans_var_data_utils.cc" - "${GE_CODE_DIR}/ge/graph/common/local_context.cc" + "${GE_CODE_DIR}/ge/common/local_context.cc" "${GE_CODE_DIR}/ge/graph/manager/graph_caching_allocator.cc" "${GE_CODE_DIR}/ge/graph/manager/session_scope_mem_allocator.cc" "${GE_CODE_DIR}/ge/graph/manager/rdma_pool_allocator.cc" @@ -648,6 +648,7 @@ set(MULTI_PARTS_TEST_FILES "graph/transop_util_unittest.cc" "common/datatype_transfer_unittest.cc" "common/util_unittest.cc" + "common/fp16_unittest.cc" "common/dump_manager_unittest.cc" "common/dump_op_unittest.cc" "common/dump_properties_unittest.cc" diff --git a/tests/ut/ge/common/fp16_unittest.cc b/tests/ut/ge/common/fp16_unittest.cc new file mode 100644 index 00000000..a9590fe2 --- /dev/null +++ b/tests/ut/ge/common/fp16_unittest.cc @@ -0,0 +1,56 @@ +/** + * Copyright 2019-2020 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "common/fp16_t.h" + +namespace ge { +namespace formats { +class UtestFP16 : public testing::Test { + protected: + void SetUp() {} + void TearDown() {} +}; + +TEST_F(UtestFP16, fp16_to_other) { + fp16_t test; + float num = test.ToFloat(); + EXPECT_EQ(num, 0.0); + + double num2 = test.ToDouble(); + EXPECT_EQ(num2, 0); + + int16_t num3 = test.ToInt16(); + EXPECT_EQ(num3, 0); + + int32_t num4 = test.ToInt32(); + EXPECT_EQ(num4, 0); + + int8_t num5 = test.ToInt8(); + EXPECT_EQ(num5, 0); + + uint16_t num6 = test.ToUInt16(); + EXPECT_EQ(num6, 0); + + uint32_t num7 = test.ToUInt16(); + EXPECT_EQ(num7, 0); + + uint8_t num8 = test.ToUInt8(); + EXPECT_EQ(num8, 0); +} +} // namespace formats +} // namespace ge diff --git a/tests/ut/ge/graph/build/model_builder_unittest.cc b/tests/ut/ge/graph/build/model_builder_unittest.cc index d544e1a3..4f061e27 100644 --- a/tests/ut/ge/graph/build/model_builder_unittest.cc +++ b/tests/ut/ge/graph/build/model_builder_unittest.cc @@ -17,7 +17,7 @@ #include #include -#include "graph/common/local_context.h" +#include "common/local_context.h" #include "graph/anchor.h" #include "graph/attr_value.h" #include "graph/debug/ge_attr_define.h" diff --git a/tests/ut/ge/graph/graph_load_unittest.cc b/tests/ut/ge/graph/graph_load_unittest.cc index cbcefd03..93282a5e 100644 --- a/tests/ut/ge/graph/graph_load_unittest.cc +++ b/tests/ut/ge/graph/graph_load_unittest.cc @@ -36,7 +36,7 @@ #include "framework/common/ge_inner_error_codes.h" #include "graph/load/model_manager/model_manager.h" #include "graph/manager/graph_manager_utils.h" -#include "model/ge_model.h" +#include "common/model/ge_model.h" #undef private #undef protected diff --git a/tests/ut/ge/graph/load/model_helper_unittest.cc b/tests/ut/ge/graph/load/model_helper_unittest.cc index 8fd8f014..8af329ed 100644 --- a/tests/ut/ge/graph/load/model_helper_unittest.cc +++ b/tests/ut/ge/graph/load/model_helper_unittest.cc @@ -20,7 +20,7 @@ #include "framework/common/helper/model_helper.h" #include "framework/omg/model_tool.h" #include "framework/omg/ge_init.h" -#include "ge/model/ge_model.h" +#include "ge/common/model/ge_model.h" #undef private #undef protected diff --git a/tests/ut/ge/graph/manager/graph_manager_unittest.cc b/tests/ut/ge/graph/manager/graph_manager_unittest.cc index 9663e90f..518cfdcd 100644 --- a/tests/ut/ge/graph/manager/graph_manager_unittest.cc +++ b/tests/ut/ge/graph/manager/graph_manager_unittest.cc @@ -39,9 +39,9 @@ #include "common/thread_pool.h" #include "common/dump/dump_manager.h" #include "analyzer/analyzer.h" -#include "graph/common/ge_call_wrapper.h" -#include "graph/common/local_context.h" -#include "graph/common/transop_util.h" +#include "common/ge_call_wrapper.h" +#include "common/local_context.h" +#include "common/transop_util.h" #include "graph/ge_context.h" #include "graph/ge_global_options.h" #include "graph/manager/util/rt_context_util.h" @@ -108,8 +108,8 @@ #include "graph/utils/tensor_adapter.h" #include "inc/pass_manager.h" #include "ir_build/option_utils.h" -#include "graph/common/local_context.h" -#include "graph/common/omg_util.h" +#include "common/local_context.h" +#include "common/omg_util.h" #include "common/formats/utils/formats_trans_utils.h" #include "../passes/graph_builder_utils.h" #include "register/custom_pass_helper.h" diff --git a/tests/ut/ge/graph/partition/dynamic_shape_partition_unittest.cc b/tests/ut/ge/graph/partition/dynamic_shape_partition_unittest.cc index da1abd0f..1d19a8bd 100644 --- a/tests/ut/ge/graph/partition/dynamic_shape_partition_unittest.cc +++ b/tests/ut/ge/graph/partition/dynamic_shape_partition_unittest.cc @@ -24,7 +24,7 @@ #include "inc/framework/common/types.h" #include "utils/graph_utils.h" #include "graph/debug/ge_attr_define.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" namespace ge { namespace { diff --git a/tests/ut/ge/graph/passes/mark_node_unknown_shape_pass_unittest.cc b/tests/ut/ge/graph/passes/mark_node_unknown_shape_pass_unittest.cc index c7d36582..7d4663b3 100644 --- a/tests/ut/ge/graph/passes/mark_node_unknown_shape_pass_unittest.cc +++ b/tests/ut/ge/graph/passes/mark_node_unknown_shape_pass_unittest.cc @@ -24,7 +24,7 @@ #include "common/ge_inner_error_codes.h" #include "inc/pass_manager.h" -#include "graph/common/local_context.h" +#include "common/local_context.h" #undef private namespace ge { diff --git a/tests/ut/ge/graph/passes/multi_batch_clone_pass_unittest.cc b/tests/ut/ge/graph/passes/multi_batch_clone_pass_unittest.cc index c752cea4..9ec254d7 100644 --- a/tests/ut/ge/graph/passes/multi_batch_clone_pass_unittest.cc +++ b/tests/ut/ge/graph/passes/multi_batch_clone_pass_unittest.cc @@ -22,7 +22,7 @@ #include "inc/pass_manager.h" #include "graph/utils/tensor_utils.h" -#include "graph/common/local_context.h" +#include "common/local_context.h" #include "graph/passes/multi_batch_pass.h" #include "graph/preprocess/multi_batch_copy_graph.h" #include "graph/preprocess/insert_op/util_insert_aipp_op.h" diff --git a/tests/ut/ge/graph/passes/subgraph_const_migration_pass_unittest.cc b/tests/ut/ge/graph/passes/subgraph_const_migration_pass_unittest.cc index c633c0e1..6565295c 100644 --- a/tests/ut/ge/graph/passes/subgraph_const_migration_pass_unittest.cc +++ b/tests/ut/ge/graph/passes/subgraph_const_migration_pass_unittest.cc @@ -20,7 +20,7 @@ #include #include "framework/omg/omg_inner_types.h" -#include "graph/common/local_context.h" +#include "common/local_context.h" #include "graph/passes/subgraph_const_migration_pass.h" #include "inc/pass_manager.h" #include "register/op_registry.h" diff --git a/tests/ut/ge/graph/transop_util_unittest.cc b/tests/ut/ge/graph/transop_util_unittest.cc index 9f645c22..02aa97bf 100644 --- a/tests/ut/ge/graph/transop_util_unittest.cc +++ b/tests/ut/ge/graph/transop_util_unittest.cc @@ -16,7 +16,7 @@ #include -#include "graph/common/transop_util.h" +#include "common/transop_util.h" #include "common/debug/log.h" #include "common/types.h" diff --git a/tests/ut/ge/hybrid/ge_hybrid_unittest.cc b/tests/ut/ge/hybrid/ge_hybrid_unittest.cc index b09211cb..782a06d6 100644 --- a/tests/ut/ge/hybrid/ge_hybrid_unittest.cc +++ b/tests/ut/ge/hybrid/ge_hybrid_unittest.cc @@ -25,8 +25,8 @@ #include "hybrid/model/hybrid_model_builder.h" #include "hybrid/model/hybrid_model.h" #include "hybrid/node_executor/node_executor.h" -#include "model/ge_model.h" -#include "model/ge_root_model.h" +#include "common/model/ge_model.h" +#include "common/model/ge_root_model.h" #include "hybrid/node_executor/aicore/aicore_op_task.h" #include "framework/common/taskdown_common.h" #include "framework/common/debug/log.h" diff --git a/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc b/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc index 10f7c0fe..eb6030dc 100644 --- a/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc +++ b/tests/ut/ge/hybrid/model/hybrid_model_builder_unittest.cc @@ -29,7 +29,7 @@ #include "graph/utils/graph_utils.h" #include "graph/debug/ge_attr_define.h" #include "graph/ge_local_context.h" -#include "graph/common/omg_util.h" +#include "common/omg_util.h" using namespace std; using namespace testing; diff --git a/tests/ut/ge/hybrid/node_executor/ge_local/ge_local_node_executor_unittest.cc b/tests/ut/ge/hybrid/node_executor/ge_local/ge_local_node_executor_unittest.cc index e4d211f9..53b28762 100644 --- a/tests/ut/ge/hybrid/node_executor/ge_local/ge_local_node_executor_unittest.cc +++ b/tests/ut/ge/hybrid/node_executor/ge_local/ge_local_node_executor_unittest.cc @@ -22,7 +22,7 @@ #define protected public #include "hybrid/executor/subgraph_context.h" #include "hybrid/node_executor/ge_local/ge_local_node_executor.h" -#include "model/ge_root_model.h" +#include "common/model/ge_root_model.h" #undef protected #undef private diff --git a/tests/ut/ge/hybrid/node_executor/host_cpu/host_cpu_node_task_unittest.cc b/tests/ut/ge/hybrid/node_executor/host_cpu/host_cpu_node_task_unittest.cc index b113fa9b..bb134175 100644 --- a/tests/ut/ge/hybrid/node_executor/host_cpu/host_cpu_node_task_unittest.cc +++ b/tests/ut/ge/hybrid/node_executor/host_cpu/host_cpu_node_task_unittest.cc @@ -22,7 +22,7 @@ #define protected public #include "hybrid/executor/subgraph_context.h" #include "hybrid/node_executor/host_cpu/host_cpu_node_executor.h" -#include "model/ge_root_model.h" +#include "common/model/ge_root_model.h" #include "graph/passes/graph_builder_utils.h" #include "aicpu/common/aicpu_task_struct.h" #include "graph/manager/graph_mem_manager.h" diff --git a/tests/ut/ge/hybrid/node_executor/rts/rts_node_task_unittest.cc b/tests/ut/ge/hybrid/node_executor/rts/rts_node_task_unittest.cc index 109e5192..d21ae1e0 100644 --- a/tests/ut/ge/hybrid/node_executor/rts/rts_node_task_unittest.cc +++ b/tests/ut/ge/hybrid/node_executor/rts/rts_node_task_unittest.cc @@ -22,7 +22,7 @@ #define protected public #include "hybrid/executor/subgraph_context.h" #include "hybrid/node_executor/rts/rts_node_executor.h" -#include "model/ge_root_model.h" +#include "common/model/ge_root_model.h" using namespace std; using namespace testing;