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

atomicMax equivalent (and other atomics) #2401

Closed
ascheinb opened this issue Sep 30, 2019 · 8 comments
Closed

atomicMax equivalent (and other atomics) #2401

ascheinb opened this issue Sep 30, 2019 · 8 comments
Assignees
Labels
Enhancement Improve existing capability; will potentially require voting

Comments

@ascheinb
Copy link

Hi all, I'm trying to convert a cuda atomicMax to Kokkos. In general, I see that there are a number of cuda atomics that do not have kokkos equivalents. I think that there is a way to effectively do an atomic max with the available kokkos atomics? In general, it would be nice to have guidance/documentation for the most efficient kokkos equivalent to the various cuda atomics.

@crtrott
Copy link
Member

crtrott commented Sep 30, 2019

Which other ones are you looking for? AtomicMax and Min is certainly one we should add. Probably we should have all of the ones we also support for reducers.

@ascheinb
Copy link
Author

Those are the only ones I need, and it looks like I can use the atomic CAS to get around it. I also had to convert an atomicInc before, which I replaced with a fetch add. It works fine, I was just thinking it might be nice to have a conversion chart in the docs.

@crtrott
Copy link
Member

crtrott commented Sep 30, 2019

atomic increment should actually be there, but lets make this into a request for min and max.

@crtrott crtrott added the Enhancement Improve existing capability; will potentially require voting label Sep 30, 2019
@crtrott crtrott added this to To do in Milestone: Release 3.1 via automation Sep 30, 2019
@DavidPoliakoff
Copy link
Contributor

@crtrott, I actually think this is a good idea more generally, cheat sheets for

"I use Programming Model and am looking to switch to Kokkos, how do I translate Feature into it"

Where Feature might be Parallelism Patterns, Data Placement, Atomics... anything else?

@crtrott crtrott added this to the Tentative 3.1 Release milestone Sep 30, 2019
@janciesko janciesko self-assigned this Nov 21, 2019
@ascheinb
Copy link
Author

Hello all - Did atomic max and min ever get implemented? I was looking through https://github.com/kokkos/kokkos/wiki/Atomic-Operations and didn't see a way to construct an equivalent to atomic max from the existing listed operations.

@mhoemmen
Copy link
Contributor

mhoemmen commented Jan 14, 2020

@crtrott
Copy link
Member

crtrott commented Mar 1, 2020

@janciesko You wanna do this? Or maybe @jrmadsen ?

@dalg24
Copy link
Member

dalg24 commented Mar 4, 2020

@janciesko will look into this

@crtrott crtrott moved this from To do to Done in Milestone: Release 3.1 Mar 11, 2020
@crtrott crtrott closed this as completed Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improve existing capability; will potentially require voting
Projects
No open projects
Development

No branches or pull requests

8 participants