forked from alibaba/rtp-llm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.pytorch
84 lines (80 loc) · 2.22 KB
/
BUILD.pytorch
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
config_setting(
name = "using_cuda",
values = {"define": "using_cuda=true"},
)
config_setting(
name = "using_rocm",
values = {"define": "using_rocm=true"},
)
cc_library(
name = "torch",
srcs = [
"torch/lib/libtorch.so",
"torch/lib/libtorch_python.so",
"torch/lib/libtorch_cpu.so",
"torch/lib/libshm.so",
"torch/lib/libc10.so",
] + glob([
"torch/lib/libgomp*.so*",
]) + select({
"//:using_cuda": [
"torch/lib/libtorch_cuda.so",
"torch/lib/libc10_cuda.so",
] + glob([
"torch/lib/libcudart*.so*",
"torch/lib/libnvToolsExt*.so*",
]),
"//:using_rocm": [
"torch/lib/libtorch_hip.so",
"torch/lib/libc10_hip.so",
] + glob([
"torch/lib/libmagma*.so*",
# "torch/lib/libtinfo.so*",
# "torch/lib/libsuitesparseconfig.so*",
# "torch/lib/libcholmod.so*",
# "torch/lib/libsatlas.so*",
# "torch/lib/libgfortran.so*",
# "torch/lib/libquadmath.so*",
# "torch/lib/libgomp*.so*",
# "torch/lib/libhip*.so*",
# "torch/lib/lib*amd*.so*",
]),
"//conditions:default": [],
}),
hdrs = glob([
"torch/include/*.h",
"torch/include/**/*.h",
"torch/include/**/*.cuh",
"torch/include/**/*.hpp",
]),
deps = [
"@local_config_python//:python_headers",
"@local_config_python//:python_lib",
],
strip_include_prefix = "torch/include",
visibility = ["//visibility:public"],
)
cc_library(
name = "torch_api",
hdrs = glob([
"torch/include/torch/csrc/api/include/**/*.h",
]),
deps = [
"@local_config_python//:python_headers",
],
strip_include_prefix = "torch/include/torch/csrc/api/include",
visibility = ["//visibility:public"],
)
cc_library(
name = "torch_libs",
srcs = glob([
"torch.libs/libarm_compute*.so",
"torch.libs/libgfortran*.so*",
"torch.libs/libgomp*.so*",
"torch.libs/libopenblasp*.so",
]),
deps = [
"@local_config_python//:python_headers",
],
visibility = ["//visibility:public"],
)