Skip to content

Commit 12ace93

Browse files
authored
Clean up various leftover platform arg usage around the repo that never hit validation
Differential Revision: D89322661 Pull Request resolved: #16299
1 parent cea6be1 commit 12ace93

File tree

4 files changed

+56
-73
lines changed

4 files changed

+56
-73
lines changed

shim_et/xplat/executorch/codegen/codegen.bzl

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -687,21 +687,18 @@ def build_optimized_lib(name, oplist_header_name, portable_header_lib, feature =
687687
name = name,
688688
srcs = optimized_source_files,
689689
exported_preprocessor_flags = ["-DEXECUTORCH_SELECTIVE_BUILD_DTYPE"],
690-
deps = get_portable_lib_deps() + get_optimized_lib_deps() + [":" + portable_header_lib],
691690
compiler_flags = compiler_flags,
692691
platforms = platforms,
693692
preprocessor_flags = get_vec_preprocessor_flags(),
694693
# sleef needs to be added as a direct dependency of the operator target when building for Android,
695-
# or a linker error may occur. Not sure why this happens; it seems that fbandroid_platform_deps of
694+
# or a linker error may occur. Not sure why this happens; it seems that platform deps of
696695
# dependencies are not transitive
697-
fbandroid_platform_deps = [
698-
(
699-
"^android-arm64.*$",
700-
[
701-
"fbsource//third-party/sleef:sleef",
702-
],
703-
),
704-
],
696+
deps = get_portable_lib_deps() + get_optimized_lib_deps() + [":" + portable_header_lib] + select({
697+
"ovr_config//os:android-arm64": [
698+
"fbsource//third-party/sleef:sleef",
699+
],
700+
"DEFAULT": [],
701+
}),
705702
# WARNING: using a deprecated API to avoid being built into a shared
706703
# library. In the case of dynamically loading so library we don't want
707704
# it to depend on other so libraries because that way we have to

shim_et/xplat/executorch/kernels/optimized/lib_defs.bzl

Lines changed: 35 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
# LICENSE-MIT file in the root directory of this source tree and the Apache
55
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
66
# of this source tree.
7-
8-
load("@fbsource//tools/build_defs:default_platform_defs.bzl", "DEVSERVER_PLATFORM_REGEX")
97
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
108

119
# Because vec exists as a collection of header files, compile and preprocessor
@@ -88,32 +86,15 @@ def define_libs():
8886
"//executorch/...",
8987
"@EXECUTORCH_CLIENTS",
9088
],
91-
cxx_platform_deps = select({
92-
"DEFAULT": [
93-
(
94-
DEVSERVER_PLATFORM_REGEX,
95-
[
96-
"fbsource//third-party/sleef:sleef",
97-
],
98-
),
89+
deps = select({
90+
"ovr_config//os:linux": [
91+
"fbsource//third-party/sleef:sleef",
9992
],
100-
"ovr_config//cpu:arm64": [
101-
(
102-
DEVSERVER_PLATFORM_REGEX,
103-
[
104-
"fbsource//third-party/sleef:sleef",
105-
],
106-
),
93+
"ovr_config//os:android-arm64": [
94+
"fbsource//third-party/sleef:sleef",
10795
],
96+
"DEFAULT": [],
10897
}),
109-
fbandroid_platform_deps = [
110-
(
111-
"^android-arm64.*$",
112-
[
113-
"fbsource//third-party/sleef:sleef",
114-
],
115-
),
116-
],
11798
)
11899

119100
runtime.cxx_library(
@@ -146,29 +127,35 @@ def define_libs():
146127
"//executorch/...",
147128
"@EXECUTORCH_CLIENTS",
148129
],
149-
fbandroid_platform_preprocessor_flags = [
150-
(
151-
"^android-arm64.*$",
152-
[
153-
"-DET_BUILD_WITH_BLAS",
154-
],
155-
),
156-
],
157-
fbandroid_platform_deps = [
158-
(
159-
"^android-arm64.*$",
160-
[
161-
"fbsource//third-party/openblas:openblas",
162-
],
163-
),
164-
],
165-
fbobjc_exported_preprocessor_flags = [
166-
"-DET_BUILD_WITH_BLAS",
167-
"-DET_BUILD_FOR_APPLE",
168-
],
169-
fbobjc_frameworks = [
170-
"Accelerate",
171-
],
130+
preprocessor_flags = select({
131+
"ovr_config//os:android-arm64": [
132+
"-DET_BUILD_WITH_BLAS",
133+
],
134+
"ovr_config//os:iphoneos": [
135+
"-DET_BUILD_WITH_BLAS",
136+
"-DET_BUILD_FOR_APPLE",
137+
],
138+
"ovr_config//os:macos": [
139+
"-DET_BUILD_WITH_BLAS",
140+
"-DET_BUILD_FOR_APPLE",
141+
],
142+
"DEFAULT": [],
143+
}),
144+
deps = select({
145+
"ovr_config//os:android-arm64": [
146+
"fbsource//third-party/openblas:openblas",
147+
],
148+
"DEFAULT": [],
149+
}),
150+
frameworks = select({
151+
"ovr_config//os:iphoneos": [
152+
"Accelerate",
153+
],
154+
"ovr_config//os:macos": [
155+
"Accelerate",
156+
],
157+
"DEFAULT": [],
158+
}),
172159
exported_deps = [
173160
"//executorch/kernels/optimized:libutils",
174161
"//executorch/runtime/core/exec_aten:lib",

shim_et/xplat/executorch/kernels/optimized/op_registration_util.bzl

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,21 +107,18 @@ def define_op_library(name, compiler_flags, deps):
107107
# fail Werror builds; see https://godbolt.org/z/zvf85vTsr
108108
"-Wno-pass-failed",
109109
] + compiler_flags + get_compiler_optimization_flags(),
110-
deps = [
111-
"//executorch/runtime/kernel:kernel_includes",
112-
] + augmented_deps + get_vec_deps(),
113-
preprocessor_flags = get_vec_preprocessor_flags(),
114110
# sleef needs to be added as a direct dependency of the operator target when building for Android,
115111
# or a linker error may occur. Not sure why this happens; it seems that fbandroid_platform_deps of
116112
# dependencies are not transitive
117-
fbandroid_platform_deps = [
118-
(
119-
"^android-arm64.*$",
120-
[
121-
"fbsource//third-party/sleef:sleef",
122-
],
123-
),
124-
],
113+
deps = [
114+
"//executorch/runtime/kernel:kernel_includes",
115+
] + augmented_deps + get_vec_deps() + select({
116+
"DEFAULT": [],
117+
"ovr_config//os:android-arm64": [
118+
"fbsource//third-party/sleef:sleef",
119+
],
120+
}),
121+
preprocessor_flags = get_vec_preprocessor_flags(),
125122
# link_whole is necessary because the operators register themselves
126123
# via static initializers that run at program startup.
127124
# @lint-ignore BUCKLINT link_whole

shim_et/xplat/executorch/kernels/portable/op_registration_util.bzl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def define_op_library(name, deps, android_deps, aten_target, _allow_third_party_
9898
Args:
9999
name: The name of the target; e.g., "op_add"
100100
deps: List of deps for the target.
101-
android_deps: List of fbandroid_platform_deps for the target.
101+
android_deps: List of deps for Android platform.
102102
aten_target: If True, define a "<name>_aten" target that uses
103103
`:kernel_types_aten`, compatible with host PyTorch. If False, define
104104
a "<name>" target that uses `:kernel_types`, compatible with the
@@ -123,7 +123,6 @@ def define_op_library(name, deps, android_deps, aten_target, _allow_third_party_
123123
"//executorch/kernels/test/...",
124124
"@EXECUTORCH_CLIENTS",
125125
],
126-
fbandroid_platform_deps = android_deps,
127126
# kernels often have helpers with no prototypes just disabling the warning here as the headers
128127
# are codegend and linked in later
129128
compiler_flags = select({
@@ -142,7 +141,10 @@ def define_op_library(name, deps, android_deps, aten_target, _allow_third_party_
142141
) + get_compiler_optimization_flags(),
143142
deps = [
144143
"//executorch/runtime/kernel:kernel_includes" + aten_suffix,
145-
] + deps,
144+
] + deps + select({
145+
"ovr_config//os:android": android_deps,
146+
"DEFAULT": [],
147+
}),
146148
# WARNING: using a deprecated API to avoid being built into a shared
147149
# library. In the case of dynamically loading so library we don't want
148150
# it to depend on other so libraries because that way we have to

0 commit comments

Comments
 (0)