NVIDIA / NVIDIA/cccl

Support `cuda::std::barrier<thread_scope_system>` on IPC

Open
#986 0 comments 0 reactions 1 assignee Claimed by @gonzalobg View on GitHub
libcu++
Dominant language
C++
Stars
2.5k
Forks
487
Avg merge
2d 7h
Merged PRs (30d)
296

Description

Supporting `cuda::std::barrier` on IPC would allow applications synchronizing threads across multiple processes / programs to re-use this barrier.

Interaction of threads from multiple programs is out-of-scope of C++, so this would be a `libcu++` extension.

To implement this extension we'd need to:

- [ ] add `volatile` overloads of `cuda::std::barrier` member functions, these have to call the `volatile` overload of the `atomic`s.
- [ ] document the guarantee that when this barrier is used on IPC, threads from multiple programs can synchronize with it when the barrier is `volatile`
- Proposed wording: "“We guarantee that `volatile cuda::std::barrier` can be used to synchronize threads of different programs.” We can add a footnote stating that "While the definition of "program" is not available, what this guarantee allows is to put this barrier on inter-process shared memory and synchronize threads from multiple processes." or something like that.

Unresolved questions:

- [ ] Does it make sense to add `volatile` overloads to `barrier` where `Scope != thread_scope_system` ?
- I can't think of any application of doing this, but if this were to simplify the implementation, I also can't think of many reasons not to do it beyond producing a compiler error when someone tries to do this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.