Skip to content

Commit

Permalink
ggml : use SYS_get_cpu if SYS_getcpu is not defined (ggerganov#5906)
Browse files Browse the repository at this point in the history
  • Loading branch information
cebtenzzre authored Mar 6, 2024
1 parent e25fb4b commit e04e04f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -2154,7 +2154,10 @@ void ggml_numa_init(enum ggml_numa_strategy numa_flag) {
getcpu_ret = getcpu(&current_cpu, &g_state.numa.current_node);
#else
// old glibc doesn't have a wrapper for this call. Fall back on direct syscall
getcpu_ret = syscall(SYS_getcpu,&current_cpu,&g_state.numa.current_node);
# 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, &current_cpu, &g_state.numa.current_node);
#endif

if (g_state.numa.n_nodes < 1 || g_state.numa.total_cpus < 1 || getcpu_ret != 0) {
Expand Down

0 comments on commit e04e04f

Please sign in to comment.