Skip to content

Commit 02285df

Browse files
max-krasnyanskyggerganov
authored andcommitted
threads: fix msvc build without openmp (llama/9615)
We're missing atomic_thread_fence() in MSVC builds when openmp is disabled.
1 parent 2fc1d20 commit 02285df

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ggml/src/ggml.c

+3
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ static atomic_bool atomic_flag_test_and_set(atomic_flag * ptr) {
135135
static void atomic_flag_clear(atomic_flag * ptr) {
136136
InterlockedExchange(ptr, 0);
137137
}
138+
static void atomic_thread_fence(memory_order mo) {
139+
MemoryBarrier();
140+
}
138141
#else // clang
139142
#include <stdatomic.h>
140143
#endif

0 commit comments

Comments
 (0)