Browse Source

update master src code for compile success

pull/266/head
taoxiangdong 4 years ago
parent
commit
2f0c22c8d6
6 changed files with 1266 additions and 3 deletions
  1. +26
    -2
      build.sh
  2. +901
    -0
      ge/CMakeLists.txt
  3. +113
    -0
      ge/executor/CMakeLists.txt
  4. +116
    -0
      ge/ge_local_engine/CMakeLists.txt
  5. +109
    -0
      ge/host_cpu_engine/CMakeLists.txt
  6. +1
    -1
      src/ge/stub/gen_stubapi.py

+ 26
- 2
build.sh View File

@@ -118,8 +118,32 @@ build_graphengine()
fi

echo "${CMAKE_ARGS}"
cmake ${CMAKE_ARGS} ../..
make ${VERBOSE} -j${THREAD_NUM}
cmake ${CMAKE_ARGS} ..
if [ $? -ne 0 ]
then
echo "execute command: cmake ${CMAKE_ARGS} .. failed."
return 1
fi
COMMON_TARGET="ge_common engine fmk_parser parser_common _caffe_parser fmk_onnx_parser graph register engine_conf.json optimizer_priority.pbtxt "
TARGET=${COMMON_TARGET}
if [ "x${PLATFORM}" = "xtrain" ]
then
TARGET="ge_runner ge_local_engine host_cpu_engine ${TARGET}"
elif [ "x${PLATFORM}" = "xinference" ]
then
TARGET="ge_compiler atc_ge_local_engine atc_host_cpu_engine atc opensrc_ascendcl ${TARGET}"
elif [ "x${PLATFORM}" = "xall" ]
then
# build all the target
TARGET=""
fi
make ${VERBOSE} ${TARGET} -j${THREAD_NUM} && make install
if [ $? -ne 0 ]
then
echo "execute command: make ${VERBOSE} -j${THREAD_NUM} && make install failed."
return 1
fi
echo "GraphEngine build success!"
}
g++ -v


+ 901
- 0
ge/CMakeLists.txt View File

@@ -0,0 +1,901 @@
add_subdirectory(common)
add_subdirectory(plugin/engine)
add_subdirectory(graph/build/memory)
add_subdirectory(ge_local_engine)
add_subdirectory(host_cpu_engine)
add_subdirectory(executor)
add_subdirectory(offline)

set(PROTO_LIST
"${METADEF_DIR}/proto/fusion_model.proto"
"${GE_CODE_DIR}/ge/proto/optimizer_priority.proto"
)

set(PROTO_CLIENT_LIST
"${METADEF_DIR}/proto/ge_api.proto"
)

set(PROTO_HEADER_LIST
"${METADEF_DIR}/proto/om.proto"
"${METADEF_DIR}/proto/task.proto"
"${METADEF_DIR}/proto/insert_op.proto"
"${METADEF_DIR}/proto/ge_ir.proto"
"${METADEF_DIR}/proto/fwk_adapter.proto"
"${METADEF_DIR}/proto/op_mapping_info.proto"
)

protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST})
protobuf_generate(ge PROTO_CLIENT_SRCS PROTO_CLIENT_HDRS ${PROTO_CLIENT_LIST})
protobuf_generate(ge PROTO_HEADER_SRCS PROTO_HEADER_HDRS ${PROTO_HEADER_LIST})

