You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

graphengine.cmake 6.8 kB

modified: CMakeLists.txt modified: build.sh modified: ge/ge_runtime/runtime_model.cc modified: ge/ge_runtime/task/aicpu_task.cc modified: ge/ge_runtime/task/hccl_task.cc modified: ge/ge_runtime/task/label_goto_task.cc modified: ge/ge_runtime/task/label_switch_task.cc new file: tests/st/CMakeLists.txt new file: tests/st/cmake/graphengine.cmake new file: tests/st/framework/CMakeLists.txt new file: tests/st/framework/framework.cc new file: tests/st/framework/framework.h new file: tests/st/framework/stub_engine/CMakeLists.txt new file: tests/st/framework/stub_engine/common/constant/constant.h new file: tests/st/framework/stub_engine/engine/stub_engine.cc new file: tests/st/framework/stub_engine/engine/stub_engine.h new file: tests/st/framework/stub_engine/ops_kernel_store/host_cpu_ops_kernel_builder.cc new file: tests/st/framework/stub_engine/ops_kernel_store/host_cpu_ops_kernel_builder.h new file: tests/st/framework/stub_engine/ops_kernel_store/host_cpu_ops_kernel_info.cc new file: tests/st/framework/stub_engine/ops_kernel_store/host_cpu_ops_kernel_info.h new file: tests/st/framework/stub_engine/ops_kernel_store/op/host_op.cc new file: tests/st/framework/stub_engine/ops_kernel_store/op/host_op.h new file: tests/st/framework/stub_engine/ops_kernel_store/op/op.h new file: tests/st/framework/stub_engine/ops_kernel_store/op/op_factory.cc new file: tests/st/framework/stub_engine/ops_kernel_store/op/op_factory.h new file: tests/st/framework/stub_engine/proto/task.proto new file: tests/st/framework/stub_op_proto/array_ops.cc new file: tests/st/framework/stub_op_proto/array_ops.h new file: tests/st/framework/stub_op_proto/control_flow_ops.cc new file: tests/st/framework/stub_op_proto/control_flow_ops.h new file: tests/st/framework/stub_op_proto/elewise_calculation_ops.cc new file: tests/st/framework/stub_op_proto/elewise_calculation_ops.h new file: tests/st/framework/stub_op_proto/util/array_ops_shape_fns.cc new file: tests/st/framework/stub_op_proto/util/array_ops_shape_fns.h new file: tests/st/framework/stub_op_proto/util/axis_util.cc new file: tests/st/framework/stub_op_proto/util/axis_util.h new file: tests/st/framework/stub_op_proto/util/common_shape_fns.cc new file: tests/st/framework/stub_op_proto/util/common_shape_fns.h new file: tests/st/framework/stub_op_proto/util/error_code.h new file: tests/st/framework/stub_op_proto/util/error_util.cc new file: tests/st/framework/stub_op_proto/util/error_util.h new file: tests/st/framework/stub_op_proto/util/op_common_util.h new file: tests/st/framework/stub_op_proto/util/op_log.h new file: tests/st/framework/stub_op_proto/util/transfer_shape_according_to_format.cc new file: tests/st/framework/stub_op_proto/util/transfer_shape_according_to_format.h new file: tests/st/framework/stub_op_proto/util/util.cc new file: tests/st/framework/stub_op_proto/util/util.h new file: tests/st/framework/utils/assertion/graph_assertion.cc new file: tests/st/framework/utils/assertion/graph_assertion.h new file: tests/st/framework/utils/builder/graph_builder_utils.cc new file: tests/st/framework/utils/builder/graph_builder_utils.h new file: tests/st/framework/utils/builder/tensor_builder_utils.cc new file: tests/st/framework/utils/builder/tensor_builder_utils.h new file: tests/st/test.cc new file: tests/st/testcase/CMakeLists.txt new file: tests/st/testcase/test_framework_dummy.cc modified: CMakeLists.txt modified: build.sh modified: ge/ge_runtime/runtime_model.cc modified: ge/ge_runtime/task/aicpu_task.cc modified: ge/ge_runtime/task/hccl_task.cc modified: ge/ge_runtime/task/label_goto_task.cc modified: ge/ge_runtime/task/label_switch_task.cc new file: tests/st/CMakeLists.txt new file: tests/st/cmake/graphengine.cmake new file: tests/st/framework/CMakeLists.txt new file: tests/st/framework/framework.cc new file: tests/st/framework/framework.h new file: tests/st/framework/stub_engine/CMakeLists.txt new file: tests/st/framework/stub_engine/common/constant/constant.h new file: tests/st/framework/stub_engine/engine/stub_engine.cc new file: tests/st/framework/stub_engine/engine/stub_engine.h new file: tests/st/framework/stub_engine/ops_kernel_store/host_cpu_ops_kernel_builder.cc new file: tests/st/framework/stub_engine/ops_kernel_store/host_cpu_ops_kernel_builder.h new file: tests/st/framework/stub_engine/ops_kernel_store/host_cpu_ops_kernel_info.cc new file: tests/st/framework/stub_engine/ops_kernel_store/host_cpu_ops_kernel_info.h new file: tests/st/framework/stub_engine/ops_kernel_store/op/host_op.cc new file: tests/st/framework/stub_engine/ops_kernel_store/op/host_op.h new file: tests/st/framework/stub_engine/ops_kernel_store/op/op.h new file: tests/st/framework/stub_engine/ops_kernel_store/op/op_factory.cc new file: tests/st/framework/stub_engine/ops_kernel_store/op/op_factory.h new file: tests/st/framework/stub_engine/proto/task.proto new file: tests/st/framework/stub_op_proto/array_ops.cc new file: tests/st/framework/stub_op_proto/array_ops.h new file: tests/st/framework/stub_op_proto/control_flow_ops.cc new file: tests/st/framework/stub_op_proto/control_flow_ops.h new file: tests/st/framework/stub_op_proto/elewise_calculation_ops.cc new file: tests/st/framework/stub_op_proto/elewise_calculation_ops.h new file: tests/st/framework/stub_op_proto/util/array_ops_shape_fns.cc new file: tests/st/framework/stub_op_proto/util/array_ops_shape_fns.h new file: tests/st/framework/stub_op_proto/util/axis_util.cc new file: tests/st/framework/stub_op_proto/util/axis_util.h new file: tests/st/framework/stub_op_proto/util/common_shape_fns.cc new file: tests/st/framework/stub_op_proto/util/common_shape_fns.h new file: tests/st/framework/stub_op_proto/util/error_code.h new file: tests/st/framework/stub_op_proto/util/error_util.cc new file: tests/st/framework/stub_op_proto/util/error_util.h new file: tests/st/framework/stub_op_proto/util/op_common_util.h new file: tests/st/framework/stub_op_proto/util/op_log.h new file: tests/st/framework/stub_op_proto/util/transfer_shape_according_to_format.cc new file: tests/st/framework/stub_op_proto/util/transfer_shape_according_to_format.h new file: tests/st/framework/stub_op_proto/util/util.cc new file: tests/st/framework/stub_op_proto/util/util.h new file: tests/st/framework/utils/assertion/graph_assertion.cc new file: tests/st/framework/utils/assertion/graph_assertion.h new file: tests/st/framework/utils/builder/graph_builder_utils.cc new file: tests/st/framework/utils/builder/graph_builder_utils.h new file: tests/st/framework/utils/builder/tensor_builder_utils.cc new file: tests/st/framework/utils/builder/tensor_builder_utils.h new file: tests/st/test.cc new file: tests/st/testcase/CMakeLists.txt new file: tests/st/testcase/test_framework_dummy.cc modified: CMakeLists.txt modified: build.sh modified: ge/ge_runtime/runtime_model.cc modified: ge/ge_runtime/task/aicpu_task.cc modified: ge/ge_runtime/task/hccl_task.cc modified: ge/ge_runtime/task/label_goto_task.cc modified: ge/ge_runtime/task/label_switch_task.cc new file: tests/st/CMakeLists.txt new file: tests/st/cmake/graphengine.cmake new file: tests/st/framework/CMakeLists.txt new file: tests/st/framework/framework.cc new file: tests/st/framework/framework.h new file: tests/st/framework/stub_engine/CMakeLists.txt new file: tests/st/framework/stub_engine/common/constant/constant.h new file: tests/st/framework/stub_engine/engine/stub_engine.cc new file: tests/st/framework/stub_engine/engine/stub_engine.h new file: tests/st/framework/stub_engine/ops_kernel_store/host_cpu_ops_kernel_builder.cc new file: tests/st/framework/stub_engine/ops_kernel_store/host_cpu_ops_kernel_builder.h new file: tests/st/framework/stub_engine/ops_kernel_store/host_cpu_ops_kernel_info.cc new file: tests/st/framework/stub_engine/ops_kernel_store/host_cpu_ops_kernel_info.h new file: tests/st/framework/stub_engine/ops_kernel_store/op/host_op.cc new file: tests/st/framework/stub_engine/ops_kernel_store/op/host_op.h new file: tests/st/framework/stub_engine/ops_kernel_store/op/op.h new file: tests/st/framework/stub_engine/ops_kernel_store/op/op_factory.cc new file: tests/st/framework/stub_engine/ops_kernel_store/op/op_factory.h new file: tests/st/framework/stub_engine/proto/task.proto new file: tests/st/framework/stub_op_proto/array_ops.cc new file: tests/st/framework/stub_op_proto/array_ops.h new file: tests/st/framework/stub_op_proto/control_flow_ops.cc new file: tests/st/framework/stub_op_proto/control_flow_ops.h new file: tests/st/framework/stub_op_proto/elewise_calculation_ops.cc new file: tests/st/framework/stub_op_proto/elewise_calculation_ops.h new file: tests/st/framework/stub_op_proto/util/array_ops_shape_fns.cc new file: tests/st/framework/stub_op_proto/util/array_ops_shape_fns.h new file: tests/st/framework/stub_op_proto/util/axis_util.cc new file: tests/st/framework/stub_op_proto/util/axis_util.h new file: tests/st/framework/stub_op_proto/util/common_shape_fns.cc new file: tests/st/framework/stub_op_proto/util/common_shape_fns.h new file: tests/st/framework/stub_op_proto/util/error_code.h new file: tests/st/framework/stub_op_proto/util/error_util.cc new file: tests/st/framework/stub_op_proto/util/error_util.h new file: tests/st/framework/stub_op_proto/util/op_common_util.h new file: tests/st/framework/stub_op_proto/util/op_log.h new file: tests/st/framework/stub_op_proto/util/transfer_shape_according_to_format.cc new file: tests/st/framework/stub_op_proto/util/transfer_shape_according_to_format.h new file: tests/st/framework/stub_op_proto/util/util.cc new file: tests/st/framework/stub_op_proto/util/util.h new file: tests/st/framework/utils/assertion/graph_assertion.cc new file: tests/st/framework/utils/assertion/graph_assertion.h new file: tests/st/framework/utils/builder/graph_builder_utils.cc new file: tests/st/framework/utils/builder/graph_builder_utils.h new file: tests/st/framework/utils/builder/tensor_builder_utils.cc new file: tests/st/framework/utils/builder/tensor_builder_utils.h new file: tests/st/test.cc new file: tests/st/testcase/CMakeLists.txt new file: tests/st/testcase/test_framework_dummy.cc modified: CMakeLists.txt modified: build.sh modified: ge/ge_runtime/runtime_model.cc modified: ge/ge_runtime/task/aicpu_task.cc modified: ge/ge_runtime/task/hccl_task.cc modified: ge/ge_runtime/task/label_goto_task.cc modified: ge/ge_runtime/task/label_switch_task.cc new file: tests/st/CMakeLists.txt new file: tests/st/cmake/graphengine.cmake new file: tests/st/framework/CMakeLists.txt new file: tests/st/framework/framework.cc new file: tests/st/framework/framework.h new file: tests/st/framework/stub_engine/CMakeLists.txt new file: tests/st/framework/stub_engine/common/constant/constant.h new file: tests/st/framework/stub_engine/engine/stub_engine.cc new file: tests/st/framework/stub_engine/engine/stub_engine.h new file: tests/st/framework/stub_engine/ops_kernel_store/host_cpu_ops_kernel_builder.cc new file: tests/st/framework/stub_engine/ops_kernel_store/host_cpu_ops_kernel_builder.h new file: tests/st/framework/stub_engine/ops_kernel_store/host_cpu_ops_kernel_info.cc new file: tests/st/framework/stub_engine/ops_kernel_store/host_cpu_ops_kernel_info.h new file: tests/st/framework/stub_engine/ops_kernel_store/op/host_op.cc new file: tests/st/framework/stub_engine/ops_kernel_store/op/host_op.h new file: tests/st/framework/stub_engine/ops_kernel_store/op/op.h new file: tests/st/framework/stub_engine/ops_kernel_store/op/op_factory.cc new file: tests/st/framework/stub_engine/ops_kernel_store/op/op_factory.h new file: tests/st/framework/stub_engine/proto/task.proto new file: tests/st/framework/stub_op_proto/array_ops.cc new file: tests/st/framework/stub_op_proto/array_ops.h new file: tests/st/framework/stub_op_proto/control_flow_ops.cc new file: tests/st/framework/stub_op_proto/control_flow_ops.h new file: tests/st/framework/stub_op_proto/elewise_calculation_ops.cc new file: tests/st/framework/stub_op_proto/elewise_calculation_ops.h new file: tests/st/framework/stub_op_proto/util/array_ops_shape_fns.cc new file: tests/st/framework/stub_op_proto/util/array_ops_shape_fns.h new file: tests/st/framework/stub_op_proto/util/axis_util.cc new file: tests/st/framework/stub_op_proto/util/axis_util.h new file: tests/st/framework/stub_op_proto/util/common_shape_fns.cc new file: tests/st/framework/stub_op_proto/util/common_shape_fns.h new file: tests/st/framework/stub_op_proto/util/error_code.h new file: tests/st/framework/stub_op_proto/util/error_util.cc new file: tests/st/framework/stub_op_proto/util/error_util.h new file: tests/st/framework/stub_op_proto/util/op_common_util.h new file: tests/st/framework/stub_op_proto/util/op_log.h new file: tests/st/framework/stub_op_proto/util/transfer_shape_according_to_format.cc new file: tests/st/framework/stub_op_proto/util/transfer_shape_according_to_format.h new file: tests/st/framework/stub_op_proto/util/util.cc new file: tests/st/framework/stub_op_proto/util/util.h new file: tests/st/framework/utils/assertion/graph_assertion.cc new file: tests/st/framework/utils/assertion/graph_assertion.h new file: tests/st/framework/utils/builder/graph_builder_utils.cc new file: tests/st/framework/utils/builder/graph_builder_utils.h new file: tests/st/framework/utils/builder/tensor_builder_utils.cc new file: tests/st/framework/utils/builder/tensor_builder_utils.h new file: tests/st/testcase/CMakeLists.txt new file: tests/st/testcase/test_framework_dummy.cc
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. # ---- Test coverage ----
  2. if (ENABLE_GE_COV)
  3. set(COVERAGE_COMPILER_FLAGS "-g --coverage -fprofile-arcs -fPIC -O0 -ftest-coverage")
  4. set(CMAKE_CXX_FLAGS "${COVERAGE_COMPILER_FLAGS}")
  5. endif()
  6. # ---- Proto generate ----
  7. file(GLOB_RECURSE PROTO_FILES CONFIGURE_DEPENDS "${GE_CODE_DIR}/metadef/proto/*.proto")
  8. protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_FILES})
  9. # ---- File glob by group ----
  10. file(GLOB_RECURSE METADEF_SRCS CONFIGURE_DEPENDS
  11. "${GE_CODE_DIR}/metadef/graph/*.cc"
  12. "${GE_CODE_DIR}/metadef/register/*.cc"
  13. "${GE_CODE_DIR}/metadef/register/*.cpp"
  14. "${GE_CODE_DIR}/metadef/ops/*.cc"
  15. "${GE_CODE_DIR}/metadef/third_party/transformer/src/*.cc"
  16. )
  17. file(GLOB_RECURSE METADEF_REGISTER_SRCS CONFIGURE_DEPENDS
  18. "${GE_CODE_DIR}/metadef/register/*.cc"
  19. "${GE_CODE_DIR}/metadef/register/*.cpp"
  20. )
  21. file(GLOB_RECURSE PARSER_SRCS CONFIGURE_DEPENDS
  22. "${GE_CODE_DIR}/parser/parser/common/*.cc"
  23. )
  24. file(GLOB_RECURSE LOCAL_ENGINE_SRC CONFIGURE_DEPENDS
  25. "${GE_CODE_DIR}/ge/ge_local_engine/*.cc"
  26. )
  27. file(GLOB_RECURSE HOST_ENGINE_SRC CONFIGURE_DEPENDS
  28. "${GE_CODE_DIR}/ge/host_cpu_engine/*.cc"
  29. )
  30. file(GLOB_RECURSE NN_ENGINE_SRC CONFIGURE_DEPENDS
  31. "${GE_CODE_DIR}/ge/plugin/*.cc"
  32. )
  33. file(GLOB_RECURSE OFFLINE_SRC CONFIGURE_DEPENDS
  34. "${GE_CODE_DIR}/ge/offline/*.cc"
  35. )
  36. file(GLOB_RECURSE GE_SRCS CONFIGURE_DEPENDS
  37. "${GE_CODE_DIR}/ge/*.cc"
  38. )
  39. list(REMOVE_ITEM GE_SRCS ${LOCAL_ENGINE_SRC} ${HOST_ENGINE_SRC} ${NN_ENGINE_SRC} ${OFFLINE_SRC})
  40. list(APPEND INCLUDE_DIRECTORIES
  41. "${CMAKE_CURRENT_SOURCE_DIR}"
  42. "${GE_CODE_DIR}"
  43. "${GE_CODE_DIR}/inc"
  44. "${GE_CODE_DIR}/metadef/inc"
  45. "${GE_CODE_DIR}/ge"
  46. "${GE_CODE_DIR}/ge/inc"
  47. "${GE_CODE_DIR}/ge/ir_build"
  48. "${GE_CODE_DIR}/metadef"
  49. "${GE_CODE_DIR}/metadef/graph"
  50. "${GE_CODE_DIR}/inc/external"
  51. "${GE_CODE_DIR}/inc/framework/common"
  52. "${GE_CODE_DIR}/metadef/inc/external"
  53. "${GE_CODE_DIR}/metadef/inc/external/graph"
  54. "${GE_CODE_DIR}/metadef/inc/graph"
  55. "${GE_CODE_DIR}/inc/framework"
  56. "${GE_CODE_DIR}/metadef/inc/common"
  57. "${GE_CODE_DIR}/metadef/third_party"
  58. "${GE_CODE_DIR}/metadef/third_party/transformer/inc"
  59. "${GE_CODE_DIR}/parser"
  60. "${GE_CODE_DIR}/parser/parser"
  61. "${GE_CODE_DIR}/third_party/fwkacllib/inc"
  62. "${GE_CODE_DIR}/third_party/fwkacllib/inc/cce"
  63. "${GE_CODE_DIR}/third_party/fwkacllib/inc/ops"
  64. "${GE_CODE_DIR}/third_party/fwkacllib/inc/toolchain"
  65. "${GE_CODE_DIR}/tests/ut/ge"
  66. "${GE_CODE_DIR}/tests/ut/common"
  67. "${CMAKE_BINARY_DIR}"
  68. "${CMAKE_BINARY_DIR}/proto/ge"
  69. "${CMAKE_BINARY_DIR}/proto/ge/proto"
  70. )
  71. list(APPEND STUB_LIBS
  72. c_sec
  73. slog_stub
  74. cce_ge_stub
  75. runtime_stub
  76. profiler_stub
  77. #mmpa_stub
  78. hccl_stub
  79. error_manager_stub
  80. ascend_protobuf
  81. json
  82. )
  83. # ---- Target : Local engine ----
  84. add_library(localengine STATIC ${LOCAL_ENGINE_SRC} ${METADEF_REGISTER_SRCS})
  85. target_include_directories(localengine
  86. PUBLIC
  87. "${INCLUDE_DIRECTORIES}"
  88. "${GE_CODE_DIR}/ge/ge_local_engine"
  89. )
  90. target_compile_definitions(localengine PRIVATE
  91. google=ascend_private
  92. )
  93. target_compile_options(localengine PRIVATE
  94. -g --coverage -fprofile-arcs -ftest-coverage
  95. -Werror=format
  96. )
  97. target_link_libraries(localengine PUBLIC
  98. $<BUILD_INTERFACE:intf_pub> ${STUB_LIBS} -lrt -ldl -lpthread -lgcov
  99. )
  100. set_target_properties(localengine PROPERTIES CXX_STANDARD 11)
  101. # ---- Target : metadef graph ----
  102. add_library(metadef_graph STATIC ${METADEF_SRCS} ${PROTO_SRCS} ${PROTO_HDRS})
  103. target_include_directories(metadef_graph
  104. PUBLIC
  105. "${INCLUDE_DIRECTORIES}"
  106. )
  107. target_compile_definitions(metadef_graph PRIVATE
  108. google=ascend_private
  109. FMK_SUPPORT_DUMP
  110. )
  111. target_compile_options(metadef_graph PRIVATE
  112. -g --coverage -fprofile-arcs -ftest-coverage
  113. -Werror=format
  114. )
  115. target_link_libraries(metadef_graph PUBLIC
  116. $<BUILD_INTERFACE:intf_pub> ${STUB_LIBS} -lrt -ldl -lpthread -lgcov
  117. )
  118. set_target_properties(metadef_graph PROPERTIES CXX_STANDARD 11)
  119. # ---- Target : Host engine ----
  120. add_library(host_cpu_engine SHARED ${HOST_ENGINE_SRC} ${PROTO_HDRS})
  121. target_include_directories(host_cpu_engine
  122. PUBLIC
  123. "${INCLUDE_DIRECTORIES}"
  124. "${GE_CODE_DIR}/ge/host_cpu_engine"
  125. )
  126. target_compile_definitions(host_cpu_engine PRIVATE
  127. google=ascend_private
  128. FMK_SUPPORT_DUMP
  129. )
  130. target_compile_options(host_cpu_engine PRIVATE
  131. -g --coverage -fprofile-arcs -ftest-coverage
  132. -Werror=format
  133. )
  134. target_link_libraries(host_cpu_engine PUBLIC
  135. $<BUILD_INTERFACE:intf_pub> ${STUB_LIBS} metadef_graph -lmmpa -L/home/hugo/Code/ge/graphengine/build/tests/depends/mmpa -lrt -ldl -lpthread -lgcov
  136. )
  137. set_target_properties(host_cpu_engine PROPERTIES CXX_STANDARD 11)
  138. # ---- Target : engine plugin----
  139. #
  140. add_library(nnengine SHARED ${NN_ENGINE_SRC})
  141. target_include_directories(nnengine
  142. PUBLIC
  143. "${INCLUDE_DIRECTORIES}"
  144. "${GE_CODE_DIR}/ge/plugin/engine"
  145. )
  146. target_compile_definitions(nnengine PRIVATE
  147. google=ascend_private
  148. )
  149. target_compile_options(nnengine PRIVATE
  150. -g --coverage -fprofile-arcs -ftest-coverage
  151. -Werror=format
  152. )
  153. target_link_libraries(nnengine PUBLIC
  154. $<BUILD_INTERFACE:intf_pub> ${STUB_LIBS} -lrt -ldl -lpthread -lgcov
  155. )
  156. set_target_properties(nnengine PROPERTIES CXX_STANDARD 11)
  157. # Targe: engine_conf
  158. add_custom_target(
  159. engine_conf.json ALL
  160. DEPENDS ${CMAKE_BINARY_DIR}/engine_conf.json
  161. )
  162. add_custom_command(
  163. OUTPUT ${CMAKE_BINARY_DIR}/engine_conf.json
  164. COMMAND cp ${GE_CODE_DIR}/ge/engine_manager/engine_conf.json ${CMAKE_BINARY_DIR}/
  165. )
  166. # Targe: optimizer priority
  167. add_custom_target(
  168. optimizer_priority.pbtxt ALL
  169. DEPENDS ${CMAKE_BINARY_DIR}/optimizer_priority.pbtxt
  170. )
  171. add_custom_command(
  172. OUTPUT ${CMAKE_BINARY_DIR}/optimizer_priority.pbtxt
  173. COMMAND cp ${GE_CODE_DIR}/ge/opskernel_manager/optimizer_priority.pbtxt ${CMAKE_BINARY_DIR}/
  174. )
  175. # ---- Target : Graph engine ----
  176. add_library(graphengine STATIC ${PARSER_SRCS} ${GE_SRCS} ${PROTO_HDRS})
  177. target_include_directories(graphengine
  178. PUBLIC
  179. "${INCLUDE_DIRECTORIES}"
  180. "${GE_CODE_DIR}/ge/host_cpu_engine"
  181. )
  182. target_compile_definitions(graphengine PRIVATE
  183. google=ascend_private
  184. FMK_SUPPORT_DUMP
  185. )
  186. target_compile_options(graphengine PRIVATE
  187. -g --coverage -fprofile-arcs -ftest-coverage
  188. -Werror=format
  189. )
  190. target_link_libraries(graphengine PUBLIC
  191. $<BUILD_INTERFACE:intf_pub> ${STUB_LIBS}
  192. metadef_graph
  193. localengine
  194. host_cpu_engine
  195. nnengine
  196. mmpa -L${GE_CODE_DIR}/third_party/prebuild/x86_64 -lrt -ldl -lpthread -lgcov
  197. )
  198. set_target_properties(graphengine PROPERTIES CXX_STANDARD 11)
  199. add_dependencies(graphengine engine_conf.json optimizer_priority.pbtxt)

图引擎模块(GE)是MindSpore的一个子模块,其代码由C++实现,位于前端模块ME和底层硬件之间,起到承接作用。图引擎模块以ME下发的图作为输入,然后进行一系列的深度图优化操作,最后输出一张可以在底层硬件上高效运行的图。GE针对昇腾AI处理器的硬件结构特点,做了特定的优化工作,以此来充分发挥出昇腾AI处理器的强大算力。在进行模型训练/推理时,GE会被自动调用而用户并不感知。GE主要由GE API和GE Core两部分组成,详细的架构图如下所示