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