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_init(x) UNUSED(x)
|
||||||
#define ggml_lock_destroy(x) UNUSED(x)
|
#define ggml_lock_destroy(x) UNUSED(x)
|
||||||
#ifdef __x86_64__
|
#if defined(__x86_64__) || defined(_MSC_VER)
|
||||||
static inline void ggml_lock_lock(void* x);
|
#define ggml_lock_lock(x) _mm_pause()
|
||||||
inline void ggml_lock_lock(void* x) {
|
|
||||||
__asm__ __volatile__("pause\n");
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
#define ggml_lock_lock(x) UNUSED(x)
|
#define ggml_lock_lock(x) UNUSED(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue