Skip to content

Commit aebbfea

Browse files
jaejunkufacebook-github-bot
authored andcommitted
Rm platform args executorch
Summary: Get rid of platform args around the repo to unblock modernization with platforms. Platform args were only needed in buck1 Differential Revision: D86989255
1 parent c247604 commit aebbfea

File tree

2 files changed

+32
-52
lines changed

2 files changed

+32
-52
lines changed

kernels/optimized/lib_defs.bzl

Lines changed: 31 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
load("@fbsource//tools/build_defs:default_platform_defs.bzl", "DEVSERVER_PLATFORM_REGEX")
21
load("@fbsource//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
32
load("@fbsource//xplat/executorch/backends/xnnpack/third-party:third_party_libs.bzl", "third_party_dep")
43
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
@@ -51,14 +50,12 @@ def get_vec_deps():
5150
return []
5251

5352
def get_vec_cxx_preprocessor_flags():
54-
preprocessor_flags = [
55-
(
56-
DEVSERVER_PLATFORM_REGEX,
57-
[
58-
"-DCPU_CAPABILITY_AVX2",
59-
],
60-
),
61-
]
53+
preprocessor_flags = select({
54+
"DEFAULT": [],
55+
"ovr_config//os:linux": [
56+
"-DCPU_CAPABILITY_AVX2",
57+
],
58+
})
6259
return preprocessor_flags
6360

6461
def get_vec_fbcode_preprocessor_flags():
@@ -126,33 +123,15 @@ def define_libs(is_fbcode=False):
126123
],
127124
exported_deps = [
128125
"//executorch/runtime/core/portable_type/c10/c10:aten_headers_for_executorch",
129-
],
130-
cxx_platform_deps = select({
131-
"DEFAULT": [
132-
(
133-
DEVSERVER_PLATFORM_REGEX,
134-
[
135-
"fbsource//third-party/sleef:sleef",
136-
],
137-
),
126+
] + select({
127+
"DEFAULT": [],
128+
"ovr_config//os:linux": [
129+
"fbsource//third-party/sleef:sleef",
138130
],
139-
"ovr_config//cpu:arm64": [
140-
(
141-
DEVSERVER_PLATFORM_REGEX,
142-
[
143-
"fbsource//third-party/sleef:sleef",
144-
],
145-
),
131+
"ovr_config//os:android-arm64": [
132+
"fbsource//third-party/sleef:sleef",
146133
],
147134
}),
148-
fbandroid_platform_deps = [
149-
(
150-
"^android-arm64.*$",
151-
[
152-
"fbsource//third-party/sleef:sleef",
153-
],
154-
),
155-
],
156135
)
157136

158137
runtime.cxx_library(
@@ -187,6 +166,24 @@ def define_libs(is_fbcode=False):
187166
]
188167

189168
for libblas_name, mkl_dep in [("libblas", "fbsource//third-party/mkl:mkl_lp64_omp"), ("libblas_mkl_noomp", "fbsource//third-party/mkl:mkl")]:
169+
# Merge platform-specific kwargs
170+
platform_kwargs = get_apple_framework_deps_kwargs(is_fbcode)
171+
if not is_fbcode:
172+
platform_kwargs.update({
173+
"fbandroid_preprocessor_flags": select({
174+
"DEFAULT": [],
175+
"ovr_config//os:android-arm64": [
176+
"-DET_BUILD_WITH_BLAS",
177+
],
178+
}),
179+
"fbandroid_deps": select({
180+
"DEFAULT": [],
181+
"ovr_config//os:android-arm64": [
182+
"fbsource//arvr/third-party/eigen:eigen3_blas",
183+
],
184+
}),
185+
})
186+
190187
runtime.cxx_library(
191188
name = libblas_name,
192189
srcs = native.glob([
@@ -207,22 +204,6 @@ def define_libs(is_fbcode=False):
207204
"@EXECUTORCH_CLIENTS",
208205
],
209206
preprocessor_flags = get_preprocessor_flags(),
210-
fbandroid_platform_preprocessor_flags = [
211-
(
212-
"^android-arm64.*$",
213-
[
214-
"-DET_BUILD_WITH_BLAS",
215-
],
216-
),
217-
],
218-
fbandroid_platform_deps = [
219-
(
220-
"^android-arm64.*$",
221-
[
222-
"fbsource//arvr/third-party/eigen:eigen3_blas",
223-
],
224-
),
225-
],
226207
fbobjc_exported_preprocessor_flags = [
227208
"-DET_BUILD_WITH_BLAS",
228209
"-DET_BUILD_FOR_APPLE",
@@ -237,5 +218,5 @@ def define_libs(is_fbcode=False):
237218
"//executorch/runtime/core/exec_aten:lib",
238219
"//executorch/runtime/core/portable_type/c10/c10:aten_headers_for_executorch",
239220
],
240-
**get_apple_framework_deps_kwargs(is_fbcode),
221+
**platform_kwargs,
241222
)

kernels/optimized/test/targets.bzl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ def _lib_test_bin(name, extra_deps = [], in_cpu = False):
2626
"//executorch/test/utils:utils",
2727
"//executorch/kernels/optimized{}:{}".format(cpu_path, lib_root),
2828
] + extra_deps,
29-
cxx_platform_preprocessor_flags = get_vec_cxx_preprocessor_flags(),
30-
preprocessor_flags = get_vec_preprocessor_flags(),
29+
preprocessor_flags = get_vec_preprocessor_flags() + get_vec_cxx_preprocessor_flags(),
3130
)
3231

3332
def define_common_targets():

0 commit comments

Comments
 (0)