Spaces:
Running
Running
Max Krasnyansky
commited on
Commit
·
97b3eb5
1
Parent(s):
6201c74
threads: fix msvc build without openmp (llama/9615)
Browse filesWe're missing atomic_thread_fence() in MSVC builds when openmp is disabled.
- ggml/src/ggml.c +3 -0
ggml/src/ggml.c
CHANGED
|
@@ -135,6 +135,9 @@ static atomic_bool atomic_flag_test_and_set(atomic_flag * ptr) {
|
|
| 135 |
static void atomic_flag_clear(atomic_flag * ptr) {
|
| 136 |
InterlockedExchange(ptr, 0);
|
| 137 |
}
|
|
|
|
|
|
|
|
|
|
| 138 |
#else // clang
|
| 139 |
#include <stdatomic.h>
|
| 140 |
#endif
|
|
|
|
| 135 |
static void atomic_flag_clear(atomic_flag * ptr) {
|
| 136 |
InterlockedExchange(ptr, 0);
|
| 137 |
}
|
| 138 |
+
static void atomic_thread_fence(memory_order mo) {
|
| 139 |
+
MemoryBarrier();
|
| 140 |
+
}
|
| 141 |
#else // clang
|
| 142 |
#include <stdatomic.h>
|
| 143 |
#endif
|