Skip to content

Commit a71bca9

Browse files
committed
refactor(caffe2): Break out Caffe2 from the LibTorch package to address
overlinking Signed-off-by: Naren Dasan <naren@narendasan.com> Signed-off-by: Naren Dasan <narens@nvidia.com>
1 parent e8d458d commit a71bca9

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

cpp/benchmark/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ cc_binary(
88
],
99
deps = [
1010
"@libtorch//:libtorch",
11+
"@libtorch//:caffe2",
1112
"//cpp/api:trtorch"
1213
],
1314
)

cpp/ptq/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ cc_binary(
99
deps = [
1010
"//cpp/ptq/datasets:cifar10",
1111
"@libtorch//:libtorch",
12+
"@libtorch//:caffe2",
1213
"//cpp/api:trtorch",
1314
"@tensorrt//:nvinfer"
1415
],

cpp/trtorchexec/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ cc_binary(
77
],
88
deps = [
99
"@libtorch//:libtorch",
10+
"@libtorch//:caffe2",
1011
"//cpp/api:trtorch"
1112
],
1213
)

tests/util/BUILD

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
package(default_visibility = ["//visibility:public"])
22

3+
config_setting(
4+
name = "use_pre_cxx11_abi",
5+
values = {
6+
"define": "abi=pre_cxx11_abi",
7+
}
8+
)
9+
310
cc_library(
411
name = "util",
512
hdrs = [
@@ -14,8 +21,18 @@ cc_library(
1421
deps = [
1522
"@tensorrt//:nvinfer",
1623
"@libtorch//:libtorch",
24+
"@libtorch//:caffe2",
1725
"//core/conversion",
1826
"//core/util:prelude",
1927
"//cpp/api:trtorch",
20-
]
28+
] + select({
29+
":use_pre_cxx11_abi": [
30+
"@libtorch_pre_cxx11_abi//:libtorch",
31+
"@libtorch_pre_cxx11_abi//:caffe2",
32+
],
33+
"//conditions:default": [
34+
"@libtorch//:libtorch",
35+
"@libtorch//:caffe2",
36+
],
37+
})
2138
)

third_party/libtorch/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ cc_library(
2727
deps = [
2828
":ATen",
2929
":c10_cuda",
30-
":caffe2"
3130
],
3231
includes = [
3332
"include",

0 commit comments

Comments
 (0)