Skip to content

Commit 01d2bdc

Browse files
DamonFoolslaren
andauthored
ggml : fix build broken with -march=armv9-a on MacOS (ggml-org#16520)
* ggml : fix build broken with -march=armv9-a on MacOS Signed-off-by: Jie Fu <[email protected]> * Add #pragma message Signed-off-by: Jie Fu <[email protected]> * Address review comment. Signed-off-by: Jie Fu <[email protected]> * Update ggml/src/ggml-cpu/ggml-cpu.c --------- Signed-off-by: Jie Fu <[email protected]> Co-authored-by: Diego Devesa <[email protected]>
1 parent 56fc38b commit 01d2bdc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

ggml/src/ggml-cpu/ggml-cpu-impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct ggml_compute_params {
6868
#endif // __VXE2__
6969
#endif // __s390x__ && __VEC__
7070

71-
#if defined(__ARM_FEATURE_SVE)
71+
#if defined(__ARM_FEATURE_SVE) && defined(__linux__)
7272
#include <sys/prctl.h>
7373
#endif
7474

ggml/src/ggml-cpu/ggml-cpu.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,13 @@ bool ggml_is_numa(void) {
689689
#endif
690690

691691
static void ggml_init_arm_arch_features(void) {
692-
#if defined(__linux__) && defined(__aarch64__) && defined(__ARM_FEATURE_SVE)
692+
#if defined(__aarch64__) && defined(__ARM_FEATURE_SVE)
693+
#if defined(__linux__)
693694
ggml_arm_arch_features.sve_cnt = PR_SVE_VL_LEN_MASK & prctl(PR_SVE_GET_VL);
695+
#else
696+
// TODO: add support of SVE for non-linux systems
697+
#error "TODO: SVE is not supported on this platform. To use SVE, sve_cnt needs to be initialized here."
698+
#endif
694699
#endif
695700
}
696701

0 commit comments

Comments
 (0)