Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Documentation changes for wait_parity/try_wait_parity #190

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wmaxey
Copy link
Member

@wmaxey wmaxey commented Jul 29, 2021

No description provided.

@wmaxey wmaxey requested review from griwes and ogiroux July 29, 2021 18:24
__global__ void example_kernel(cuda::barrier<cuda::thread_scope_block>& bar) {
bar.wait_parity(false);
}
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to have an example that shows how to use these APIs to accomplish something minimally useful.

It might not be clear to the user what these APIs are for, what the parity of the barrier is initially, how to get the parity of a phase, etc.

__host__ __device__ bool cuda::std::barrier::try_wait_parity(bool phase);
```

`barrier::wait_parity` stalls execution while the barrier is not at the specified parity.
Copy link
Collaborator

@gonzalobg gonzalobg Mar 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

atomic::wait(value) "waits until the value is no longer value".

Here, wait_parity(value) "waits until the value becomes value" which is the opposite.

Is this intended? Seems subtly different.

@wmaxey ? @ogiroux ?

Copy link
Contributor

@davedsth davedsth Mar 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should swap it to match atomic wait. Also make sense as we are waiting for phase to change

@jrhemstad
Copy link
Collaborator

@wmaxey is this still relevant? Are these APIs still around?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants