Skip to content

Commit eddcb52

Browse files
authored
ggml : add and use ggml_cpu_has_llamafile() (#8664)
1 parent be6d7c0 commit eddcb52

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

ggml/include/ggml.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2400,6 +2400,7 @@ extern "C" {
24002400
GGML_API int ggml_cpu_has_vsx (void);
24012401
GGML_API int ggml_cpu_has_matmul_int8(void);
24022402
GGML_API int ggml_cpu_has_cann (void);
2403+
GGML_API int ggml_cpu_has_llamafile (void);
24032404

24042405
//
24052406
// Internal types and functions exposed for tests and benchmarks

ggml/src/ggml.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22005,6 +22005,14 @@ int ggml_cpu_has_cann(void) {
2200522005
#endif
2200622006
}
2200722007

22008+
int ggml_cpu_has_llamafile(void) {
22009+
#if defined(GGML_USE_LLAMAFILE)
22010+
return 1;
22011+
#else
22012+
return 0;
22013+
#endif
22014+
}
22015+
2200822016
int ggml_cpu_has_gpublas(void) {
2200922017
return ggml_cpu_has_cuda() || ggml_cpu_has_vulkan() || ggml_cpu_has_kompute() || ggml_cpu_has_sycl();
2201022018
}

src/llama.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19146,11 +19146,7 @@ const char * llama_print_system_info(void) {
1914619146
s += "SSSE3 = " + std::to_string(ggml_cpu_has_ssse3()) + " | ";
1914719147
s += "VSX = " + std::to_string(ggml_cpu_has_vsx()) + " | ";
1914819148
s += "MATMUL_INT8 = " + std::to_string(ggml_cpu_has_matmul_int8()) + " | ";
19149-
#ifdef GGML_USE_LLAMAFILE
19150-
s += "LLAMAFILE = 1 | ";
19151-
#else
19152-
s += "LLAMAFILE = 0 | ";
19153-
#endif
19149+
s += "LLAMAFILE = " + std::to_string(ggml_cpu_has_llamafile()) + " | ";
1915419150

1915519151
return s.c_str();
1915619152
}

0 commit comments

Comments
 (0)