]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
ggml : fix missing `cpu_set_t` on emscripten (llama/9336)
authorXuan Son Nguyen <redacted>
Sat, 7 Sep 2024 10:01:34 +0000 (12:01 +0200)
committerGeorgi Gerganov <redacted>
Sun, 8 Sep 2024 11:43:07 +0000 (14:43 +0300)
* ggml : fix missing cpu_set_t on emscripten

* better version

* bring back android part

src/ggml.c

index 08a90ced2c7e53beaceb5d8ff1e9a75be8083762..212be9fe597ef8647ac35e07247353fb47b56f02 100644 (file)
@@ -19541,7 +19541,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;
@@ -19596,6 +19597,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) {