File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,10 @@ typedef enum {
88
88
static void atomic_store(atomic_int * ptr, LONG val) {
89
89
InterlockedExchange(ptr, val);
90
90
}
91
+ static void atomic_store_explicit(atomic_int * ptr, LONG val, memory_order mo) {
92
+ // TODO: add support for explicit memory order
93
+ InterlockedExchange(ptr, val);
94
+ }
91
95
static LONG atomic_load(atomic_int * ptr) {
92
96
return InterlockedCompareExchange(ptr, 0, 0);
93
97
}
@@ -12472,7 +12476,7 @@ UseGgmlGemm1:;
12472
12476
12473
12477
if (ith == 0) {
12474
12478
// Every thread starts at ith, so the first unprocessed chunk is nth. This save a bit of coordination right at the start.
12475
- atomic_store (¶ms->threadpool->current_chunk, nth);
12479
+ atomic_store_explicit (¶ms->threadpool->current_chunk, nth, memory_order_relaxed );
12476
12480
}
12477
12481
12478
12482
ggml_barrier(params->threadpool);
@@ -12583,7 +12587,7 @@ UseGgmlGemm2:;
12583
12587
break;
12584
12588
}
12585
12589
12586
- current_chunk = atomic_fetch_add (¶ms->threadpool->current_chunk, 1);
12590
+ current_chunk = atomic_fetch_add_explicit (¶ms->threadpool->current_chunk, 1, memory_order_relaxed );
12587
12591
}
12588
12592
}
12589
12593
You can’t perform that action at this time.
0 commit comments