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
}
@@ -12471,7 +12475,7 @@ UseGgmlGemm1:;
12471
12475
12472
12476
if (ith == 0) {
12473
12477
// Every thread starts at ith, so the first unprocessed chunk is nth. This save a bit of coordination right at the start.
12474
- atomic_store (¶ms->threadpool->current_chunk, nth);
12478
+ atomic_store_explicit (¶ms->threadpool->current_chunk, nth, memory_order_relaxed );
12475
12479
}
12476
12480
12477
12481
ggml_barrier(params->threadpool);
@@ -12582,7 +12586,7 @@ UseGgmlGemm2:;
12582
12586
break;
12583
12587
}
12584
12588
12585
- current_chunk = atomic_fetch_add (¶ms->threadpool->current_chunk, 1);
12589
+ current_chunk = atomic_fetch_add_explicit (¶ms->threadpool->current_chunk, 1, memory_order_relaxed );
12586
12590
}
12587
12591
}
12588
12592
You can’t perform that action at this time.
0 commit comments