]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
fix pthreads setaffinity usage on android (#2020)
authorErik Scholz <redacted>
Tue, 27 Jun 2023 17:06:33 +0000 (19:06 +0200)
committerGitHub <redacted>
Tue, 27 Jun 2023 17:06:33 +0000 (19:06 +0200)
ggml.c

diff --git a/ggml.c b/ggml.c
index 92faf03f746a1c4203f6ab98725ad3660b3e2298..684caaa376e568cc65e274fff380a4f132d2f233 100644 (file)
--- a/ggml.c
+++ b/ggml.c
@@ -16684,7 +16684,8 @@ typedef pthread_t ggml_thread_t;
 
 #endif
 
-#ifdef __linux__
+// Android's libc implementation "bionic" does not support setting affinity
+#if defined(__linux__) && !defined(__BIONIC__)
 void set_numa_thread_affinity(int thread_n, int n_threads) {
     if (!ggml_is_numa()) {
         return;