Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cuda::barrier::try_wait* should be const #280

Open
ahendriksen opened this issue Jul 27, 2023 · 1 comment
Open

cuda::barrier::try_wait* should be const #280

ahendriksen opened this issue Jul 27, 2023 · 1 comment
Assignees
Labels
needs triage Issues that require the team's attention

Comments

@ahendriksen
Copy link
Contributor

From https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2643r1.html:

template <class CF>
bool barrier<CF>::try_wait(arrival_token& tok) const; // <-- const
template <class CF, class Rep, class Period>
bool barrier<CF>::try_wait_for(arrival_token& tok, duration<Rep, Period> const& rel_time) const; // <-- const
template <class CF, class Clock, class Duration>
bool barrier<CF>::try_wait_until(arrival_token& tok, time_point<Clock, Duration> const& abs_time) const; // <-- const

// Available since C++20
// bool latch::try_wait() const noexcept;
template <class Rep, class Period>
bool latch::try_wait_for(duration<Rep, Period> const& rel_time) const;
template <class Clock, class Duration>
bool latch::try_wait_until(time_point<Clock, Duration> const& abs_time) const;

The current implementation of these functions is not const: https://github.com/NVIDIA/libcudacxx/blob/a57dbed580e49b14ac1ad7f98496176407208aa4/include/cuda/std/detail/libcxx/include/__cuda/barrier.h#L528

The functions should also take the arrival token by reference (instead of moving). I filed PR NVIDIA/libcudacxx#499 for that.

@miscco miscco transferred this issue from NVIDIA/libcudacxx Jul 27, 2023
@github-actions github-actions bot added the needs triage Issues that require the team's attention label Jul 27, 2023
@github-actions
Copy link
Contributor

Hi @ahendriksen!

Thanks for submitting this issue - the CCCL team has been notified and we'll get back to you as soon as we can!
In the mean time, feel free to add any relevant information to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issues that require the team's attention
Projects
Status: Todo
Development

No branches or pull requests

2 participants