Skip to content

Commit 04de2ac

Browse files
committed
ggml : remove ggml_arm_arch_features
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
1 parent 105a26a commit 04de2ac

File tree

1 file changed

+5
-23
lines changed

1 file changed

+5
-23
lines changed

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

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
#undef GGML_USE_LLAMAFILE
4747
#endif
4848

49+
#if defined(__ARM_FEATURE_SVE)
50+
#include <arm_sve.h>
51+
#endif
52+
4953
#ifdef GGML_USE_LLAMAFILE
5054
#include "llamafile/sgemm.h"
5155
#endif
@@ -75,13 +79,6 @@
7579
// precomputed f32 table for f16 (256 KB) (simd-mappings.h)
7680
float ggml_table_f32_f16[1 << 16];
7781

78-
#if defined(__ARM_ARCH)
79-
struct ggml_arm_arch_features_type {
80-
int sve_cnt;
81-
} ggml_arm_arch_features = { 0 };
82-
#endif
83-
84-
8582
#if defined(_WIN32)
8683

8784
#define WIN32_LEAN_AND_MEAN
@@ -682,17 +679,6 @@ bool ggml_is_numa(void) {
682679
return g_state.numa.n_nodes > 1;
683680
}
684681

685-
#if defined(__ARM_ARCH)
686-
#if defined(__aarch64__) && defined(__ARM_FEATURE_SVE)
687-
#include <arm_sve.h>
688-
static void ggml_init_arm_arch_features(void) {
689-
ggml_arm_arch_features.sve_cnt = svcntb();
690-
}
691-
#else
692-
static void ggml_init_arm_arch_features(void) {}
693-
#endif
694-
#endif // __ARM_ARCH
695-
696682
struct ggml_tensor * ggml_new_i32(struct ggml_context * ctx, int32_t value) {
697683
GGML_ASSERT(!ggml_get_no_alloc(ctx));
698684

@@ -3548,7 +3534,7 @@ int ggml_cpu_has_matmul_int8(void) {
35483534

35493535
int ggml_cpu_get_sve_cnt(void) {
35503536
#if defined(__ARM_ARCH) && defined(__ARM_FEATURE_SVE)
3551-
return ggml_arm_arch_features.sve_cnt;
3537+
return svcntb();
35523538
#else
35533539
return 0;
35543540
#endif
@@ -3612,10 +3598,6 @@ void ggml_cpu_init(void) {
36123598
#endif
36133599
}
36143600

3615-
#if defined(__ARM_ARCH)
3616-
ggml_init_arm_arch_features();
3617-
#endif
3618-
36193601
is_first_call = false;
36203602
}
36213603

0 commit comments

Comments
 (0)