Switch from //tensorflow:using_cuda_{clang,nvcc} to //tensorflow:is_cuda_enabled.
PiperOrigin-RevId: 360676963 Change-Id: I9b28c1a3834ef5a46e2a3ca48589ce8458467f11
This commit is contained in:
parent
ef8a0e1220
commit
68d540b2c5
tensorflow
@ -412,16 +412,6 @@ config_setting(
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
# Crosses between platforms and file system libraries not supported on those
|
||||
# platforms due to limitations in nested select() statements.
|
||||
selects.config_setting_group(
|
||||
name = "with_cuda_support_windows_override",
|
||||
match_all = [
|
||||
":using_cuda_nvcc",
|
||||
":windows",
|
||||
],
|
||||
)
|
||||
|
||||
config_setting(
|
||||
name = "with_xla_support",
|
||||
define_values = {"with_xla_support": "true"},
|
||||
@ -513,16 +503,22 @@ alias(
|
||||
),
|
||||
)
|
||||
|
||||
# Config setting whether TensorFlow is built with CUDA support using clang.
|
||||
alias(
|
||||
name = "using_cuda_clang",
|
||||
actual = "@local_config_cuda//cuda:using_clang",
|
||||
# Config setting that is satisfied when building with --config=cuda in OSS.
|
||||
selects.config_setting_group(
|
||||
name = "is_cuda_enabled_and_oss",
|
||||
match_all = [
|
||||
":is_cuda_enabled",
|
||||
":oss",
|
||||
],
|
||||
)
|
||||
|
||||
# Config setting whether TensorFlow is built with CUDA support using nvcc.
|
||||
alias(
|
||||
name = "using_cuda_nvcc",
|
||||
actual = "@local_config_cuda//cuda:using_nvcc",
|
||||
# Config setting that is satisfied when building with --config=cuda for Windows
|
||||
selects.config_setting_group(
|
||||
name = "is_cuda_enabled_and_windows",
|
||||
match_all = [
|
||||
":is_cuda_enabled",
|
||||
":windows",
|
||||
],
|
||||
)
|
||||
|
||||
# Config setting to use in select()s to distinguish open source build from
|
||||
@ -543,22 +539,6 @@ bool_setting(
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
selects.config_setting_group(
|
||||
name = "using_cuda_clang_with_dynamic_build",
|
||||
match_all = [
|
||||
":using_cuda_clang",
|
||||
":framework_shared_object",
|
||||
],
|
||||
)
|
||||
|
||||
selects.config_setting_group(
|
||||
name = "build_oss_using_cuda_clang",
|
||||
match_all = [
|
||||
":using_cuda_clang",
|
||||
":oss",
|
||||
],
|
||||
)
|
||||
|
||||
# Setting to use when loading kernels dynamically
|
||||
config_setting(
|
||||
name = "dynamic_loaded_kernels",
|
||||
@ -569,14 +549,6 @@ config_setting(
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
selects.config_setting_group(
|
||||
name = "build_oss_using_cuda_nvcc",
|
||||
match_all = [
|
||||
":using_cuda_nvcc",
|
||||
":oss",
|
||||
],
|
||||
)
|
||||
|
||||
config_setting(
|
||||
name = "using_rocm_hipcc",
|
||||
define_values = {"using_rocm_hipcc": "true"},
|
||||
|
@ -61,8 +61,7 @@ tf_cuda_library(
|
||||
"//tensorflow:macos": ["IOKit"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"//tensorflow:using_cuda_clang": [":_cuda_runtime"],
|
||||
"//tensorflow:using_cuda_nvcc": [":_cuda_runtime"],
|
||||
"//tensorflow:is_cuda_enabled": [":_cuda_runtime"],
|
||||
"//tensorflow:using_rocm_hipcc": [
|
||||
"//tensorflow/stream_executor/rocm:all_runtime",
|
||||
],
|
||||
|
@ -128,8 +128,7 @@ cc_library(
|
||||
"//tensorflow/stream_executor/platform:dso_loader",
|
||||
] + tf_additional_cuda_driver_deps()) + select({
|
||||
# include dynamic loading implementation only when if_cuda_is_configured and build dynamically
|
||||
"//tensorflow:build_oss_using_cuda_nvcc": ["cudart_stub"],
|
||||
"//tensorflow:build_oss_using_cuda_clang": ["cudart_stub"],
|
||||
"//tensorflow:is_cuda_enabled_and_oss": ["cudart_stub"],
|
||||
"//conditions:default": ["//tensorflow/core:cuda"],
|
||||
}) + [
|
||||
"@com_google_absl//absl/base:core_headers",
|
||||
@ -170,20 +169,13 @@ cc_library(
|
||||
name = "cudart_stub",
|
||||
srcs = select({
|
||||
# include dynamic loading implementation only when if_cuda_is_configured and build dynamically
|
||||
"//tensorflow:build_oss_using_cuda_nvcc": ["cudart_stub.cc"],
|
||||
"//tensorflow:build_oss_using_cuda_clang": ["cudart_stub.cc"],
|
||||
"//tensorflow:is_cuda_enabled_and_oss": ["cudart_stub.cc"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
textual_hdrs = glob(["cuda_runtime_*.inc"]),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = select({
|
||||
"//tensorflow:build_oss_using_cuda_nvcc": [
|
||||
":cuda_stub",
|
||||
"@local_config_cuda//cuda:cuda_headers",
|
||||
"//tensorflow/stream_executor/lib",
|
||||
"//tensorflow/stream_executor/platform:dso_loader",
|
||||
],
|
||||
"//tensorflow:build_oss_using_cuda_clang": [
|
||||
"//tensorflow:is_cuda_enabled_and_oss": [
|
||||
":cuda_stub",
|
||||
"@local_config_cuda//cuda:cuda_headers",
|
||||
"//tensorflow/stream_executor/lib",
|
||||
|
@ -250,7 +250,7 @@ def if_windows(a, otherwise = []):
|
||||
|
||||
def if_windows_cuda(a, otherwise = []):
|
||||
return select({
|
||||
clean_dep("//tensorflow:with_cuda_support_windows_override"): a,
|
||||
clean_dep("//tensorflow:is_cuda_enabled_and_windows"): a,
|
||||
"//conditions:default": otherwise,
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user