Skip to content

Commit 7a9df80

Browse files
jaejunkufacebook-github-bot
authored andcommitted
Rm platform args executorch (#15819)
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 be741ad commit 7a9df80

File tree

2 files changed

+37
-51
lines changed

2 files changed

+37
-51
lines changed

kernels/optimized/lib_defs.bzl

Lines changed: 35 additions & 49 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():
@@ -127,32 +124,19 @@ def define_libs(is_fbcode=False):
127124
exported_deps = [
128125
"//executorch/runtime/core/portable_type/c10/c10:aten_headers_for_executorch",
129126
],
130-
cxx_platform_deps = select({
131-
"DEFAULT": [
132-
(
133-
DEVSERVER_PLATFORM_REGEX,
134-
[
135-
"fbsource//third-party/sleef:sleef",
136-
],
137-
),
127+
cxx_deps = select({
128+
"DEFAULT": [],
129+
"ovr_config//os:linux": [
130+
"fbsource//third-party/sleef:sleef",
138131
],
139-
"ovr_config//cpu:arm64": [
140-
(
141-
DEVSERVER_PLATFORM_REGEX,
142-
[
143-
"fbsource//third-party/sleef:sleef",
144-
],
145-
),
132+
133+
}),
134+
fbandroid_deps = select({
135+
"DEFAULT": [],
136+
"ovr_config//os:android-arm64": [
137+
"fbsource//third-party/sleef:sleef",
146138
],
147139
}),
148-
fbandroid_platform_deps = [
149-
(
150-
"^android-arm64.*$",
151-
[
152-
"fbsource//third-party/sleef:sleef",
153-
],
154-
),
155-
],
156140
)
157141

158142
runtime.cxx_library(
@@ -187,6 +171,24 @@ def define_libs(is_fbcode=False):
187171
]
188172

189173
for libblas_name, mkl_dep in [("libblas", "fbsource//third-party/mkl:mkl_lp64_omp"), ("libblas_mkl_noomp", "fbsource//third-party/mkl:mkl")]:
174+
# Merge platform-specific kwargs
175+
platform_kwargs = get_apple_framework_deps_kwargs(is_fbcode)
176+
if not is_fbcode:
177+
platform_kwargs.update({
178+
"fbandroid_preprocessor_flags": select({
179+
"DEFAULT": [],
180+
"ovr_config//os:android-arm64": [
181+
"-DET_BUILD_WITH_BLAS",
182+
],
183+
}),
184+
"fbandroid_deps": select({
185+
"DEFAULT": [],
186+
"ovr_config//os:android-arm64": [
187+
"fbsource//arvr/third-party/eigen:eigen3_blas",
188+
],
189+
}),
190+
})
191+
190192
runtime.cxx_library(
191193
name = libblas_name,
192194
srcs = native.glob([
@@ -207,22 +209,6 @@ def define_libs(is_fbcode=False):
207209
"@EXECUTORCH_CLIENTS",
208210
],
209211
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-
],
226212
fbobjc_exported_preprocessor_flags = [
227213
"-DET_BUILD_WITH_BLAS",
228214
"-DET_BUILD_FOR_APPLE",
@@ -237,5 +223,5 @@ def define_libs(is_fbcode=False):
237223
"//executorch/runtime/core/exec_aten:lib",
238224
"//executorch/runtime/core/portable_type/c10/c10:aten_headers_for_executorch",
239225
],
240-
**get_apple_framework_deps_kwargs(is_fbcode),
226+
**platform_kwargs,
241227
)

kernels/optimized/test/targets.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ 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+
cxx_preprocessor_flags = get_vec_cxx_preprocessor_flags(),
30+
preprocessor_flags = get_vec_preprocessor_flags()
3131
)
3232

3333
def define_common_targets():

0 commit comments

Comments
 (0)