ggml : fix build broken with -march=armv9-a on MacOS (#16520)
* ggml : fix build broken with -march=armv9-a on MacOS Signed-off-by: Jie Fu <jiefu@tencent.com> * Add #pragma message Signed-off-by: Jie Fu <jiefu@tencent.com> * Address review comment. Signed-off-by: Jie Fu <jiefu@tencent.com> * Update ggml/src/ggml-cpu/ggml-cpu.c --------- Signed-off-by: Jie Fu <jiefu@tencent.com> Co-authored-by: Diego Devesa <slarengh@gmail.com>
This commit is contained in:
parent
56fc38b965
commit
01d2bdc2bc
|
|
@ -68,7 +68,7 @@ struct ggml_compute_params {
|
||||||
#endif // __VXE2__
|
#endif // __VXE2__
|
||||||
#endif // __s390x__ && __VEC__
|
#endif // __s390x__ && __VEC__
|
||||||
|
|
||||||
#if defined(__ARM_FEATURE_SVE)
|
#if defined(__ARM_FEATURE_SVE) && defined(__linux__)
|
||||||
#include <sys/prctl.h>
|
#include <sys/prctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -689,8 +689,13 @@ bool ggml_is_numa(void) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void ggml_init_arm_arch_features(void) {
|
static void ggml_init_arm_arch_features(void) {
|
||||||
#if defined(__linux__) && defined(__aarch64__) && defined(__ARM_FEATURE_SVE)
|
#if defined(__aarch64__) && defined(__ARM_FEATURE_SVE)
|
||||||
|
#if defined(__linux__)
|
||||||
ggml_arm_arch_features.sve_cnt = PR_SVE_VL_LEN_MASK & prctl(PR_SVE_GET_VL);
|
ggml_arm_arch_features.sve_cnt = PR_SVE_VL_LEN_MASK & prctl(PR_SVE_GET_VL);
|
||||||
|
#else
|
||||||
|
// TODO: add support of SVE for non-linux systems
|
||||||
|
#error "TODO: SVE is not supported on this platform. To use SVE, sve_cnt needs to be initialized here."
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue