xref: /aosp_15_r20/external/pytorch/tools/config/BUILD (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1load("@bazel_skylib//lib:selects.bzl", "selects")
2
3config_setting(
4    name = "cuda",
5    define_values = {
6        "cuda": "true",
7    },
8)
9
10# Even when building with --config=cuda, host targets should be built with cuda disabled
11# as these targets will run on CI machines that have no GPUs.
12selects.config_setting_group(
13    name = "cuda_enabled_and_capable",
14    match_all = [
15        ":cuda",
16    ],
17)
18
19# Configures the system to build with cuda using clang.
20config_setting(
21    name = "cuda_clang",
22    define_values = {
23        "cuda_clang": "true",
24    },
25)
26
27# Indicates that cuda code should be compiled with nvcc
28# Mostly exists to support _analysis_ of tensorflow; more work is needed to actually make this
29# setting work.
30config_setting(
31    name = "cuda_nvcc",
32    define_values = {
33        "cuda_nvcc": "true",
34    },
35)
36
37config_setting(
38    name = "thread_sanitizer",
39    define_values = {"thread_sanitizer": "1"},
40    visibility = ["//visibility:public"],
41)
42