Skip to content

Commit 44e344c

Browse files
committed
Fix SLEEF preprocessor macro name to match ATen vec headers
The ATen NEON vectorized math headers (vec128_float_neon.h) check for AT_BUILD_ARM_VEC256_WITH_SLEEF to enable SLEEF intrinsics for exp(), log(), etc. ExecuTorch's get_vec_preprocessor_flags() was defining ET_BUILD_ARM_VEC256_WITH_SLEEF (wrong prefix), so the USE_SLEEF macro always took the fallback path: map(std::exp) — scalar exp called per-element with full vector load/store overhead wrapping it. With this fix, Vectorized<float>::exp() correctly dispatches to Sleef_expf4_u10 on ARM, which is the intended behavior. Differential Revision: [D96044314](https://our.internmc.facebook.com/intern/diff/D96044314/) ghstack-source-id: 361224790 Pull Request resolved: #18645
1 parent 8e67a7a commit 44e344c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

kernels/optimized/lib_defs.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ def get_vec_preprocessor_flags():
2525
# various ovr_configs are not available in oss
2626
preprocessor_flags = select({
2727
"ovr_config//os:linux-x86_64": [
28-
"-DET_BUILD_ARM_VEC256_WITH_SLEEF",
28+
"-DAT_BUILD_ARM_VEC256_WITH_SLEEF",
2929
] if not runtime.is_oss else [],
3030
"ovr_config//os:iphoneos-arm64": [
31-
"-DET_BUILD_ARM_VEC256_WITH_SLEEF",
31+
"-DAT_BUILD_ARM_VEC256_WITH_SLEEF",
3232
] if not runtime.is_oss else [],
3333
"ovr_config//os:macos-arm64": [
34-
"-DET_BUILD_ARM_VEC256_WITH_SLEEF",
34+
"-DAT_BUILD_ARM_VEC256_WITH_SLEEF",
3535
] if not runtime.is_oss else [],
3636
"ovr_config//os:android-arm64": [
37-
"-DET_BUILD_ARM_VEC256_WITH_SLEEF",
37+
"-DAT_BUILD_ARM_VEC256_WITH_SLEEF",
3838
] if not runtime.is_oss else [],
3939
"DEFAULT": [],
4040
})

0 commit comments

Comments
 (0)