Skip to content

Commit dc81679

Browse files
committed
Update on "[Executorch] Make apple take accelerate path for blas"
For some reason fbobjc_exported_preprocessor_flags does not seems to work. Thus taking 'select' route which seems to work. Differential Revision: [D64499608](https://our.internmc.facebook.com/intern/diff/D64499608/) [ghstack-poisoned]
2 parents 1d2cf83 + 964a683 commit dc81679

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

kernels/optimized/lib_defs.bzl

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ def get_vec_fbcode_preprocessor_flags():
4343
]
4444
return preprocessor_flags
4545

46+
def get_apple_framework_deps():
47+
# various ovr_configs are not available in oss
48+
if not runtime.is_oss:
49+
frameworks = select({
50+
"DEFAULT": [],
51+
"ovr_config//os:iphoneos": ["$SDKROOT/System/Library/Frameworks/Accelerate.framework"],
52+
"ovr_config//os:macos-arm64": ["$SDKROOT/System/Library/Frameworks/Accelerate.framework"],
53+
"ovr_config//os:macos-x86_64": ["$SDKROOT/System/Library/Frameworks/Accelerate.framework"],
54+
})
55+
return frameworks
56+
return ["Accelerate"]
57+
4658
def get_preprocessor_flags():
4759
# various ovr_configs are not available in oss
4860
preprocessor_flags = select({
@@ -182,9 +194,7 @@ def define_libs():
182194
"-DET_BUILD_WITH_BLAS",
183195
"-DET_BUILD_FOR_APPLE",
184196
],
185-
fbobjc_frameworks = [
186-
"Accelerate",
187-
],
197+
frameworks = get_apple_framework_deps(),
188198
deps = select({
189199
":linux-x86_64": [mkl_dep] if not runtime.is_oss else [],
190200
"DEFAULT": [],

0 commit comments

Comments
 (0)