Skip to content

Commit 925ef20

Browse files
pytorchbotswolchok
andauthored
Pull c10 headers directly from PyTorch internally, not from the c10 mirror (#11835)
This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: #11800 by @swolchok ^ Please use this as the source of truth for the PR details, comments, and reviews ghstack PR base: https://github.com/pytorch/executorch/tree/gh/swolchok/463/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/swolchok/463/head Merge bot PR base: https://github.com/pytorch/executorch/tree/main Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/swolchok/463/orig @diff-train-skip-merge Co-authored-by: Scott Wolchok <[email protected]>
1 parent 18e4240 commit 925ef20

File tree

1 file changed

+48
-37
lines changed

1 file changed

+48
-37
lines changed

runtime/core/portable_type/c10/c10/targets.bzl

Lines changed: 48 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -49,43 +49,6 @@ def define_common_targets():
4949
The directory containing this targets.bzl file should also contain both
5050
TARGETS and BUCK files that call this function.
5151
"""
52-
runtime.cxx_library(
53-
name = "c10",
54-
header_namespace = "c10",
55-
exported_headers = [
56-
"macros/Export.h",
57-
"macros/Macros.h",
58-
"util/BFloat16.h",
59-
"util/BFloat16-inl.h",
60-
"util/BFloat16-math.h",
61-
"util/Half.h",
62-
"util/Half-inl.h",
63-
"util/TypeSafeSignMath.h",
64-
"util/bit_cast.h",
65-
"util/complex.h",
66-
"util/complex_math.h",
67-
"util/complex_utils.h",
68-
"util/floating_point_utils.h",
69-
"util/irange.h",
70-
],
71-
exported_preprocessor_flags = [
72-
"-DC10_USING_CUSTOM_GENERATED_MACROS",
73-
] + ([] if runtime.is_oss else [
74-
"-DC10_USE_GLOG",
75-
"-DC10_USE_MINIMAL_GLOG",
76-
]),
77-
visibility = [
78-
"//executorch/...",
79-
"@EXECUTORCH_CLIENTS",
80-
],
81-
deps = select({
82-
"DEFAULT": [],
83-
# Half-inl.h depends on vec_half.h from ATen, but only when building for x86.
84-
"ovr_config//cpu:x86_64": [
85-
":aten_headers_for_executorch",
86-
],
87-
}),
88-
)
8952

9053
runtime.cxx_library(
9154
name = "aten_headers_for_executorch",
@@ -118,3 +81,51 @@ def define_common_targets():
11881
fbcode_exported_preprocessor_flags = get_preprocessor_flags(is_fbcode=True)
11982
+ ([] if runtime.is_oss else ["-DET_USE_PYTORCH_HEADERS"]),
12083
)
84+
85+
if runtime.is_oss:
86+
runtime.cxx_library(
87+
name = "c10",
88+
header_namespace = "c10",
89+
exported_headers = [
90+
"macros/Export.h",
91+
"macros/Macros.h",
92+
"util/BFloat16.h",
93+
"util/BFloat16-inl.h",
94+
"util/BFloat16-math.h",
95+
"util/Half.h",
96+
"util/Half-inl.h",
97+
"util/TypeSafeSignMath.h",
98+
"util/bit_cast.h",
99+
"util/complex.h",
100+
"util/complex_math.h",
101+
"util/complex_utils.h",
102+
"util/floating_point_utils.h",
103+
"util/irange.h",
104+
],
105+
exported_preprocessor_flags = [
106+
"-DC10_USING_CUSTOM_GENERATED_MACROS",
107+
] + ([] if runtime.is_oss else [
108+
"-DC10_USE_GLOG",
109+
"-DC10_USE_MINIMAL_GLOG",
110+
]),
111+
visibility = [
112+
"//executorch/...",
113+
"@EXECUTORCH_CLIENTS",
114+
],
115+
deps = select({
116+
"DEFAULT": [],
117+
# Half-inl.h depends on vec_half.h from ATen, but only when building for x86.
118+
"ovr_config//cpu:x86_64": [
119+
":aten_headers_for_executorch",
120+
],
121+
}),
122+
)
123+
else:
124+
runtime.cxx_library(
125+
name = "c10",
126+
exported_deps = [":aten_headers_for_executorch"],
127+
visibility = [
128+
"//executorch/...",
129+
"@EXECUTORCH_CLIENTS",
130+
],
131+
)

0 commit comments

Comments
 (0)