diff --git a/CMakeLists.txt b/CMakeLists.txt index dc85f683c112e6ec1b5264671c0b6a58a42a31f7..4eb9bc83ae6229e90deb737adab1d98141f7e1ae 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,6 +82,10 @@ else() ${TOP_DIR}/inc/common/ ${TOP_DIR}/inc/soft_dp/ ${TOP_DIR}/soft_dp/ + ${TOP_DIR}/graphengine/inc/ + ${TOP_DIR}/graphengine/inc/external/ + ${TOP_DIR}/metadef/inc/ + ${TOP_DIR}/metadef/inc/external/ ${TOP_DIR}/libc_sec/include/ ${TOP_DIR}/third_party/json/include/ ${TOP_DIR}/third_party/tensorflow/tensorflow-1.15.0/ @@ -163,4 +167,4 @@ else() install(FILES ${CMAKE_CURRENT_BINARY_DIR}/npu_bridge-1.15.0-py3-none-any.whl OPTIONAL DESTINATION ${INSTALL_LIBRARY_DIR} ) -endif() \ No newline at end of file +endif() diff --git a/tf_adapter/BUILD b/tf_adapter/BUILD index 66feb93a9e0fbf4e1f84f0728cc13c20e1873968..d280561151a37879dd1003d9f05daa4b0ebe8170 100644 --- a/tf_adapter/BUILD +++ b/tf_adapter/BUILD @@ -16,6 +16,10 @@ cc_binary( # so that can ensure the protobuf version is consistent with the installed tensorflow "-Iexternal/installed_tensorflow/include", "-Iexternal/org_tensorflow", + "-Iexternal/graphengine_extend_hdrs", + "-Iexternal/graphengine_extend_hdrs/external", + "-Iexternal/metadef_extend_hdrs", + "-Iexternal/metadef_extend_hdrs/external", "-Iexternal/tf_adapter_extend_hdrs", "-Iexternal/tf_adapter_extend_hdrs/external", "-Iexternal/local_nlohmann_json_lib/", @@ -58,9 +62,11 @@ cc_binary( # "@installed_tensorflow_libs//:installed_tensorflow_libs", "@local_nlohmann_json_lib//:local_nlohmann_json_lib", - "@tf_adapter_extend_hdrs//:tf_adapter_extend_hdrs", "@sec_lib//:sec_lib", "@python_include//:python_include", + "@graphengine_extend_hdrs//:graphengine_extend_hdrs", + "@metadef_extend_hdrs//:metadef_extend_hdrs", + "@tf_adapter_extend_hdrs//:tf_adapter_extend_hdrs", ], ) diff --git a/tf_adapter/module.BUILD b/tf_adapter/module.BUILD index d11465d35a539f4addba76b47c2e8b92c220517a..d95f2a1363a9bbd7d35a0edf3734e6a84b2d8222 100644 --- a/tf_adapter/module.BUILD +++ b/tf_adapter/module.BUILD @@ -13,8 +13,6 @@ cc_library( cc_library( name = "tf_adapter_extend_hdrs", srcs = glob([ - "framework/**/*.h", "framework/**/*.hpp", - "graph/**/*.h", "graph/**/*.hpp", "hccl/**/*.h", "hccl/**/*.hpp", "tdt/**/*.h", "tdt/**/*.hpp", "runtime/**/*.h", "runtime/**/*.hpp", @@ -23,6 +21,22 @@ cc_library( ]), ) +cc_library( + name = "graphengine_extend_hdrs", + srcs = glob([ + "framework/**/*.h", "framework/**/*.hpp", + "external/**/*.h" + ]), +) + +cc_library( + name = "metadef_extend_hdrs", + srcs = glob([ + "graph/**/*.h", "graph/**/*.hpp", + "external/**/*.h" + ]), +) + cc_library( name = "tf_adapter_host_libs", srcs = glob([ diff --git a/workspace.bzl.tpl b/workspace.bzl.tpl index ac1d7a33806f71704b9e9dec75b86291da43c2c4..f231d7df99566aae510d6de81ada25946923c883 100644 --- a/workspace.bzl.tpl +++ b/workspace.bzl.tpl @@ -27,6 +27,18 @@ def tf_adapter_workspace(): build_file = "@tf_adapter//tf_adapter:module.BUILD", ) + native.new_local_repository( + name = "graphengine_extend_hdrs", + path = extend_base() + "graphengine/inc", + build_file = "@tf_adapter//tf_adapter:module.BUILD", + ) + + native.new_local_repository( + name = "metadef_extend_hdrs", + path = extend_base() + "metadef/inc", + build_file = "@tf_adapter//tf_adapter:module.BUILD", + ) + native.new_local_repository( name="installed_tensorflow", path=extend_base() + "third_party/tensorflow/compile_deps/tf-1.15.0",