Adding in the calls to mm_pause

This commit is contained in:
Kunnis 2024-05-08 23:02:20 -05:00
parent 3024fd6b26
commit 5978b6ebf0

8
ggml.c
View file

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