-
Notifications
You must be signed in to change notification settings - Fork 39
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
Prefer atomic_inc to atomic_increment #1183
Conversation
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.
Per kokkos/kokkos#7449 (comment) atomic_increment
might get deprecated in favor of atomic_inc
Oh, sorry, I misunderstood, and thought it was the other way around. |
c6f5243
to
7a78f6b
Compare
Kokkos::atomic_inc(&_counts(i)); | ||
|
||
if (_counts(i) < _n) |
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.
This looks super sketchy
Kokkos::atomic_inc(&_counts(i)); | |
if (_counts(i) < _n) | |
auto const counts_i = Kokkos::atomic_inc_fetch(&_counts(i)); | |
if (counts_i < _n) |
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.
It's not really sketchy, but you are right, it is could be suboptimal in the case of threads sharing a query (which they currently don't when running BVH). I'll fix it.
Co-authored-by: Damien L-G <dalg24+github@gmail.com>
281c732
to
e9286b0
Compare
No description provided.