aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSami Farin <3876865+Safari77@users.noreply.github.com>2023-05-09 15:29:20 +0300
committerGitHub <noreply@github.com>2023-05-09 14:29:20 +0200
commit9f8dbc4787f32cd9c13b5c647d497d13c1a06db2 (patch)
tree9d7bf7ba72fbe00f52b487256c79c5f163251031
parent41654efea879bbdf4fd794e13335929d4cf0eb90 (diff)
use pause asm insn in busyloop to run the CPU (13600K) 10 °C cooler (#1314)
* use pause asm insn in busyloop to run the CPU (13600K) 10 °C cooler Tested with a 13B model. * use _mm_pause() in busyloop * use _mm_pause() in busyloop on x86_64 to reduce power consumption
-rw-r--r--ggml.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ggml.c b/ggml.c
index 1b89bdd..4e309df 100644
--- a/ggml.c
+++ b/ggml.c
@@ -11663,7 +11663,11 @@ typedef int ggml_lock_t;
#define ggml_lock_init(x) UNUSED(x)
#define ggml_lock_destroy(x) UNUSED(x)
+#if defined(__x86_64__) || (defined(_MSC_VER) && defined(_M_AMD64))
+#define ggml_lock_lock(x) _mm_pause()
+#else
#define ggml_lock_lock(x) UNUSED(x)
+#endif
#define ggml_lock_unlock(x) UNUSED(x)
#define GGML_LOCK_INITIALIZER 0