use _mm_pause() in busyloop

This commit is contained in:
Sami Farin 2023-05-06 07:48:45 +03:00
parent 458aeb10e9
commit 23f148516d

7
ggml.c
View file

@ -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