Update Notifier fixture to Block
This commit is contained in:
+11
-1
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user