Skip to content

Commit d228130

Browse files
committed
add MATMUL_INT8 capability to system_info
1 parent e9e826a commit d228130

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
@@ -1528,6 +1528,7 @@ void dump_non_result_info_yaml(FILE * stream, const gpt_params & params, const l
15281528
fprintf(stream, "cpu_has_blas: %s\n", ggml_cpu_has_blas() ? "true" : "false");
15291529
fprintf(stream, "cpu_has_sse3: %s\n", ggml_cpu_has_sse3() ? "true" : "false");
15301530
fprintf(stream, "cpu_has_vsx: %s\n", ggml_cpu_has_vsx() ? "true" : "false");
1531+
fprintf(stream, "cpu_has_matmul_int8: %s\n", ggml_cpu_has_matmul_int8() ? "true" : "false");
15311532

15321533
#ifdef NDEBUG
15331534
fprintf(stream, "debug: false\n");

ggml.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20377,4 +20377,12 @@ int ggml_cpu_has_vsx(void) {
2037720377
#endif
2037820378
}
2037920379

20380+
int ggml_cpu_has_matmul_int8(void) {
20381+
#if defined(__ARM_FEATURE_MATMUL_INT8)
20382+
return 1;
20383+
#else
20384+
return 0;
20385+
#endif
20386+
}
20387+
2038020388
////////////////////////////////////////////////////////////////////////////////

ggml.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,6 +2271,7 @@ extern "C" {
22712271
GGML_API int ggml_cpu_has_sse3 (void);
22722272
GGML_API int ggml_cpu_has_ssse3 (void);
22732273
GGML_API int ggml_cpu_has_vsx (void);
2274+
GGML_API int ggml_cpu_has_matmul_int8(void);
22742275

22752276
//
22762277
// 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
@@ -11005,6 +11005,7 @@ const char * llama_print_system_info(void) {
1100511005
s += "SSE3 = " + std::to_string(ggml_cpu_has_sse3()) + " | ";
1100611006
s += "SSSE3 = " + std::to_string(ggml_cpu_has_ssse3()) + " | ";
1100711007
s += "VSX = " + std::to_string(ggml_cpu_has_vsx()) + " | ";
11008+
s += "MATMUL_INT8 = " + std::to_string(ggml_cpu_has_matmul_int8()) + " | ";
1100811009

1100911010
return s.c_str();
1101011011
}

0 commit comments

Comments
 (0)