use _mm_pause() in busyloop
This commit is contained in:
parent
458aeb10e9
commit
23f148516d
1 changed files with 2 additions and 5 deletions
7
ggml.c
7
ggml.c
|
@ -11656,11 +11656,8 @@ typedef int ggml_lock_t;
|
|||
|
||||
#define ggml_lock_init(x) UNUSED(x)
|
||||
#define ggml_lock_destroy(x) UNUSED(x)
|
||||
#ifdef __x86_64__
|
||||
static inline void ggml_lock_lock(void* x);
|
||||
inline void ggml_lock_lock(void* x) {
|
||||
__asm__ __volatile__("pause\n");
|
||||
}
|
||||
#if defined(__x86_64__) || defined(_MSC_VER)
|
||||
#define ggml_lock_lock(x) _mm_pause()
|
||||
#else
|
||||
#define ggml_lock_lock(x) UNUSED(x)
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue