use pause asm insn in busyloop to run the CPU (13600K) 10 °C cooler

Tested with a 13B model.
This commit is contained in:
Sami Farin 2023-05-04 13:51:29 +03:00
parent c65a7fbfa9
commit 458aeb10e9

7
ggml.c
View file

@ -11656,7 +11656,14 @@ 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");
}
#else
#define ggml_lock_lock(x) UNUSED(x)
#endif
#define ggml_lock_unlock(x) UNUSED(x)
#define GGML_LOCK_INITIALIZER 0