Skip to content

Commit

Permalink
threads: fix msvc build without openmp
Browse files Browse the repository at this point in the history
We're missing atomic_thread_fence() in MSVC builds when openmp is disabled.
  • Loading branch information
max-krasnyansky committed Sep 23, 2024
1 parent 0b3bf96 commit d9fa534
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ggml/src/ggml.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d9fa534

Please sign in to comment.