instead of checking on glibc, check on SYS_getcpu

This commit is contained in:
Julia Longtin 2024-03-12 21:07:10 +00:00
parent a83e2cadc0
commit 5c0d49cde4

2
ggml.c
View file

@ -2322,7 +2322,6 @@ 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(&current_cpu, &g_state.numa.current_node);
#else
@ -2330,6 +2329,7 @@ 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, &current_cpu, &g_state.numa.current_node);
#endif
#endif