handle the case that we have no glibc on the PHI.
This commit is contained in:
parent
9ec8635a06
commit
a83e2cadc0
1 changed files with 2 additions and 1 deletions
3
ggml.c
3
ggml.c
|
@ -2322,6 +2322,7 @@ 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)
|
||||
getcpu_ret = getcpu(¤t_cpu, &g_state.numa.current_node);
|
||||
#else
|
||||
|
@ -2331,7 +2332,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
|
||||
if (g_state.numa.n_nodes < 1 || g_state.numa.total_cpus < 1 || getcpu_ret != 0) {
|
||||
g_state.numa.n_nodes = 0;
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue