Xuan Son Nguyen commited on
Commit
d8c76ac
·
1 Parent(s): 9746f77

ggml : fix missing `cpu_set_t` on emscripten (llama/9336)

Browse files

* ggml : fix missing cpu_set_t on emscripten

* better version

* bring back android part

Files changed (1) hide show
  1. ggml/src/ggml.c +14 -1
ggml/src/ggml.c CHANGED
@@ -19541,7 +19541,8 @@ static bool ggml_thread_apply_priority(int32_t prio) {
19541
  return true;
19542
  }
19543
 
19544
- #else // posix?
 
19545
 
19546
  static bool ggml_thread_apply_affinity(const bool * mask) {
19547
  cpu_set_t cpuset;
@@ -19596,6 +19597,18 @@ static bool ggml_thread_apply_priority(int32_t prio) {
19596
  return true;
19597
  }
19598
 
 
 
 
 
 
 
 
 
 
 
 
 
19599
  #endif
19600
 
19601
  static bool ggml_thread_cpumask_is_valid(const bool * mask) {
 
19541
  return true;
19542
  }
19543
 
19544
+ #elif defined(__gnu_linux__)
19545
+ // TODO: this may not work on BSD, to be verified
19546
 
19547
  static bool ggml_thread_apply_affinity(const bool * mask) {
19548
  cpu_set_t cpuset;
 
19597
  return true;
19598
  }
19599
 
19600
+ #else // unsupported platforms
19601
+
19602
+ static bool ggml_thread_apply_affinity(const bool * mask) {
19603
+ UNUSED(mask);
19604
+ return true;
19605
+ }
19606
+
19607
+ static bool ggml_thread_apply_priority(int32_t prio) {
19608
+ UNUSED(prio);
19609
+ return true;
19610
+ }
19611
+
19612
  #endif
19613
 
19614
  static bool ggml_thread_cpumask_is_valid(const bool * mask) {