From 5978b6ebf080c24fa02f369d53412dfff44bbed9 Mon Sep 17 00:00:00 2001 From: Kunnis Date: Wed, 8 May 2024 23:02:20 -0500 Subject: [PATCH] Adding in the calls to mm_pause --- ggml.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ggml.c b/ggml.c index fc30bd839..8a5149c1b 100644 --- a/ggml.c +++ b/ggml.c @@ -19578,6 +19578,10 @@ static void ggml_graph_compute_thread_sync_node(int * node_n, struct ggml_comput * node_n = atomic_load(&state->shared->node_n); if (* node_n != last_node_n) break; +#if defined(__SSE3__) + //Tell the processor we're spinning. It's a processor hint for spinlocks. + _mm_pause(); +#endif } } @@ -19592,6 +19596,10 @@ static void ggml_graph_compute_thread_sync_task(int * task_phase, struct ggml_co * task_phase = atomic_load(&state->shared->node_task); if (* task_phase != last_task_phase) break; +#if defined(__SSE3__) + //Tell the processor we're spinning. It's a processor hint for spinlocks. + _mm_pause(); +#endif } }