Skip to content

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

Open

Description

@ahendriksen

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.

Activity

  1. transferred this issue fromNVIDIA/libcudacxxon Jul 27, 2023
  2. added
    needs triage
    on Jul 27, 2023
  3. github-actions commented on Jul 27, 2023

    @github-actions
    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

Metadata

Metadata

Assignees

Labels

needs triage

Type

No type

Projects

  • Status
    Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions