-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
BUILD.bazel
107 lines (90 loc) · 2.54 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load(
"@bazel_skylib//rules:common_settings.bzl",
"bool_flag",
"string_flag",
)
load("//cuda/private:rules/flags.bzl", "cuda_archs_flag", "repeatable_string_flag")
package(default_visibility = ["//visibility:public"])
bzl_library(
name = "bzl_srcs",
srcs = glob(["*.bzl"]),
visibility = ["//visibility:public"],
deps = ["//cuda/private:bzl_srcs"],
)
toolchain_type(name = "toolchain_type")
# Command line flag to set ":is_enabled" config setting.
#
# Set with --@rules_cuda//cuda:enable
bool_flag(
name = "enable",
build_setting_default = True,
)
# This config setting can be used for conditionally depend on cuda.
#
# Set with --@rules_cuda//cuda:enable
config_setting(
name = "is_enabled",
flag_values = {":enable": "True"},
)
config_setting(
name = "is_valid_toolchain_found",
flag_values = {"@local_cuda//:valid_toolchain_found": "True"},
)
# Command line flag to specify the list of CUDA architectures to compile for.
#
# Provides CudaArchsInfo of the list of archs to build.
#
# Example usage: --@rules_cuda//cuda:archs=sm_70,sm_75;sm_80,sm_86
#
# See CudaArchsInfo for detailed grammar
cuda_archs_flag(
name = "archs",
build_setting_default = "",
)
# Command line flag to select compiler for cuda_library() code.
string_flag(
name = "compiler",
build_setting_default = "nvcc",
values = [
"nvcc",
"clang",
],
)
config_setting(
name = "compiler_is_nvcc",
flag_values = {":compiler": "nvcc"},
)
config_setting(
name = "compiler_is_clang",
flag_values = {":compiler": "clang"},
)
# Command line flag for copts to add to cuda_library() compile command.
repeatable_string_flag(
name = "copts",
build_setting_default = "",
)
repeatable_string_flag(
name = "host_copts",
build_setting_default = "",
)
# Command line flag to specify the CUDA runtime. Use this target as CUDA
# runtime dependency.
#
# This target is implicitly added as a dependency to cuda_library() targets.
#
# Example usage: --@rules_cuda//cuda:runtime=@local_cuda//:cuda_runtime_static
label_flag(
name = "runtime",
build_setting_default = "@local_cuda//:cuda_runtime",
)
constraint_setting(name = "rules_are_enabled_setting")
constraint_value(
name = "rules_are_enabled",
constraint_setting = ":rules_are_enabled_setting",
)
constraint_setting(name = "valid_toolchain_is_configured_setting")
constraint_value(
name = "valid_toolchain_is_configured",
constraint_setting = ":valid_toolchain_is_configured_setting",
)