Cebtenzzre commited on
Commit
909dbdc
·
unverified ·
1 Parent(s): 7f5bc53

ggml : use SYS_get_cpu if SYS_getcpu is not defined (llama/5906)

Browse files
Files changed (1) hide show
  1. ggml.c +4 -1
ggml.c CHANGED
@@ -2154,7 +2154,10 @@ void ggml_numa_init(enum ggml_numa_strategy numa_flag) {
2154
  getcpu_ret = getcpu(&current_cpu, &g_state.numa.current_node);
2155
  #else
2156
  // old glibc doesn't have a wrapper for this call. Fall back on direct syscall
2157
- getcpu_ret = syscall(SYS_getcpu,&current_cpu,&g_state.numa.current_node);
 
 
 
2158
  #endif
2159
 
2160
  if (g_state.numa.n_nodes < 1 || g_state.numa.total_cpus < 1 || getcpu_ret != 0) {
 
2154
  getcpu_ret = getcpu(&current_cpu, &g_state.numa.current_node);
2155
  #else
2156
  // old glibc doesn't have a wrapper for this call. Fall back on direct syscall
2157
+ # if !defined(SYS_getcpu) && defined(SYS_get_cpu)
2158
+ # define SYS_getcpu SYS_get_cpu // some older glibc versions use this name
2159
+ # endif
2160
+ getcpu_ret = syscall(SYS_getcpu, &current_cpu, &g_state.numa.current_node);
2161
  #endif
2162
 
2163
  if (g_state.numa.n_nodes < 1 || g_state.numa.total_cpus < 1 || getcpu_ret != 0) {