Skip to content

Commit d0b014f

Browse files
committed
add MATMUL_INT8 capability to system_info
1 parent 62f8f2f commit d0b014f

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

common/common.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,6 +1531,7 @@ void dump_non_result_info_yaml(FILE * stream, const gpt_params & params, const l
15311531
fprintf(stream, "cpu_has_blas: %s\n", ggml_cpu_has_blas() ? "true" : "false");
15321532
fprintf(stream, "cpu_has_sse3: %s\n", ggml_cpu_has_sse3() ? "true" : "false");
15331533
fprintf(stream, "cpu_has_vsx: %s\n", ggml_cpu_has_vsx() ? "true" : "false");
1534+
fprintf(stream, "cpu_has_matmul_int8: %s\n", ggml_cpu_has_matmul_int8() ? "true" : "false");
15341535

15351536
#ifdef NDEBUG
15361537
fprintf(stream, "debug: false\n");

ggml.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20554,4 +20554,12 @@ int ggml_cpu_has_vsx(void) {
2055420554
#endif
2055520555
}
2055620556

20557+
int ggml_cpu_has_matmul_int8(void) {
20558+
#if defined(__ARM_FEATURE_MATMUL_INT8)
20559+
return 1;
20560+
#else
20561+
return 0;
20562+
#endif
20563+
}
20564+
2055720565
////////////////////////////////////////////////////////////////////////////////

ggml.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2272,6 +2272,7 @@ extern "C" {
22722272
GGML_API int ggml_cpu_has_ssse3 (void);
22732273
GGML_API int ggml_cpu_has_sycl (void);
22742274
GGML_API int ggml_cpu_has_vsx (void);
2275+
GGML_API int ggml_cpu_has_matmul_int8(void);
22752276

22762277
//
22772278
// Internal types and functions exposed for tests and benchmarks

llama.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11417,6 +11417,7 @@ const char * llama_print_system_info(void) {
1141711417
s += "SSE3 = " + std::to_string(ggml_cpu_has_sse3()) + " | ";
1141811418
s += "SSSE3 = " + std::to_string(ggml_cpu_has_ssse3()) + " | ";
1141911419
s += "VSX = " + std::to_string(ggml_cpu_has_vsx()) + " | ";
11420+
s += "MATMUL_INT8 = " + std::to_string(ggml_cpu_has_matmul_int8()) + " | ";
1142011421

1142111422
return s.c_str();
1142211423
}

0 commit comments

Comments
 (0)