From: Max Krasnyansky Date: Tue, 24 Sep 2024 04:18:48 +0000 (-0700) Subject: threads: fix msvc build without openmp (llama/9615) X-Git-Tag: upstream/0.0.1642~343 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=fbcdca5c87eb6657d28938ee960cf6f7d6491318;p=pkg%2Fggml%2Fsources%2Fggml threads: fix msvc build without openmp (llama/9615) We're missing atomic_thread_fence() in MSVC builds when openmp is disabled. --- diff --git a/src/ggml.c b/src/ggml.c index 4c55d801..4b782b0c 100644 --- a/src/ggml.c +++ b/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