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

atomic_fetch_add: explicit casts needed for '1' increments #159

Merged
merged 1 commit into from
Feb 28, 2018

Conversation

ndellingwood
Copy link
Contributor

Required when compiling with serial-only backed to avoid compilation
errors due to unmatched types.

decltype used to determine the type based on the input to
atomic_fetch_add; std::remove_reference needed because expressions may
return a reference type.

Required when compiling with serial-only backed to avoid compilation
errors due to unmatched types.

decltype used to determine the type based on the input to
atomic_fetch_add; std::remove_reference needed because expressions may
return a reference type.
@ndellingwood ndellingwood requested a review from mndevec February 28, 2018 22:44
@mndevec
Copy link
Contributor

mndevec commented Feb 28, 2018

@ndellingwood
I though this was going to be fixed in kokkos side. Has that decision changed?

@ndellingwood
Copy link
Contributor Author

@mndevec the explicit casting for '1's in atomic_fetch_add is necessary after all following modification to the serial implementation for atomics in Kokkos.

I used decltype in this PR to get the type to remove possible errors in guesswork of what the type should be.

The functionality of this PR needed for the kokkos and kokkos-kernels promotion.

@ndellingwood
Copy link
Contributor Author

@mndevec I had thought this was going to be changed in kokkos also, but seems not after all. The performance fixes are in the kokkos develop branch for serial atomics though.

@ndellingwood
Copy link
Contributor Author

@mndevec I tested this PR locally with the Serial-only backend enabled, unit tests build and pass.

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

Successfully merging this pull request may close these issues.

3 participants