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