Updates to Notifier

Bu işleme şunda yer alıyor:
Brandon Potter committed 2024-09-10 07:10:21 -07:00
1 ebeveyn 039ea82777
işleme 51c33b2a66
4 files changed
+14 -14

No files matched your search

+3 -7
Dosyayı Görüntüle
@@ -40,15 +40,11 @@ class Notifier {
detail::atomic::store<uint64_t, scope>(&value_, val, orders);
}
__device__ void done() { __syncthreads(); }
__device__ void fence() {
detail::atomic::thread_fence<scope>();
}
private:
__device__ void publish() {
if (is_thread_zero_in_block()) {
__threadfence();
}
__syncthreads();
}
detail::atomic::rocshmem_memory_orders orders;
+5 -2
Dosyayı Görüntüle
@@ -75,9 +75,12 @@ __device__ void SlabHeap::malloc(void** ptr, size_t size) {
* Notify other threads in block about the allocation result.
*/
auto notifier{notifier_.get()};
notifier->store(ptr_deref_u64);
if (!threadIdx.x) {
notifier->store(ptr_deref_u64);
notifier->fence();
}
__syncthreads();
uint64_t notification_u64{notifier->load()};
notifier->done();
/*
* Write to the ptr parameter (to return it back up the call stack).