[PyTorch] Compile SVE's box-cox only when building targeting SVE (#163078)

Summary:
Internally, we are building PyTorch on the compat layer.
Need to avoid compiling sve's box-cox, as sve is not marked as build target.

Rollback Plan:

Reviewed By: rraometa, YifanYuan3

Differential Revision:
D82544412

Privacy Context Container: L1208939

Pull Request resolved: https://github.com/pytorch/pytorch/pull/163078
Approved by: https://github.com/Skylion007, https://github.com/malfet
This commit is contained in:
Nicolas De Carli
2025-09-17 03:35:11 +00:00
committed by PyTorch MergeBot
parent 65845d7291
commit 794b48c9f4

View File

@ -1,4 +1,4 @@
#if defined(__aarch64__) && defined(CAFFE2_PERF_WITH_SVE128)
#if defined(__aarch64__) && defined(__ARM_FEATURE_SVE) && defined(CAFFE2_PERF_WITH_SVE128)
#include <arm_neon.h>
#include <arm_neon_sve_bridge.h>
#include <arm_sve.h>
@ -240,4 +240,4 @@ template void compute_batch_box_cox__sve128<float>(
} // namespace caffe2::details
#endif // __aarch64__ && CAFFE2_PERF_WITH_SVE128
#endif // __aarch64__ && __ARM_FEATURE_SVE && CAFFE2_PERF_WITH_SVE128