-
Notifications
You must be signed in to change notification settings - Fork 410
Expand file tree
/
Copy pathBUILD
More file actions
126 lines (115 loc) · 2.73 KB
/
Copy pathBUILD
File metadata and controls
126 lines (115 loc) · 2.73 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
116
117
118
119
120
121
122
123
124
125
126
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@rules_pkg//pkg:mappings.bzl", "pkg_files")
package(default_visibility = ["//visibility:public"])
config_setting(
name = "use_torch_whl",
flag_values = {
"//toolchains/dep_src:torch": "whl",
},
)
config_setting(
name = "rtx_x86_64",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
],
flag_values = {
"//toolchains/dep_collection:compute_libs": "rtx",
},
)
config_setting(
name = "rtx_sbsa",
constraint_values = [
"@platforms//cpu:aarch64",
"@platforms//os:linux",
],
flag_values = {
"//toolchains/dep_collection:compute_libs": "rtx",
},
)
config_setting(
name = "rtx_win",
constraint_values = [
"@platforms//os:windows",
],
flag_values = {
"//toolchains/dep_collection:compute_libs": "rtx",
},
)
config_setting(
name = "sbsa",
constraint_values = [
"@platforms//cpu:aarch64",
],
flag_values = {
"//toolchains/dep_collection:compute_libs": "default",
},
)
config_setting(
name = "jetpack",
constraint_values = [
"@platforms//cpu:aarch64",
],
flag_values = {
"//toolchains/dep_collection:compute_libs": "jetpack",
},
)
config_setting(
name = "windows",
constraint_values = [
"@platforms//os:windows",
],
)
config_setting(
name = "python_core",
values = {
"define": "target_lang=python",
},
)
cc_library(
name = "core",
srcs = [
"compiler.cpp",
],
hdrs = [
"compiler.h",
],
deps = [
"//core/conversion",
"//core/lowering",
"//core/partitioning",
"//core/runtime",
"//core/util/logging",
] + select({
":jetpack": ["@tensorrt_l4t//:nvinfer"],
":rtx_win": ["@tensorrt_rtx_win//:nvinfer"],
":rtx_x86_64": ["@tensorrt_rtx//:nvinfer"],
":rtx_sbsa": ["@tensorrt_rtx_sbsa//:nvinfer"],
":sbsa": ["@tensorrt_sbsa//:nvinfer"],
":windows": ["@tensorrt_win//:nvinfer"],
"//conditions:default": ["@tensorrt//:nvinfer"],
}) + select({
":jetpack": ["@torch_l4t//:libtorch"],
":rtx_win": ["@libtorch_win//:libtorch"],
":use_torch_whl": ["@torch_whl//:libtorch"],
":windows": ["@libtorch_win//:libtorch"],
"//conditions:default": ["@libtorch"],
}),
alwayslink = True,
)
pkg_tar(
name = "include",
srcs = [
"compiler.h",
],
package_dir = "core/",
)
pkg_files(
name = "include_pkg_files",
srcs = [
"compiler.h",
],
visibility = ["//visibility:public"],
prefix = "include/torch_tensorrt/core/",
)