threadpool: fix compiler errors for android and x64 builds
This commit is contained in:
parent
c1e7f488c3
commit
a67dbcc538
1 changed files with 8 additions and 6 deletions
14
ggml.c
14
ggml.c
|
@ -19402,6 +19402,9 @@ static bool __thread_priority(int32_t prio) {
|
||||||
|
|
||||||
#else // posix?
|
#else // posix?
|
||||||
|
|
||||||
|
#ifndef __USE_GNU
|
||||||
|
#define __USE_GNU
|
||||||
|
#endif
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
|
|
||||||
static bool __thread_affinity(const bool * mask) {
|
static bool __thread_affinity(const bool * mask) {
|
||||||
|
@ -19473,17 +19476,16 @@ static bool __thread_priority(int32_t prio) {
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __aarch64__
|
#if defined(__aarch64__) && ( defined(__clang__) || defined(__GNUC__) )
|
||||||
|
|
||||||
static inline void __cpu_relax(void) {
|
static inline void __cpu_relax(void) {
|
||||||
__asm__ volatile("yield" ::: "memory");
|
__asm__ volatile("yield" ::: "memory");
|
||||||
}
|
}
|
||||||
|
#elif defined(__x86_64__)
|
||||||
#else
|
|
||||||
|
|
||||||
static inline void __cpu_relax(void) {
|
static inline void __cpu_relax(void) {
|
||||||
__asm__ volatile("rep; nop" ::: "memory");
|
_mm_pause();
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
static inline void __cpu_relax(void) {;}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void __cpumask_next(const bool * global_mask, bool * local_mask, bool strict, int32_t* iter) {
|
static void __cpumask_next(const bool * global_mask, bool * local_mask, bool strict, int32_t* iter) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue