From 78291d93b966ca8113900388edad8654ed940211 Mon Sep 17 00:00:00 2001 From: Julia Longtin Date: Tue, 12 Mar 2024 21:02:14 +0000 Subject: [PATCH] handle the case that we have no glibc on the PHI. --- ggml.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ggml.c b/ggml.c index cc403d1a2..b1bed3352 100644 --- a/ggml.c +++ b/ggml.c @@ -2520,6 +2520,8 @@ void ggml_numa_init(enum ggml_numa_strategy numa_flag) { // figure out which node we're on 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,6 +2531,7 @@ void ggml_numa_init(enum ggml_numa_strategy numa_flag) { # endif 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;