-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathcuda_nvcc.BUILD.tpl
More file actions
116 lines (101 loc) · 2.36 KB
/
Copy pathcuda_nvcc.BUILD.tpl
File metadata and controls
116 lines (101 loc) · 2.36 KB
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
108
109
110
111
112
113
114
115
licenses(["restricted"]) # NVIDIA proprietary license
load(
"@rules_ml_toolchain//cc/cuda/features:cuda_nvcc_feature.bzl",
"cuda_nvcc_feature",
)
load("@local_config_cuda//cuda:build_defs.bzl", "if_cuda_newer_than")
exports_files([
"bin/nvcc",
])
filegroup(
name = "nvvm",
srcs = ["nvvm/libdevice/libdevice.10.bc"],
visibility = ["//visibility:public"],
)
filegroup(
name = "nvdisasm",
srcs = [
"bin/nvdisasm",
],
visibility = ["//visibility:public"],
)
filegroup(
name = "nvlink",
srcs = [
"bin/nvlink",
],
visibility = ["//visibility:public"],
)
filegroup(
name = "fatbinary",
srcs = [
"bin/fatbinary",
],
visibility = ["//visibility:public"],
)
filegroup(
name = "bin2c",
srcs = [
"bin/bin2c",
],
visibility = ["//visibility:public"],
)
filegroup(
name = "ptxas",
srcs = [
"bin/ptxas",
],
visibility = ["//visibility:public"],
)
filegroup(
name = "bin",
srcs = glob([
"bin/**",
"nvvm/bin/**",
]),
visibility = ["//visibility:public"],
)
filegroup(
name = "link_stub",
srcs = [
"bin/crt/link.stub",
],
visibility = ["//visibility:public"],
)
cuda_nvcc_feature(
name = "feature",
enabled = True,
bin = ":bin/nvcc",
version = "%{version_of_cuda}",
visibility = [
"@rules_ml_toolchain//cc/impls/linux_aarch64_linux_aarch64_cuda:__pkg__",
"@rules_ml_toolchain//cc/impls/linux_x86_64_linux_x86_64_cuda:__pkg__",
],
)
%{multiline_comment}
cc_import(
name = "nvptxcompiler_static_library",
hdrs = ["include/nvPTXCompiler.h"],
static_library = "lib/libnvptxcompiler_static.a",
)
%{multiline_comment}
cc_library(
name = "headers",
%{comment}hdrs = glob([
%{comment}"include/fatbinary_section.h",
%{comment}"include/nvPTXCompiler.h",
%{comment}]) + if_cuda_newer_than(
%{comment}"13_0",
%{comment}if_true = [],
%{comment}if_false = glob(["include/crt/**"]),
%{comment}),
include_prefix = "third_party/gpus/cuda/include",
includes = ["include"],
strip_include_prefix = "include",
visibility = ["@local_config_cuda//cuda:__pkg__"],
)
cc_library(
name = "nvptxcompiler",
%{comment}deps = [":nvptxcompiler_static_library"],
visibility = ["@local_config_cuda//cuda:__pkg__"],
)