use __threadfence_system explicitly (not in ggml_cuda_ar_signal_set)

This commit is contained in:
Scott Cutler
2026-04-22 22:22:35 -07:00
parent 372d40830d
commit 5028250b52
+2 -2
View File
@@ -30,9 +30,7 @@
// ---------------------------------------------------------------------------
static __device__ __forceinline__ void ggml_cuda_ar_signal_set(int * p) {
__threadfence_system(); // ensure all prior writes (D2H data) are globally visible
*(volatile int *)p = 1;
__threadfence_system(); // ensure the signal itself is globally visible
}
static __device__ __forceinline__ int ggml_cuda_ar_signal_get(const int * p) {
return *(const volatile int *)p;
@@ -130,6 +128,8 @@ static __global__ void ggml_cuda_ar_f32_kernel(
if (tid == 0) {
ggml_cuda_ar_signal_set(arrival_mine);
__threadfence_system(); // ensure the signal itself is visible across all GPUs
#if GGML_CUDA_AR_WATCHDOG
int writeback = ggml_cuda_ar_signal_get(arrival_mine);
int spin = 0;