############ libge_runner.so ############
set(TRAIN_SRC_LIST
"common/formats/format_transfers/datatype_transfer.cc"
"common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc"
"common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc"
"common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc"
"common/formats/format_transfers/format_transfer_fractal_nz.cc"
"common/formats/format_transfers/format_transfer_fractal_z.cc"
"common/formats/format_transfers/format_transfer_fractal_zz.cc"
"common/formats/format_transfers/format_transfer_fracz_hwcn.cc"
"common/formats/format_transfers/format_transfer_fracz_nchw.cc"
"common/formats/format_transfers/format_transfer_fracz_nhwc.cc"
"common/formats/format_transfers/format_transfer_hwcn_c1hwncoc0.cc"
"common/formats/format_transfers/format_transfer_nc1hwc0_nchw.cc"
"common/formats/format_transfers/format_transfer_nc1hwc0_nhwc.cc"
"common/formats/format_transfers/format_transfer_nchw_nc1hwc0.cc"
"common/formats/format_transfers/format_transfer_nhwc_nc1hwc0.cc"
"common/formats/format_transfers/format_transfer_transpose.cc"
"common/formats/formats.cc"
"common/formats/utils/formats_trans_utils.cc"
"common/fp16_t.cc"
"common/ge/plugin_manager.cc"
"common/ge/op_tiling_manager.cc"
"common/helper/model_cache_helper.cc"
"common/profiling/profiling_manager.cc"
"common/dump/dump_manager.cc"
"common/dump/dump_properties.cc"
"common/dump/dump_op.cc"
"engine_manager/dnnengine_manager.cc"
"ge_local_engine/engine/host_cpu_engine.cc"
"generator/ge_generator.cc"
"generator/generator_api.cc"
"graph/build/graph_builder.cc"
"graph/build/label_allocator.cc"
"graph/build/logical_stream_allocator.cc"
"graph/build/model_builder.cc"
"graph/build/run_context.cc"
"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/execute/graph_execute.cc"
"graph/label/case_label_maker.cc"
"graph/label/if_label_maker.cc"
"graph/label/label_maker.cc"
"graph/label/partitioned_call_label_maker.cc"
"graph/label/while_label_maker.cc"
"graph/load/graph_loader.cc"
"graph/load/new_model_manager/cpu_queue_schedule.cc"
"graph/load/new_model_manager/data_dumper.cc"
"graph/load/new_model_manager/data_inputer.cc"
"graph/load/new_model_manager/davinci_model.cc"
"graph/load/new_model_manager/davinci_model_parser.cc"
"graph/load/new_model_manager/model_manager.cc"
"graph/load/new_model_manager/model_utils.cc"
"graph/load/new_model_manager/aipp_utils.cc"
"graph/load/new_model_manager/task_info/end_graph_task_info.cc"
"graph/load/new_model_manager/task_info/event_record_task_info.cc"
"graph/load/new_model_manager/task_info/event_wait_task_info.cc"
"graph/load/new_model_manager/task_info/fusion_start_task_info.cc"
"graph/load/new_model_manager/task_info/fusion_stop_task_info.cc"
"graph/load/new_model_manager/task_info/hccl_task_info.cc"
"graph/load/new_model_manager/task_info/kernel_ex_task_info.cc"
"graph/load/new_model_manager/task_info/kernel_task_info.cc"
"graph/load/new_model_manager/task_info/label_set_task_info.cc"
"graph/load/new_model_manager/task_info/label_switch_by_index_task_info.cc"
"graph/load/new_model_manager/task_info/label_goto_ex_task_info.cc"
"graph/load/new_model_manager/task_info/memcpy_addr_async_task_info.cc"
"graph/load/new_model_manager/task_info/memcpy_async_task_info.cc"
"graph/load/new_model_manager/task_info/profiler_trace_task_info.cc"
"graph/load/new_model_manager/task_info/stream_active_task_info.cc"
"graph/load/new_model_manager/task_info/stream_switch_task_info.cc"
"graph/load/new_model_manager/task_info/stream_switchn_task_info.cc"
"graph/load/new_model_manager/task_info/super_kernel/super_kernel.cc"
"graph/load/new_model_manager/task_info/super_kernel/super_kernel_factory.cc"
"graph/load/new_model_manager/task_info/task_info.cc"
"graph/load/new_model_manager/tbe_handle_store.cc"
"graph/load/new_model_manager/zero_copy_task.cc"
"graph/load/new_model_manager/zero_copy_offset.cc"
"graph/manager/graph_context.cc"
"graph/manager/graph_manager.cc"
"graph/manager/graph_manager_utils.cc"
"graph/manager/graph_mem_allocator.cc"
"graph/manager/graph_caching_allocator.cc"
"graph/manager/graph_var_manager.cc"
"graph/manager/host_mem_manager.cc"
"graph/manager/rdma_pool_allocator.cc"
"graph/manager/memory_api.cc"
"graph/manager/model_manager/event_manager.cc"
"graph/manager/trans_var_data_utils.cc"
"graph/manager/util/debug.cc"
"graph/manager/util/hcom_util.cc"
"graph/manager/util/rt_context_util.cc"
"graph/manager/util/variable_accelerate_ctrl.cc"
"graph/optimize/graph_optimize.cc"
"graph/optimize/mem_rw_conflict_optimize.cc"
"graph/optimize/summary_optimize.cc"
"graph/partition/engine_place.cc"
"graph/partition/graph_partition.cc"
"graph/passes/addn_pass.cc"
"graph/passes/aicpu_constant_folding_pass.cc"
"graph/passes/assert_pass.cc"
"graph/passes/input_output_connection_identify_pass.cc"
"graph/passes/atomic_addr_clean_pass.cc"
"graph/passes/mark_same_addr_pass.cc"
"graph/passes/mark_graph_unknown_status_pass.cc"
"graph/passes/mark_agnostic_pass.cc"
"graph/partition/dynamic_shape_partition.cc"
"graph/passes/base_pass.cc"
"graph/passes/bitcast_pass.cc"
"graph/passes/cast_remove_pass.cc"
"graph/passes/cast_translate_pass.cc"
"graph/passes/common_subexpression_elimination_pass.cc"
"graph/passes/transop_symmetry_elimination_pass.cc"
"graph/passes/compile_nodes_pass.cc"
"graph/passes/constant_folding_pass.cc"
"graph/passes/constant_fuse_same_pass.cc"
"graph/passes/control_trigger_pass.cc"
"graph/passes/dimension_adjust_pass.cc"
"graph/passes/dimension_compute_pass.cc"
"graph/passes/dropout_pass.cc"
"graph/passes/hccl_group_pass.cc"
"graph/passes/enter_pass.cc"
"graph/passes/assign_pass.cc"
"graph/passes/flow_ctrl_pass.cc"
"graph/passes/global_step_insert_pass.cc"
"host_kernels/transpose_kernel.cc"
"host_kernels/add_kernel.cc"
"host_kernels/broadcast_args_kernel.cc"
"host_kernels/broadcast_gradient_args_kernel.cc"
"host_kernels/cast_kernel.cc"
"host_kernels/concat_offset_kernel.cc"
"host_kernels/concat_v2_kernel.cc"
"host_kernels/dynamic_stitch_kernel.cc"
"host_kernels/identity_kernel.cc"
"host_kernels/empty_kernel.cc"
"host_kernels/expanddims_kernel.cc"
"host_kernels/fill_kernel.cc"
"host_kernels/floordiv_kernel.cc"
"host_kernels/floormod_kernel.cc"
"host_kernels/gather_v2_kernel.cc"
"host_kernels/greater_kernel.cc"
"host_kernels/kernel_utils.cc"
"host_kernels/maximum_kernel.cc"
"host_kernels/mul_kernel.cc"
"host_kernels/pack_kernel.cc"
"host_kernels/permute_kernel.cc"
"host_kernels/range_kernel.cc"
"host_kernels/rank_kernel.cc"
"host_kernels/reduce_prod_kernel.cc"
"host_kernels/reshape_kernel.cc"
"host_kernels/rsqrt_kernel.cc"
"host_kernels/shape_kernel.cc"
"host_kernels/shape_n_kernel.cc"
"host_kernels/size_kernel.cc"
"host_kernels/slice_d_kernel.cc"
"host_kernels/slice_kernel.cc"
"host_kernels/squeeze_kernel.cc"
"host_kernels/unsqueeze_kernel.cc"
"host_kernels/ssd_prior_box_kernel.cc"
"host_kernels/strided_slice_kernel.cc"
"host_kernels/sub_kernel.cc"
"host_kernels/transdata_kernel.cc"
"host_kernels/unpack_kernel.cc"
"graph/passes/folding_pass.cc"
"graph/passes/get_original_format_pass.cc"
"graph/passes/guarantee_const_pass.cc"
"graph/passes/hccl_memcpy_pass.cc"
"graph/passes/identity_pass.cc"
"graph/passes/ref_identity_delete_op_pass.cc"
"graph/passes/infershape_pass.cc"
"graph/passes/isolated_op_remove_pass.cc"
"graph/passes/iterator_op_pass.cc"
"graph/passes/link_gen_mask_nodes_pass.cc"
"graph/passes/merge_pass.cc"
"graph/passes/multi_batch_pass.cc"
"graph/passes/multi_batch_clone_pass.cc"
"graph/passes/subexpression_migration_pass.cc"
"graph/passes/unused_args_clean_pass.cc"
"graph/passes/net_output_pass.cc"
"graph/passes/next_iteration_pass.cc"
"graph/passes/no_use_reshape_remove_pass.cc"
"graph/passes/pass_manager.cc"
"graph/passes/pass_utils.cc"
"graph/passes/permute_pass.cc"
"graph/passes/placeholder_with_default_pass.cc"
"graph/passes/prevent_gradient_pass.cc"
"graph/passes/print_op_pass.cc"
"graph/passes/prune_pass.cc"
"graph/passes/ctrl_edge_transfer_pass.cc"
"graph/passes/replace_with_empty_const_pass.cc"
"graph/passes/reshape_remove_pass.cc"
"graph/passes/reshape_recovery_pass.cc"
"graph/passes/resource_pair_add_control_pass.cc"
"graph/passes/resource_pair_remove_control_pass.cc"
"graph/passes/same_transdata_breadth_fusion_pass.cc"
"graph/passes/save_pass.cc"
"graph/passes/shape_operate_op_remove_pass.cc"
"graph/passes/snapshot_pass.cc"
"graph/passes/stop_gradient_pass.cc"
"graph/passes/subgraph_pass.cc"
"graph/passes/data_pass.cc"
"graph/passes/switch_data_edges_bypass.cc"
"graph/passes/switch_logic_remove_pass.cc"
"graph/passes/merge_to_stream_merge_pass.cc"
"graph/passes/switch_to_stream_switch_pass.cc"
"graph/passes/attach_stream_label_pass.cc"
"graph/passes/switch_dead_branch_elimination.cc"
"graph/passes/replace_transshape_pass.cc"
"graph/passes/transop_breadth_fusion_pass.cc"
"graph/passes/transop_depth_fusion_pass.cc"
"graph/passes/transop_nearby_allreduce_fusion_pass.cc"
"graph/passes/transop_without_reshape_fusion_pass.cc"
"graph/passes/transpose_transdata_pass.cc"
"graph/passes/unused_const_pass.cc"
"graph/passes/unused_op_remove_pass.cc"
"graph/passes/var_is_initialized_op_pass.cc"
"graph/passes/parallel_concat_start_op_pass.cc"
"graph/passes/cond_pass.cc"
"graph/passes/cond_remove_pass.cc"
"graph/passes/for_pass.cc"
"graph/passes/variable_format_pass.cc"
"graph/passes/variable_op_pass.cc"
"graph/passes/variable_prepare_op_pass.cc"
"graph/passes/variable_ref_delete_op_pass.cc"
"graph/passes/variable_ref_useless_control_out_delete_pass.cc"
"graph/passes/end_of_sequence_add_control_pass.cc"
"graph/passes/memcpy_addr_async_pass.cc"
"graph/passes/set_input_output_offset_pass.cc"
"graph/preprocess/graph_preprocess.cc"
"graph/preprocess/insert_op/ge_aipp_op.cc"
"graph/preprocess/insert_op/util_insert_aipp_op.cc"
"graph/preprocess/multi_batch_options.cc"
"graph/preprocess/multi_batch_copy_graph.cc"
"init/gelib.cc"
"model/ge_model.cc"
"model/ge_root_model.cc"
"omm/csa_interact.cc"
"opskernel_manager/ops_kernel_manager.cc"
"session/inner_session.cc"
"session/session_manager.cc"
"single_op/single_op.cc"
"single_op/single_op_manager.cc"
"single_op/single_op_model.cc"
"single_op/stream_resource.cc"
"single_op/task/build_task_utils.cc"
"single_op/task/op_task.cc"
"single_op/task/tbe_task_builder.cc"
"single_op/task/aicpu_task_builder.cc"
"single_op/task/aicpu_kernel_task_builder.cc"
"hybrid/common/tensor_value.cc"
"hybrid/common/npu_memory_allocator.cc"
"hybrid/executor/rt_callback_manager.cc"
"hybrid/executor/node_state.cc"
"hybrid/executor/node_done_manager.cc"
"hybrid/executor/hybrid_profiler.cc"
"hybrid/executor/hybrid_model_executor.cc"
"hybrid/executor/hybrid_model_async_executor.cc"
"hybrid/executor/hybrid_execution_context.cc"
"hybrid/executor/subgraph_context.cc"
"hybrid/executor/subgraph_executor.cc"
"hybrid/executor/worker/task_compile_engine.cc"
"hybrid/executor/worker/shape_inference_engine.cc"
"hybrid/executor/worker/execution_engine.cc"
"hybrid/model/hybrid_model.cc"
"hybrid/model/hybrid_model_builder.cc"
"hybrid/model/node_item.cc"
"hybrid/model/graph_item.cc"
"hybrid/node_executor/aicore/aicore_node_executor.cc"
"hybrid/node_executor/aicore/aicore_op_task.cc"
"hybrid/node_executor/aicore/aicore_task_builder.cc"
"hybrid/node_executor/aicore/aicore_task_compiler.cc"
"hybrid/node_executor/aicpu/aicpu_ext_info.cc"
"hybrid/node_executor/aicpu/aicpu_node_executor.cc"
"hybrid/node_executor/compiledsubgraph/known_node_executor.cc"
"hybrid/node_executor/ge_local/ge_local_node_executor.cc"
"hybrid/node_executor/host_cpu/host_cpu_node_executor.cc"
"hybrid/node_executor/host_cpu/kernel_factory.cc"
"hybrid/node_executor/host_cpu/kernel/no_op_kernel.cc"
"hybrid/node_executor/host_cpu/kernel/variable_kernel.cc"
"hybrid/node_executor/host_cpu/kernel/assign_kernel.cc"
"hybrid/node_executor/host_cpu/kernel/random_uniform_kernel.cc"
"hybrid/node_executor/controlop/control_op_executor.cc"
"hybrid/node_executor/partitioned_call/partitioned_call_node_executor.cc"
"hybrid/node_executor/hccl/hccl_node_executor.cc"
"hybrid/node_executor/rts/rts_node_executor.cc"
"hybrid/node_executor/node_executor.cc"
"hybrid/node_executor/task_context.cc"
"hybrid/hybrid_davinci_model.cc"
"executor/ge_executor.cc"
"client/ge_api.cc"
"client/ge_prof.cc"
"analyzer/analyzer.cc"
)

