-
Notifications
You must be signed in to change notification settings - Fork 187
Conversation
I'm going to add a Discussion from internal developer day pointed out that you can get a good benefit from hiding the latency of the load and/or control the polling backoff yourself. It's already in here, might as well make it usable. |
@ogiroux Does this require any additional tests you would like to see? I was going to permute a few things, but this would be a good opportunity for any edge cases you can think of. |
Latest clean virtual: https://builds4u.nvidia.com/dvs/#/change/3023208755719989.5?eventType=Virtual |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except for the phrasing in the documentation.
| [`cuda::device::barrier_native_handle`] | Get the native handle to a `cuda::barrier`. `(function template)` | | ||
| [`cuda::barrier::init`] | Initialize a `cuda::barrier`. `(friend function)` | | ||
| [`cuda::device::barrier_native_handle`] | Get the native handle to a `cuda::barrier`. `(function template)` | | ||
| [`cuda::barrier::wait_parity/try_wait_parity`] | Wait on a `specific` phase of the barrier | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this phrasing. @ogiroux how would you feel about "Wait on a phase whose parity matches the argument." or some such?
`barrier::wait_parity` stalls execution while the barrier is not at the specified phase. | ||
`barrier::try_wait_parity` queries the the state of the barrier against the specified phase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the previous comment. It's really weird that the description here doesn't mention parity at all.
In the interest of time, I'm going to split the documentation changes into another PR and merge the changes. |
…r for some reason
Overview
Add APIs to
cuda::barrier
that allow for waiting on the parity of the barrier. This is an extension tostd::barrier
that relies on the internal binary phase of the barrier.Motivation
Requirements
barrier::try_wait_parity
barrier::wait_parity
barrier::wait_parity
Design
wait_parity
APIs similarly towait
andtry_wait
.wait_parity
is implemented by pollingtry_wait_parity
with back-off.try_wait_parity
queries the parity of the barrier with a parity provided by the user.Test Plan
wait_parity
which also provides coverage fortry_wait_parity
.Performance Tests
Documentation
Complex Internal Systems
std::barrier
is able to queried to obtain the parity of the barrier.Stakeholders