From d9fa53438fda6f5a9ce82a65183eac74d80617ad Mon Sep 17 00:00:00 2001 From: Max Krasnyansky Date: Mon, 23 Sep 2024 15:25:10 -0700 Subject: [PATCH] threads: fix msvc build without openmp We're missing atomic_thread_fence() in MSVC builds when openmp is disabled. --- ggml/src/ggml.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ggml/src/ggml.c b/ggml/src/ggml.c index 96c09ca89..d4aa0a81b 100644 --- a/ggml/src/ggml.c +++ b/ggml/src/ggml.c @@ -135,6 +135,9 @@ static atomic_bool atomic_flag_test_and_set(atomic_flag * ptr) { static void atomic_flag_clear(atomic_flag * ptr) { InterlockedExchange(ptr, 0); } +static void atomic_thread_fence(memory_order mo) { + MemoryBarrier(); +} #else // clang #include #endif