add_library(ge_runner SHARED ${TRAIN_SRC_LIST} ${PROTO_SRCS} ${PROTO_CLIENT_SRCS})

target_compile_definitions(ge_runner PRIVATE
PROTOBUF_INLINE_NOT_IN_HEADERS=0
DAVINCI_SUPPORT_PROFILING
REUSE_MEMORY=1
FMK_SUPPORT_DUMP
DAVINCI_CLOUD
)

target_compile_options(ge_runner PRIVATE
-O2
)

target_include_directories(ge_runner PRIVATE
${GE_CODE_DIR}/ge
${GE_CODE_DIR}/ge/analyzer
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${GE_CODE_DIR}/inc/framework/common
${METADEF_DIR}
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external/graph
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/graph
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/proto/ge
#### yellow zone ####
${GE_CODE_DIR}/../inc
${GE_CODE_DIR}/../inc/external
${GE_CODE_DIR}/../inc/cce
${GE_CODE_DIR}/../toolchain/ide/ide-daemon/external
#### blue zone
${ASCEND_DIR}/driver/include
${ASCEND_DIR}/fwkacllib/include
${GE_CODE_DIR}/third_party/fwkacllib/inc
${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain
)

target_link_libraries(ge_runner
$<BUILD_INTERFACE:intf_pub>
ge_memory
adump_server
msprofiler
-Wl,--no-as-needed
graph
ge_common
protobuf
register
c_sec
slog
mmpa
msprof
runtime
resource
error_manager
ascend_hal_stub
-Wl,--as-needed
json
-lrt
-ldl
)

############ libge_compiler.so ############
set(INFER_SRC_LIST
"graph/manager/trans_var_data_utils.cc"
"omm/csa_interact.cc"
"common/fp16_t.cc"
"common/formats/utils/formats_trans_utils.cc"
"common/formats/format_transfers/datatype_transfer.cc"
"common/formats/format_transfers/format_transfer_transpose.cc"
"common/formats/format_transfers/format_transfer_nchw_nc1hwc0.cc"
"common/formats/format_transfers/format_transfer_fractal_z.cc"
"common/formats/format_transfers/format_transfer_fractal_nz.cc"
"common/formats/format_transfers/format_transfer_fractal_zz.cc"
"common/formats/format_transfers/format_transfer_nhwc_nc1hwc0.cc"
"common/formats/format_transfers/format_transfer_nc1hwc0_nchw.cc"
"common/formats/format_transfers/format_transfer_nc1hwc0_nhwc.cc"
"common/formats/format_transfers/format_transfer_hwcn_c1hwncoc0.cc"
"common/formats/format_transfers/format_transfer_c1hwncoc0_hwcn.cc"
"common/formats/format_transfers/format_transfer_fracz_nchw.cc"
"common/formats/format_transfers/format_transfer_fracz_nhwc.cc"
"common/formats/format_transfers/format_transfer_fracz_hwcn.cc"
"common/formats/format_transfers/format_transfer_dhwcn_fracz3D.cc"
"common/formats/format_transfers/format_transfer_dhwnc_fracz3D_transpose.cc"
"common/formats/format_transfers/format_transfer_nchw_fz_c04.cc"
"common/formats/formats.cc"
"common/profiling/profiling_manager.cc"
"common/dump/dump_properties.cc"
"common/dump/dump_manager.cc"
"common/dump/dump_op.cc"
"common/dump/dump_server.cc"
"common/helper/model_cache_helper.cc"
"ge_local_engine/engine/host_cpu_engine.cc"
"common/ge/plugin_manager.cc"
"common/ge/op_tiling_manager.cc"
"init/gelib.cc"
"session/inner_session.cc"
"session/session_manager.cc"
"engine_manager/dnnengine_manager.cc"
"opskernel_manager/ops_kernel_manager.cc"
"graph/manager/graph_manager.cc"
"graph/manager/graph_manager_utils.cc"
"graph/manager/graph_context.cc"
"graph/preprocess/graph_preprocess.cc"
"graph/preprocess/multi_batch_options.cc"
"graph/preprocess/multi_batch_copy_graph.cc"
"graph/execute/graph_execute.cc"
"graph/load/graph_loader.cc"
"graph/optimize/graph_optimize.cc"
"graph/optimize/mem_rw_conflict_optimize.cc"
"graph/optimize/summary_optimize.cc"
"graph/build/graph_builder.cc"
"graph/partition/engine_place.cc"
"graph/partition/graph_partition.cc"
"graph/partition/dynamic_shape_partition.cc"
"generator/ge_generator.cc"
"generator/generator_api.cc"
"graph/manager/graph_var_manager.cc"
"graph/manager/host_mem_manager.cc"
"graph/manager/rdma_pool_allocator.cc"
"graph/manager/graph_mem_allocator.cc"
"graph/manager/graph_caching_allocator.cc"
"model/ge_model.cc"
"model/ge_root_model.cc"
"graph/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"
"graph/passes/pass_utils.cc"
"graph/passes/base_pass.cc"
"graph/passes/bitcast_pass.cc"
"graph/passes/constant_folding_pass.cc"
"graph/passes/aicpu_constant_folding_pass.cc"
"graph/passes/reshape_remove_pass.cc"
"graph/passes/reshape_recovery_pass.cc"
"graph/passes/transop_breadth_fusion_pass.cc"
"graph/passes/transop_depth_fusion_pass.cc"
"graph/passes/transop_nearby_allreduce_fusion_pass.cc"
"graph/passes/same_transdata_breadth_fusion_pass.cc"
"graph/passes/transop_without_reshape_fusion_pass.cc"
"graph/passes/compile_nodes_pass.cc"
"graph/passes/variable_prepare_op_pass.cc"
"graph/passes/variable_ref_delete_op_pass.cc"
"graph/passes/variable_ref_useless_control_out_delete_pass.cc"
"graph/passes/subgraph_pass.cc"
"graph/passes/data_pass.cc"
"graph/passes/net_output_pass.cc"
"graph/passes/replace_transshape_pass.cc"
"graph/passes/constant_fuse_same_pass.cc"
"graph/passes/print_op_pass.cc"
"graph/passes/no_use_reshape_remove_pass.cc"
"graph/passes/iterator_op_pass.cc"
"graph/passes/input_output_connection_identify_pass.cc"
"graph/passes/atomic_addr_clean_pass.cc"
"graph/passes/mark_same_addr_pass.cc"
"graph/passes/mark_graph_unknown_status_pass.cc"
"graph/passes/mark_agnostic_pass.cc"
"graph/common/omg_util.cc"
"graph/common/bcast.cc"
"graph/common/local_context.cc"
"graph/passes/dimension_compute_pass.cc"
"graph/passes/dimension_adjust_pass.cc"
"graph/passes/get_original_format_pass.cc"
"graph/passes/shape_operate_op_remove_pass.cc"
"graph/passes/unused_op_remove_pass.cc"
"graph/passes/assert_pass.cc"
"graph/passes/dropout_pass.cc"
"graph/passes/infershape_pass.cc"
"graph/passes/unused_const_pass.cc"
"graph/passes/isolated_op_remove_pass.cc"
"graph/passes/permute_pass.cc"
"graph/passes/ctrl_edge_transfer_pass.cc"
"graph/passes/end_of_sequence_add_control_pass.cc"
"host_kernels/broadcast_gradient_args_kernel.cc"
"host_kernels/greater_kernel.cc"
"host_kernels/gather_v2_kernel.cc"
"host_kernels/maximum_kernel.cc"
"host_kernels/floormod_kernel.cc"
"host_kernels/floordiv_kernel.cc"
"host_kernels/range_kernel.cc"
"host_kernels/shape_kernel.cc"
"host_kernels/size_kernel.cc"
"host_kernels/shape_n_kernel.cc"
"host_kernels/rank_kernel.cc"
"host_kernels/broadcast_args_kernel.cc"
"host_kernels/fill_kernel.cc"
"host_kernels/empty_kernel.cc"
"host_kernels/expanddims_kernel.cc"
"host_kernels/reshape_kernel.cc"
"host_kernels/squeeze_kernel.cc"
"host_kernels/unsqueeze_kernel.cc"
"host_kernels/kernel_utils.cc"
"host_kernels/cast_kernel.cc"
"host_kernels/transdata_kernel.cc"
"host_kernels/unpack_kernel.cc"
"host_kernels/transpose_kernel.cc"
"host_kernels/permute_kernel.cc"
"host_kernels/pack_kernel.cc"
"host_kernels/concat_v2_kernel.cc"
"host_kernels/concat_offset_kernel.cc"
"host_kernels/strided_slice_kernel.cc"
"host_kernels/ssd_prior_box_kernel.cc"
"host_kernels/add_kernel.cc"
"host_kernels/sub_kernel.cc"
"host_kernels/mul_kernel.cc"
"host_kernels/reduce_prod_kernel.cc"
"host_kernels/rsqrt_kernel.cc"
"host_kernels/slice_kernel.cc"
"host_kernels/slice_d_kernel.cc"
"host_kernels/dynamic_stitch_kernel.cc"
"host_kernels/identity_kernel.cc"
"graph/passes/stop_gradient_pass.cc"
"graph/passes/prevent_gradient_pass.cc"
"graph/passes/identity_pass.cc"
"graph/passes/ref_identity_delete_op_pass.cc"
"graph/passes/placeholder_with_default_pass.cc"
"graph/passes/snapshot_pass.cc"
"graph/passes/guarantee_const_pass.cc"
"graph/passes/var_is_initialized_op_pass.cc"
"graph/passes/parallel_concat_start_op_pass.cc"
"graph/passes/folding_pass.cc"
"graph/passes/cast_translate_pass.cc"
"graph/passes/prune_pass.cc"
"graph/passes/merge_to_stream_merge_pass.cc"
"graph/passes/switch_to_stream_switch_pass.cc"
"graph/passes/attach_stream_label_pass.cc"
"graph/passes/multi_batch_pass.cc"
"graph/passes/multi_batch_clone_pass.cc"
"graph/passes/subexpression_migration_pass.cc"
"graph/passes/unused_args_clean_pass.cc"
"graph/passes/next_iteration_pass.cc"
"graph/passes/control_trigger_pass.cc"
"graph/passes/cond_pass.cc"
"graph/passes/cond_remove_pass.cc"
"graph/passes/for_pass.cc"
"graph/passes/enter_pass.cc"
"graph/passes/assign_pass.cc"
"graph/passes/addn_pass.cc"
"graph/passes/common_subexpression_elimination_pass.cc"
"graph/passes/transop_symmetry_elimination_pass.cc"
"graph/passes/save_pass.cc"
"graph/passes/switch_dead_branch_elimination.cc"
"graph/passes/switch_logic_remove_pass.cc"
"graph/passes/switch_data_edges_bypass.cc"
"graph/passes/merge_pass.cc"
"graph/passes/variable_format_pass.cc"
"graph/passes/variable_op_pass.cc"
"graph/passes/cast_remove_pass.cc"
"graph/passes/transpose_transdata_pass.cc"
"graph/passes/hccl_memcpy_pass.cc"
"graph/passes/flow_ctrl_pass.cc"
"graph/passes/global_step_insert_pass.cc"
"graph/passes/link_gen_mask_nodes_pass.cc"
"graph/passes/replace_with_empty_const_pass.cc"
"graph/passes/hccl_group_pass.cc"
"graph/passes/memcpy_addr_async_pass.cc"
"graph/passes/set_input_output_offset_pass.cc"
"graph/manager/model_manager/event_manager.cc"
"graph/manager/util/rt_context_util.cc"
"graph/manager/util/variable_accelerate_ctrl.cc"
"graph/manager/util/debug.cc"
"graph/load/new_model_manager/model_manager.cc"
"graph/load/new_model_manager/data_inputer.cc"
"graph/load/new_model_manager/davinci_model.cc"
"graph/load/new_model_manager/davinci_model_parser.cc"
"graph/load/new_model_manager/model_utils.cc"
"graph/load/new_model_manager/aipp_utils.cc"
"graph/load/new_model_manager/tbe_handle_store.cc"
"graph/load/new_model_manager/cpu_queue_schedule.cc"
"graph/load/new_model_manager/zero_copy_task.cc"
"graph/load/new_model_manager/zero_copy_offset.cc"
"graph/load/new_model_manager/data_dumper.cc"
"graph/load/new_model_manager/task_info/task_info.cc"
"graph/load/new_model_manager/task_info/event_record_task_info.cc"
"graph/load/new_model_manager/task_info/event_wait_task_info.cc"
"graph/load/new_model_manager/task_info/fusion_start_task_info.cc"
"graph/load/new_model_manager/task_info/fusion_stop_task_info.cc"
"graph/load/new_model_manager/task_info/kernel_ex_task_info.cc"
"graph/load/new_model_manager/task_info/kernel_task_info.cc"
"graph/load/new_model_manager/task_info/label_set_task_info.cc"
"graph/load/new_model_manager/task_info/label_switch_by_index_task_info.cc"
"graph/load/new_model_manager/task_info/label_goto_ex_task_info.cc"
"graph/load/new_model_manager/task_info/memcpy_async_task_info.cc"
"graph/load/new_model_manager/task_info/memcpy_addr_async_task_info.cc"
"graph/load/new_model_manager/task_info/profiler_trace_task_info.cc"
"graph/load/new_model_manager/task_info/stream_active_task_info.cc"
"graph/load/new_model_manager/task_info/stream_switch_task_info.cc"
"graph/load/new_model_manager/task_info/stream_switchn_task_info.cc"
"graph/load/new_model_manager/task_info/end_graph_task_info.cc"
"graph/load/new_model_manager/task_info/super_kernel/super_kernel_factory.cc"
"graph/load/new_model_manager/task_info/super_kernel/super_kernel.cc"
"single_op/task/op_task.cc"
"single_op/task/build_task_utils.cc"
"single_op/task/tbe_task_builder.cc"
"single_op/task/aicpu_task_builder.cc"
"single_op/task/aicpu_kernel_task_builder.cc"
"single_op/single_op.cc"
"single_op/single_op_model.cc"
"single_op/stream_resource.cc"
"single_op/single_op_manager.cc"
"hybrid/hybrid_davinci_model_stub.cc"
"ir_build/ge_ir_build.cc"
"ir_build/atc_ir_common.cc"
"graph/preprocess/insert_op/ge_aipp_op.cc"
"graph/preprocess/insert_op/util_insert_aipp_op.cc"
"hybrid/node_executor/aicpu/aicpu_ext_info.cc"
"graph/build/model_builder.cc"
"graph/build/task_generator.cc"
"graph/build/stream_allocator.cc"
"graph/build/logical_stream_allocator.cc"
"graph/build/stream_graph_optimizer.cc"
"graph/build/run_context.cc"
"graph/build/label_allocator.cc"
"graph/label/label_maker.cc"
"graph/label/if_label_maker.cc"
"graph/label/case_label_maker.cc"
"graph/label/while_label_maker.cc"
"graph/label/partitioned_call_label_maker.cc"
"analyzer/analyzer.cc"
)

add_library(ge_compiler SHARED ${INFER_SRC_LIST} ${PROTO_SRCS})

target_compile_definitions(ge_compiler PRIVATE
PROTOBUF_INLINE_NOT_IN_HEADERS=0
REUSE_MEMORY=1
FMK_SUPPORT_DUMP
FMK_HOST_INFER
COMPILE_OMG_PACKAGE
)

target_compile_options(ge_compiler PRIVATE
-O2
)

target_include_directories(ge_compiler PRIVATE
${GE_CODE_DIR}/ge
${GE_CODE_DIR}/ge/analyzer
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${GE_CODE_DIR}/inc/framework/common
${METADEF_DIR}
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external/graph
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/graph
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/proto/ge
#### yellow zone ####
${GE_CODE_DIR}/../inc
${GE_CODE_DIR}/../inc/external
${GE_CODE_DIR}/../inc/cce
${GE_CODE_DIR}/../toolchain/ide/ide-daemon/external
#### blue zone ####
${ASCEND_DIR}/driver/include
${ASCEND_DIR}/fwkacllib/include
${GE_CODE_DIR}/third_party/fwkacllib/inc
${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain
)

target_link_libraries(ge_compiler
$<BUILD_INTERFACE:intf_pub>
ge_memory
-Wl,--no-as-needed
graph
ge_common
protobuf
register
c_sec
error_manager
slog
mmpa
runtime_compile
resource
-Wl,--as-needed
json
-lrt
-ldl
)

############ libascendcl.so ############
file(GENERATE OUTPUT ${CMAKE_BINARY_DIR}/dummy.c CONTENT "")
#add_library(dummy_obj OBJECT ${CMAKE_BINARY_DIR}/dummy.c)
#set(DUMMY_OBJ $<TARGET_OBJECTS:dummy_obj>)

file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ascendcl_object)

if(EXISTS ${STATIC_ACL_LIB}/libascendcl.a)
execute_process(
COMMAND ar x ${STATIC_ACL_LIB}/libascendcl.a
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ascendcl_object
)
file(GLOB OBJECT_LIST ${CMAKE_CURRENT_BINARY_DIR}/ascendcl_object/*.o)
else()
set(OBJECT_LIST ${CMAKE_BINARY_DIR}/dummy.c)
endif()

add_library(opensrc_ascendcl SHARED
${OBJECT_LIST}
)
target_compile_options(opensrc_ascendcl PRIVATE
-O2
-fvisibility=hidden
)
target_link_options(opensrc_ascendcl PRIVATE
-rdynamic
-Wl,--allow-multiple-definition
-Wl,-z,muldefs
-Wl,-Bsymbolic
-Wl,--exclude-libs,ALL
)
target_link_libraries(opensrc_ascendcl PRIVATE
-Wl,--whole-archive
ge_executor
ge_common_static
graph_static
protobuf_static
register_static
error_manager_static
adump_server
msprofiler
-Wl,--no-whole-archive
-Wl,--no-as-needed
c_sec
runtime
mmpa
slog
msprof
ascend_hal_stub
-Wl,--as-needed
-ldl
json
)

set_target_properties(opensrc_ascendcl PROPERTIES
OUTPUT_NAME ascendcl
)

##################################################################
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/stub_ge_ir_build.cc
${CMAKE_CURRENT_BINARY_DIR}/stub_ge_api.cc
${CMAKE_CURRENT_BINARY_DIR}/stub_ge_prof.cc
COMMAND echo "Generating stub files."
&& ${HI_PYTHON} ${CMAKE_CURRENT_LIST_DIR}/stub/gen_stubapi.py ${GE_CODE_DIR}/inc/external ${CMAKE_CURRENT_BINARY_DIR}
&& mv ge_ir_build.cc stub_ge_ir_build.cc
&& mv ge_api.cc stub_ge_api.cc
&& mv ge_prof.cc stub_ge_prof.cc
&& echo "Generating stub files end."
#WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
#DEPENDS stub/gen_stubapi.py ${TOP_DIR}/inc/external ${CMAKE_CURRENT_BINARY_DIR}
)

add_custom_target(ge_stub
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/stub_ge_ir_build.cc
${CMAKE_CURRENT_BINARY_DIR}/stub_ge_api.cc
${CMAKE_CURRENT_BINARY_DIR}/stub_ge_prof.cc
)

##################################################################
############ stub/libge_compiler.so ############
add_library(atc_stub_ge_compiler SHARED
stub_ge_ir_build.cc
)

add_dependencies(atc_stub_ge_compiler ge_stub)

target_link_libraries(atc_stub_ge_compiler PRIVATE
$<BUILD_INTERFACE:intf_pub>
)

set_target_properties(atc_stub_ge_compiler PROPERTIES
OUTPUT_NAME ge_compiler
LIBRARY_OUTPUT_DIRECTORY atc_stub
)

target_include_directories(atc_stub_ge_compiler PRIVATE
${GE_CODE_DIR}
${GE_CODE_DIR}/ge
${GE_CODE_DIR}/ge/analyzer
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/framework
${GE_CODE_DIR}/inc/framework/common
${GE_CODE_DIR}/inc/external
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph
${METADEF_DIR}/inc/graph
#### yellow zone ####
${GE_CODE_DIR}/../inc/cce
${GE_CODE_DIR}/../toolchain/ide/ide-daemon/external
#### blue zone ####
${ASCEND_DIR}/driver/include
${ASCEND_DIR}/fwkacllib/include
)

############ stub/libge_runner.so ############
add_library(fwk_stub_ge_runner SHARED
stub_ge_api.cc
stub_ge_prof.cc
)

add_dependencies(fwk_stub_ge_runner ge_stub)

target_link_libraries(fwk_stub_ge_runner PRIVATE
$<BUILD_INTERFACE:intf_pub>
)

set_target_properties(fwk_stub_ge_runner PROPERTIES
OUTPUT_NAME ge_runner
LIBRARY_OUTPUT_DIRECTORY fwk_stub
)

target_include_directories(fwk_stub_ge_runner PRIVATE
${GE_CODE_DIR}
${GE_CODE_DIR}/ge
${GE_CODE_DIR}/ge/analyzer
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${GE_CODE_DIR}/inc/framework/common
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph
${METADEF_DIR}/inc/graph
#### yellow zone ####
${GE_CODE_DIR}/../inc/cce
${GE_CODE_DIR}/../toolchain/ide/ide-daemon/external
#### blue zone ####
${ASCEND_DIR}/driver/include
${ASCEND_DIR}/fwkacllib/include
)

###############################################################
add_custom_target(
engine_conf.json ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/engine_conf.json
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/engine_conf.json
COMMAND cp ${CMAKE_CURRENT_LIST_DIR}/engine_manager/engine_conf.json ${CMAKE_CURRENT_BINARY_DIR}/
)

###############################################################
add_custom_target(
optimizer_priority.pbtxt ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/optimizer_priority.pbtxt
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/optimizer_priority.pbtxt
COMMAND cp ${CMAKE_CURRENT_LIST_DIR}/opskernel_manager/optimizer_priority.pbtxt ${CMAKE_CURRENT_BINARY_DIR}/
)

###############################################################

############ install ############
set(INSTALL_BASE_DIR "")
set(INSTALL_LIBRARY_DIR lib)

install(TARGETS ge_runner ge_compiler opensrc_ascendcl OPTIONAL
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
)

install(TARGETS atc_stub_ge_compiler fwk_stub_ge_runner OPTIONAL
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}/stub
)

install(FILES
${CMAKE_CURRENT_BINARY_DIR}/engine_conf.json
${CMAKE_CURRENT_BINARY_DIR}/optimizer_priority.pbtxt OPTIONAL
DESTINATION ${INSTALL_LIBRARY_DIR}
)

+ 113
- 0
ge/executor/CMakeLists.txt View File

@@ -0,0 +1,113 @@
set(PROTO_LIST
"${METADEF_DIR}/proto/om.proto"
"${METADEF_DIR}/proto/ge_ir.proto"
"${METADEF_DIR}/proto/insert_op.proto"
"${METADEF_DIR}/proto/task.proto"
"${METADEF_DIR}/proto/op_mapping_info.proto"
"${METADEF_DIR}/proto/dump_task.proto"
)

protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST})

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/dump_manager.cc"
"../common/dump/dump_op.cc"
"../graph/load/graph_loader.cc"
"../graph/execute/graph_execute.cc"
"../omm/csa_interact.cc"
"../graph/manager/graph_manager_utils.cc"
"../graph/manager/graph_var_manager.cc"
"../graph/manager/graph_mem_allocator.cc"
"../graph/manager/graph_caching_allocator.cc"
"../graph/manager/trans_var_data_utils.cc"
"../graph/manager/util/debug.cc"
"../graph/manager/rdma_pool_allocator.cc"
"../hybrid/node_executor/aicpu/aicpu_ext_info.cc"
"../model/ge_model.cc"
"../model/ge_root_model.cc"
"../graph/load/new_model_manager/davinci_model.cc"
"../graph/load/new_model_manager/davinci_model_parser.cc"
"../graph/load/new_model_manager/model_manager.cc"
"../graph/load/new_model_manager/tbe_handle_store.cc"
"../graph/load/new_model_manager/cpu_queue_schedule.cc"
"../graph/load/new_model_manager/model_utils.cc"
"../graph/load/new_model_manager/aipp_utils.cc"
"../graph/load/new_model_manager/data_inputer.cc"
"../graph/load/new_model_manager/data_dumper.cc"
"../graph/load/new_model_manager/zero_copy_task.cc"
"../graph/load/new_model_manager/zero_copy_offset.cc"
"../graph/load/new_model_manager/task_info/task_info.cc"
"../graph/load/new_model_manager/task_info/event_record_task_info.cc"
"../graph/load/new_model_manager/task_info/event_wait_task_info.cc"
"../graph/load/new_model_manager/task_info/fusion_start_task_info.cc"
"../graph/load/new_model_manager/task_info/fusion_stop_task_info.cc"
"../graph/load/new_model_manager/task_info/kernel_ex_task_info.cc"
"../graph/load/new_model_manager/task_info/kernel_task_info.cc"
"../graph/load/new_model_manager/task_info/label_set_task_info.cc"
"../graph/load/new_model_manager/task_info/label_switch_by_index_task_info.cc"
"../graph/load/new_model_manager/task_info/label_goto_ex_task_info.cc"
"../graph/load/new_model_manager/task_info/memcpy_async_task_info.cc"
"../graph/load/new_model_manager/task_info/memcpy_addr_async_task_info.cc"
"../graph/load/new_model_manager/task_info/profiler_trace_task_info.cc"
"../graph/load/new_model_manager/task_info/stream_active_task_info.cc"
"../graph/load/new_model_manager/task_info/stream_switch_task_info.cc"
"../graph/load/new_model_manager/task_info/stream_switchn_task_info.cc"
"../graph/load/new_model_manager/task_info/end_graph_task_info.cc"
"../graph/load/new_model_manager/task_info/super_kernel/super_kernel_factory.cc"
"../graph/load/new_model_manager/task_info/super_kernel/super_kernel.cc"
"../single_op/single_op_manager.cc"
"../single_op/single_op_model.cc"
"../single_op/single_op.cc"
"../single_op/stream_resource.cc"
"../single_op/task/op_task.cc"
"../single_op/task/build_task_utils.cc"
"../single_op/task/tbe_task_builder.cc"
"../single_op/task/aicpu_task_builder.cc"
"../single_op/task/aicpu_kernel_task_builder.cc"
"../hybrid/hybrid_davinci_model_stub.cc"
)

######## libge_executor.a ########
add_library(ge_executor STATIC ${SRC_LIST} ${PROTO_HDRS})

target_compile_options(ge_executor PRIVATE
-Werror
-O2
)

target_compile_definitions(ge_executor PRIVATE
PROTOBUF_INLINE_NOT_IN_HEADERS=0
DAVINCI_SUPPORT_PROFILING
)

target_include_directories(ge_executor PRIVATE
${GE_CODE_DIR}/ge
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph
${METADEF_DIR}/inc/graph
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/proto/ge
#### yellow zone ####
${GE_CODE_DIR}/../inc
${GE_CODE_DIR}/../inc/cce
#### blue zone ####
${GE_CODE_DIR}/third_party/fwkacllib/inc
)

target_link_libraries(ge_executor PRIVATE
$<BUILD_INTERFACE:intf_pub>
json
protobuf
c_sec
-lrt
-ldl
)

+ 116
- 0
ge/ge_local_engine/CMakeLists.txt View File

@@ -0,0 +1,116 @@
set(PROTO_LIST
"${METADEF_DIR}/proto/task.proto"
)

set(SRC_LIST
"engine/ge_local_engine.cc"
"ops_kernel_store/ge_local_ops_kernel_info.cc"
"ops_kernel_store/op/op_factory.cc"
"ops_kernel_store/op/op.cc"
"ops_kernel_store/op/ge_deleted_op.cc"
"ops_kernel_store/op/no_op.cc"
)

set(OPS_KERNEL_SRC_LIST
"ops_kernel_store/op/op_factory.cc"
"ops_kernel_store/op/op.cc"
"ops_kernel_store/op/ge_deleted_op.cc"
"ops_kernel_store/op/no_op.cc"
)

protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST})

############ libge_local_engine.so ############
add_library(ge_local_engine SHARED ${SRC_LIST} ${PROTO_HDRS})

target_compile_options(ge_local_engine PRIVATE
-Werror
)

target_include_directories(ge_local_engine PRIVATE
${CMAKE_CURRENT_LIST_DIR}
${GE_CODE_DIR}/ge
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph
${METADEF_DIR}/inc/graph
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/proto/ge
#### yellow zone ####
${GE_CODE_DIR}/../inc
#### blue zone ####
${GE_CODE_DIR}/third_party/fwkacllib/inc
)

target_link_libraries(ge_local_engine PRIVATE
$<BUILD_INTERFACE:intf_pub>
-Wl,--no-as-needed
graph
protobuf
register
c_sec
slog
runtime
-Wl,--as-needed
)

######### atclib/libge_local_engine.so #############
add_library(atc_ge_local_engine SHARED ${SRC_LIST} ${PROTO_HDRS})

target_compile_options(atc_ge_local_engine PRIVATE
-Werror
)

target_compile_definitions(atc_ge_local_engine PRIVATE
COMPILE_OMG_PACKAGE
)

target_include_directories(atc_ge_local_engine PRIVATE
${CMAKE_CURRENT_LIST_DIR}
${GE_CODE_DIR}/ge
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph
${METADEF_DIR}/inc/graph
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/proto/ge
#### yellow zone ####
${GE_CODE_DIR}/../inc
#### blue zone ####
${GE_CODE_DIR}/third_party/fwkacllib/inc
)

target_link_libraries(atc_ge_local_engine PRIVATE
$<BUILD_INTERFACE:intf_pub>
-Wl,--no-as-needed
graph
protobuf
register
c_sec
slog
runtime_compile
-Wl,--as-needed
)

set_target_properties(atc_ge_local_engine PROPERTIES
OUTPUT_NAME ge_local_engine
LIBRARY_OUTPUT_DIRECTORY atclib
)

############ install ############
set(INSTALL_BASE_DIR "")
set(INSTALL_LIBRARY_DIR lib)

install(TARGETS ge_local_engine OPTIONAL
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
)

install(TARGETS atc_ge_local_engine OPTIONAL
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}/atclib
)

+ 109
- 0
ge/host_cpu_engine/CMakeLists.txt View File

@@ -0,0 +1,109 @@
set(PROTO_LIST
"${METADEF_DIR}/proto/task.proto"
)

protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST})

set(SRC_LIST
"engine/host_cpu_engine.cc"
"ops_kernel_store/host_cpu_ops_kernel_info.cc"
"ops_kernel_store/op/op_factory.cc"
"ops_kernel_store/op/host_op.cc"
)

set(CPU_OPS_KERNEL_LIST
"ops_kernel_store/host_cpu_ops_kernel_builder.cc"
)

############ libhost_cpu_engine.so ############
add_library(host_cpu_engine SHARED ${SRC_LIST} ${PROTO_HDRS})

target_compile_options(host_cpu_engine PRIVATE
-Werror
)

target_include_directories(host_cpu_engine PRIVATE
${CMAKE_CURRENT_LIST_DIR}
${GE_CODE_DIR}/ge
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/proto/ge
#### yellow zone ####
${GE_CODE_DIR}/../inc
#### blue zone ####
${GE_CODE_DIR}/third_party/fwkacllib/inc
)

target_link_libraries(host_cpu_engine PRIVATE
$<BUILD_INTERFACE:intf_pub>
-Wl,--no-as-needed
protobuf
c_sec
graph
register
slog
runtime
-Wl,--as-needed
)

############ atcstub/libhost_cpu_engine.so ############
add_library(atc_host_cpu_engine SHARED ${SRC_LIST} ${PROTO_HDRS})

target_compile_options(atc_host_cpu_engine PRIVATE
-Werror
)

target_compile_definitions(atc_host_cpu_engine PRIVATE
COMPILE_OMG_PACKAGE
)

target_include_directories(atc_host_cpu_engine PRIVATE
${CMAKE_CURRENT_LIST_DIR}
${GE_CODE_DIR}/ge
${GE_CODE_DIR}/inc
${GE_CODE_DIR}/inc/external
${GE_CODE_DIR}/inc/framework
${METADEF_DIR}/inc
${METADEF_DIR}/inc/external
${METADEF_DIR}/inc/external/graph
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/proto/ge
#### yellow zone ####
${GE_CODE_DIR}/../inc
#### blue zone ####
${GE_CODE_DIR}/third_party/fwkacllib/inc
)

target_link_libraries(atc_host_cpu_engine PRIVATE
$<BUILD_INTERFACE:intf_pub>
-Wl,--no-as-needed
protobuf
c_sec
graph
register
slog
runtime_compile
-Wl,--as-needed
)

set_target_properties(atc_host_cpu_engine PROPERTIES
OUTPUT_NAME host_cpu_engine
LIBRARY_OUTPUT_DIRECTORY atclib
)

############ install ############
set(INSTALL_BASE_DIR "")
set(INSTALL_LIBRARY_DIR lib)

install(TARGETS host_cpu_engine OPTIONAL
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
)

install(TARGETS atc_host_cpu_engine OPTIONAL
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}/atclib
)

+ 1
- 1
src/ge/stub/gen_stubapi.py View File

@@ -64,7 +64,7 @@ max_code_len_per_line = 100
when DEBUG on
"""
white_list_for_debug = ["attr_value.h", "operator.h", "tensor.h", "graph.h", "operator_factory.h",
"ge_ir_build.h", "ge_api.h", "tensorflow_parser.h", "caffe_parser.h"]
"ge_ir_build.h", "ge_api.h", "ge_prof.h", "tensorflow_parser.h", "caffe_parser.h"]
include_dir_key_words = ["ge", "graph", "parser"]
DEBUG = True



Loading…
Cancel
Save