Skip to content

Commit 12b4ed7

Browse files
authored
Merge branch 'main' into addScript
2 parents 26dec1e + da36d8a commit 12b4ed7

File tree

2 files changed

+51
-40
lines changed

2 files changed

+51
-40
lines changed

extension/data_loader/mmap_data_loader.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ Result<FreeableBuffer> MmapDataLoader::load(
181181
size_t size,
182182
ET_UNUSED const DataLoader::SegmentInfo& segment_info) const {
183183
// Ensure read range is valid.
184-
auto err = validate_input(offset, size);
185-
if (err != Error::Ok) {
186-
return err;
184+
auto validation_err = validate_input(offset, size);
185+
if (validation_err != Error::Ok) {
186+
return validation_err;
187187
}
188188

189189
// mmap() will fail if the size is zero.

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)