-
Notifications
You must be signed in to change notification settings - Fork 355
/
BUILD.bazel
119 lines (110 loc) · 2.6 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
108
109
110
111
112
113
114
115
116
117
118
119
load("@rules_pkg//:pkg.bzl", "pkg_tar")
config_setting(
name = "windows",
constraint_values = [
"@platforms//os:windows",
],
)
pkg_tar(
name = "include_core",
package_dir = "include/torch_tensorrt",
deps = [
"//core:include",
"//core/conversion:include",
"//core/conversion/conversionctx:include",
"//core/conversion/converters:include",
"//core/conversion/evaluators:include",
"//core/conversion/tensorcontainer:include",
"//core/conversion/var:include",
"//core/ir:include",
"//core/lowering:include",
"//core/lowering/passes:include",
"//core/partitioning:include",
"//core/partitioning/partitioningctx:include",
"//core/partitioning/partitioninginfo:include",
"//core/partitioning/segmentedblock:include",
"//core/plugins:impl_include",
"//core/plugins:include",
"//core/runtime:include",
"//core/util:include",
"//core/util/logging:include",
],
)
pkg_tar(
name = "include_rt",
package_dir = "include/torch_tensorrt",
deps = [
"//core/runtime:include",
],
)
pkg_tar(
name = "include",
srcs = [
"//cpp:api_headers",
],
package_dir = "include/torch_tensorrt/",
)
pkg_tar(
name = "lib",
srcs = select({
":windows": ["//cpp/lib:torchtrt.dll"],
"//conditions:default": [
"//cpp/lib:libtorchtrt.so",
"//cpp/lib:libtorchtrt_plugins.so",
"//cpp/lib:libtorchtrt_runtime.so",
],
}),
mode = "0755",
package_dir = "lib/",
)
pkg_tar(
name = "lib_rt",
srcs = select({
":windows": ["//cpp/lib:torchtrt_runtime.dll"],
"//conditions:default": [
"//cpp/lib:libtorchtrt_runtime.so",
],
}),
mode = "0755",
package_dir = "lib/",
)
pkg_tar(
name = "bin",
srcs = [
"//cpp/bin/torchtrtc",
],
mode = "0755",
package_dir = "bin/",
)
pkg_tar(
name = "libtorchtrt",
srcs = [
"//:LICENSE",
"//bzl_def:BUILD",
"//bzl_def:WORKSPACE",
],
extension = "tar.gz",
package_dir = "torch_tensorrt",
deps = [
":include",
":include_core",
":lib",
] + select({
":windows": [],
"//conditions:default": [":bin"],
}),
)
pkg_tar(
name = "libtorchtrt_runtime",
srcs = [
"//:LICENSE",
"//bzl_def:BUILD",
"//bzl_def:WORKSPACE",
],
extension = "tar.gz",
package_dir = "torch_tensorrt_runtime",
deps = [
":include_rt",
":lib_rt",
],
)