mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-12 19:50:17 +00:00
ggml : use SYS_get_cpu if SYS_getcpu is not defined (#5906)
Fixes #5694 Fixes ggerganov/whisper.cpp#1894
This commit is contained in:
parent
e25fb4b18f
commit
e04e04f8fa
3
ggml.c
3
ggml.c
@ -2154,6 +2154,9 @@ void ggml_numa_init(enum ggml_numa_strategy numa_flag) {
|
|||||||
getcpu_ret = getcpu(¤t_cpu, &g_state.numa.current_node);
|
getcpu_ret = getcpu(¤t_cpu, &g_state.numa.current_node);
|
||||||
#else
|
#else
|
||||||
// old glibc doesn't have a wrapper for this call. Fall back on direct syscall
|
// old glibc doesn't have a wrapper for this call. Fall back on direct syscall
|
||||||
|
# if !defined(SYS_getcpu) && defined(SYS_get_cpu)
|
||||||
|
# define SYS_getcpu SYS_get_cpu // some older glibc versions use this name
|
||||||
|
# endif
|
||||||
getcpu_ret = syscall(SYS_getcpu, ¤t_cpu, &g_state.numa.current_node);
|
getcpu_ret = syscall(SYS_getcpu, ¤t_cpu, &g_state.numa.current_node);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user