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

Remove Atomic::Inc and Dec #3117

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

WeiqunZhang
Copy link
Member

The implementation for Atomic::Inc and Dec in our SYCL backend use compare and exchange, because they do not exist in SYCL standard. This turns out to be very inefficient. Although both CUDA and HIP have efficient implementation of atomicInc and atomicDec, we are removing Atomic::Inc and Dec from amrex to avoid surprises. In all cases that we have used these functions, they can be replaced with Atomic::Add.

@WeiqunZhang
Copy link
Member Author

Do not merge this until the next release.

The implementation for Atomic::Inc and Dec in our SYCL backend use compare
and exchange, because they do not exist in SYCL standard.  This turns out to
be very inefficient.  Although both CUDA and HIP have efficient
implementation of atomicInc and atomicDec, we are removing Atomic::Inc and
Dec from amrex to avoid surprises.  In all cases that we have used these
functions, they can be replaced with Atomic::Add.
@WeiqunZhang WeiqunZhang merged commit c09ed7d into AMReX-Codes:development Feb 1, 2023
@WeiqunZhang WeiqunZhang deleted the atomicinc branch February 1, 2023 21:05
guj pushed a commit to guj/amrex that referenced this pull request Jul 13, 2023
The implementation for Atomic::Inc and Dec in our SYCL backend use
compare and exchange, because they do not exist in SYCL standard. This
turns out to be very inefficient. Although both CUDA and HIP have
efficient implementation of atomicInc and atomicDec, we are removing
Atomic::Inc and Dec from amrex to avoid surprises. In all cases that we
have used these functions, they can be replaced with Atomic::Add.
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.

2 participants