diff --git a/ggml.c b/ggml.c index b1bed3352..2c6cd8c5c 100644 --- a/ggml.c +++ b/ggml.c @@ -2521,7 +2521,6 @@ void ggml_numa_init(enum ggml_numa_strategy numa_flag) { uint current_cpu; int getcpu_ret = 0; -#if defined(__GLIBC__) #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 28) || defined(__COSMOPOLITAN__) getcpu_ret = getcpu(¤t_cpu, &g_state.numa.current_node); #else @@ -2529,9 +2528,9 @@ void ggml_numa_init(enum ggml_numa_strategy numa_flag) { # if !defined(SYS_getcpu) && defined(SYS_get_cpu) # define SYS_getcpu SYS_get_cpu // some older glibc versions use this name # endif +# if defined(SYS_getcpu) getcpu_ret = syscall(SYS_getcpu, ¤t_cpu, &g_state.numa.current_node); #endif -#endif /* defined(__GLIBC__) */ if (g_state.numa.n_nodes < 1 || g_state.numa.total_cpus < 1 || getcpu_ret != 0) { g_state.numa.n_nodes = 0;