Skip to content

Commit

Permalink
threadpool: fix compiler errors for android and x64 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
max-krasnyansky committed May 28, 2024
1 parent c1e7f48 commit a67dbcc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -19402,6 +19402,9 @@ static bool __thread_priority(int32_t prio) {

#else // posix?

#ifndef __USE_GNU
#define __USE_GNU
#endif
#include <sched.h>

static bool __thread_affinity(const bool * mask) {
Expand Down Expand Up @@ -19473,17 +19476,16 @@ static bool __thread_priority(int32_t prio) {

#endif

#ifdef __aarch64__

#if defined(__aarch64__) && ( defined(__clang__) || defined(__GNUC__) )
static inline void __cpu_relax(void) {
__asm__ volatile("yield" ::: "memory");
}

#else

#elif defined(__x86_64__)
static inline void __cpu_relax(void) {
__asm__ volatile("rep; nop" ::: "memory");
_mm_pause();
}
#else
static inline void __cpu_relax(void) {;}
#endif

static void __cpumask_next(const bool * global_mask, bool * local_mask, bool strict, int32_t* iter) {
Expand Down

0 comments on commit a67dbcc

Please sign in to comment.