Polish TensorRT static linking a little.
PiperOrigin-RevId: 345840870 Change-Id: I92d75fd9c0555dd5fe1f1f907cf72306d3077bfd
This commit is contained in:
parent
d39353424d
commit
1350613d6f
@ -50,27 +50,11 @@ cc_library(
|
|||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
|
|
||||||
# Copybara will replace tensorrt_lib_oss_placeholder with this one
|
|
||||||
alias(
|
|
||||||
name = "tensorrt_lib_oss",
|
|
||||||
actual = select({
|
|
||||||
"@local_config_tensorrt//:use_static_tensorrt": "@local_config_tensorrt//:tensorrt",
|
|
||||||
"//conditions:default": ":tensorrt_stub",
|
|
||||||
}),
|
|
||||||
visibility = ["//visibility:private"],
|
|
||||||
)
|
|
||||||
|
|
||||||
alias(
|
|
||||||
name = "tensorrt_lib_oss_placeholder",
|
|
||||||
actual = ":tensorrt_stub",
|
|
||||||
visibility = ["//visibility:private"],
|
|
||||||
)
|
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "tensorrt_lib",
|
name = "tensorrt_lib",
|
||||||
actual = select({
|
actual = select({
|
||||||
"//tensorflow:oss": ":tensorrt_lib_oss",
|
"@local_config_tensorrt//:use_static_tensorrt": "@local_config_tensorrt//:tensorrt",
|
||||||
"//conditions:default": "@local_config_tensorrt//:tensorrt",
|
"//conditions:default": ":tensorrt_stub",
|
||||||
}),
|
}),
|
||||||
visibility = ["//visibility:private"],
|
visibility = ["//visibility:private"],
|
||||||
)
|
)
|
||||||
@ -606,21 +590,15 @@ tf_proto_library(
|
|||||||
protodeps = tf_additional_all_protos(),
|
protodeps = tf_additional_all_protos(),
|
||||||
)
|
)
|
||||||
|
|
||||||
tensorrt_static_define_oss_placeholder = []
|
|
||||||
|
|
||||||
# @unused
|
|
||||||
# Copybara will replace tensorrt_static_define_oss_placeholder with this one
|
|
||||||
tensorrt_static_define_oss = select({
|
|
||||||
"@local_config_tensorrt//:use_static_tensorrt": ["TF_OSS_TENSORRT_STATIC=1"],
|
|
||||||
"//conditions:default": [],
|
|
||||||
})
|
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "py_utils",
|
name = "py_utils",
|
||||||
srcs = ["utils/py_utils.cc"],
|
srcs = ["utils/py_utils.cc"],
|
||||||
hdrs = ["utils/py_utils.h"],
|
hdrs = ["utils/py_utils.h"],
|
||||||
copts = tf_copts(),
|
copts = tf_copts(),
|
||||||
defines = tensorrt_static_define_oss,
|
defines = select({
|
||||||
|
"@local_config_tensorrt//:use_static_tensorrt": ["TF_OSS_TENSORRT_STATIC=1"],
|
||||||
|
"//conditions:default": [],
|
||||||
|
}),
|
||||||
deps = if_tensorrt([
|
deps = if_tensorrt([
|
||||||
":common_utils",
|
":common_utils",
|
||||||
":tensorrt_lib",
|
":tensorrt_lib",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user