]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
ggml : fix missing `cpu_set_t` on emscripten (#9336)
authorXuan Son Nguyen <redacted>
Sat, 7 Sep 2024 10:01:34 +0000 (12:01 +0200)
committerGitHub <redacted>
Sat, 7 Sep 2024 10:01:34 +0000 (12:01 +0200)
* ggml : fix missing cpu_set_t on emscripten

* better version

* bring back android part

ggml/src/ggml.c

index c98ca32bd45bf74b033423f1de48b6fe3db30af7..9dc12a02079211613250b1f72851ec8ea5d18182 100644 (file)
@@ -19556,7 +19556,8 @@ static bool ggml_thread_apply_priority(int32_t prio) {
     return true;
 }
 
-#else // posix?
+#elif defined(__gnu_linux__)
+// TODO: this may not work on BSD, to be verified
 
 static bool ggml_thread_apply_affinity(const bool * mask) {
     cpu_set_t cpuset;
@@ -19611,6 +19612,18 @@ static bool ggml_thread_apply_priority(int32_t prio) {
     return true;
 }
 
+#else // unsupported platforms
+
+static bool ggml_thread_apply_affinity(const bool * mask) {
+    UNUSED(mask);
+    return true;
+}
+
+static bool ggml_thread_apply_priority(int32_t prio) {
+    UNUSED(prio);
+    return true;
+}
+
 #endif
 
 static bool ggml_thread_cpumask_is_valid(const bool * mask) {