Skip to content

ggml : reading the runtime sve config of the cpu #8382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ggml/src/ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
#include <unistd.h>
#endif

#if defined(__ARM_FEATURE_SVE)
#include <sys/prctl.h>
#endif

#ifdef __ARM_FEATURE_MATMUL_INT8
#undef GGML_USE_LLAMAFILE
#endif
Expand Down Expand Up @@ -21760,7 +21764,7 @@ int ggml_cpu_has_neon(void) {
int ggml_cpu_has_sve(void) {
#if defined(__ARM_FEATURE_SVE)
// TODO: Currently, SVE 256 bit is only supported.
GGML_ASSERT(svcntb() == QK8_0);
GGML_ASSERT((PR_SVE_VL_LEN_MASK & prctl(PR_SVE_GET_VL)) == QK8_0);
return 1;
#else
return 0;
Expand Down
Loading