|
46 | 46 | #undef GGML_USE_LLAMAFILE |
47 | 47 | #endif |
48 | 48 |
|
| 49 | +#if defined(__ARM_FEATURE_SVE) |
| 50 | +#include <arm_sve.h> |
| 51 | +#endif |
| 52 | + |
49 | 53 | #ifdef GGML_USE_LLAMAFILE |
50 | 54 | #include "llamafile/sgemm.h" |
51 | 55 | #endif |
|
75 | 79 | // precomputed f32 table for f16 (256 KB) (simd-mappings.h) |
76 | 80 | float ggml_table_f32_f16[1 << 16]; |
77 | 81 |
|
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 | | - |
85 | 82 | #if defined(_WIN32) |
86 | 83 |
|
87 | 84 | #define WIN32_LEAN_AND_MEAN |
@@ -682,17 +679,6 @@ bool ggml_is_numa(void) { |
682 | 679 | return g_state.numa.n_nodes > 1; |
683 | 680 | } |
684 | 681 |
|
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 | | - |
696 | 682 | struct ggml_tensor * ggml_new_i32(struct ggml_context * ctx, int32_t value) { |
697 | 683 | GGML_ASSERT(!ggml_get_no_alloc(ctx)); |
698 | 684 |
|
@@ -3539,7 +3525,7 @@ int ggml_cpu_has_matmul_int8(void) { |
3539 | 3525 |
|
3540 | 3526 | int ggml_cpu_get_sve_cnt(void) { |
3541 | 3527 | #if defined(__ARM_ARCH) && defined(__ARM_FEATURE_SVE) |
3542 | | - return ggml_arm_arch_features.sve_cnt; |
| 3528 | + return svcntb(); |
3543 | 3529 | #else |
3544 | 3530 | return 0; |
3545 | 3531 | #endif |
@@ -3603,10 +3589,6 @@ void ggml_cpu_init(void) { |
3603 | 3589 | #endif |
3604 | 3590 | } |
3605 | 3591 |
|
3606 | | -#if defined(__ARM_ARCH) |
3607 | | - ggml_init_arm_arch_features(); |
3608 | | -#endif |
3609 | | - |
3610 | 3592 | is_first_call = false; |
3611 | 3593 | } |
3612 | 3594 |
|
|
0 commit comments