Skip to content

Commit 502cc78

Browse files
committed
ggml : remove ggml_arm_arch_features
Signed-off-by: Adrien Gallouët <[email protected]>
1 parent 115f0b1 commit 502cc78

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

@@ -3539,7 +3525,7 @@ int ggml_cpu_has_matmul_int8(void) {
35393525

35403526
int ggml_cpu_get_sve_cnt(void) {
35413527
#if defined(__ARM_ARCH) && defined(__ARM_FEATURE_SVE)
3542-
return ggml_arm_arch_features.sve_cnt;
3528+
return svcntb();
35433529
#else
35443530
return 0;
35453531
#endif
@@ -3603,10 +3589,6 @@ void ggml_cpu_init(void) {
36033589
#endif
36043590
}
36053591

3606-
#if defined(__ARM_ARCH)
3607-
ggml_init_arm_arch_features();
3608-
#endif
3609-
36103592
is_first_call = false;
36113593
}
36123594

0 commit comments

Comments
 (0)