]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
threads: fix msvc build without openmp (#9615)
authorMax Krasnyansky <redacted>
Tue, 24 Sep 2024 04:18:48 +0000 (21:18 -0700)
committerGitHub <redacted>
Tue, 24 Sep 2024 04:18:48 +0000 (21:18 -0700)
We're missing atomic_thread_fence() in MSVC builds when openmp is disabled.

ggml/src/ggml.c

index 96c09ca897ee79f3865029df18dd2d860a22f95c..d4aa0a81bfae24a465c7520a4334f8b28a7e863f 100644 (file)
@@ -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 <stdatomic.h>
 #endif