Update Notifier fixture to Block

This commit is contained in:
Brandon Potter
2024-08-13 12:01:24 -07:00
parent 51c33b2a66
commit 5b42cff96c
4 changed files with 43 additions and 30 deletions
+11 -1
View File
@@ -122,7 +122,7 @@ T fetch_min(T* obj, U arg, rocshmem_memory_orders o) {
template <rocshmem_memory_scope s>
__device__
void thread_fence() {
void threadfence() {
if constexpr (s == memory_scope_system) {
__threadfence_system();
} else if constexpr (s == memory_scope_agent) {
@@ -132,6 +132,16 @@ void thread_fence() {
}
}
template <rocshmem_memory_scope s>
__device__
void sync() {
if constexpr (s == memory_scope_workgroup) {
__syncthreads();
} else {
assert(false);
}
}
} // namespace atomic
} // namespace detail
} // namespace rocshmem
+7 -3
View File
@@ -33,15 +33,19 @@ template<detail::atomic::rocshmem_memory_scope scope>
class Notifier {
public:
__device__ uint64_t load() {
return detail::atomic::load<uint64_t, scope>(&value_, orders);
return detail::atomic::load<uint64_t, scope>(&value_, orders);
}
__device__ void store(uint64_t val) {
detail::atomic::store<uint64_t, scope>(&value_, val, orders);
detail::atomic::store<uint64_t, scope>(&value_, val, orders);
}
__device__ void fence() {
detail::atomic::thread_fence<scope>();
detail::atomic::threadfence<scope>();
}
__device__ void sync() {
detail::atomic::sync<scope>();
}
private: