Skip to content

Commit 0c4bc54

Browse files
authored
use atomic add in SRD algorithm (#4754)
## Summary ## Additional background ## Checklist The proposed changes: - [X] fix a bug or incorrect behavior in AMReX - [ ] add new capabilities to AMReX - [ ] changes answers in the test suite to more than roundoff level - [ ] are likely to significantly affect the results of downstream AMReX users - [ ] include documentation in the code and/or rst files, if appropriate
1 parent 5686ee3 commit 0c4bc54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Src/EB/AMReX_EB_StateRedistribute.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ MLStateRedistribute ( Box const& bx, int ncomp,
177177
//
178178
// Update U_out(i,j,k) with qt(i,j,k,0)
179179
//
180-
U_out(i,j,k,n) += alpha(i,j,k,0) * qt(i,j,k,0);
180+
amrex::HostDevice::Atomic::Add(&U_out(i,j,k,n), alpha(i,j,k,0) * qt(i,j,k,0));
181181
}
182182

183183
} else {
@@ -317,7 +317,7 @@ MLStateRedistribute ( Box const& bx, int ncomp,
317317
// Update U_out(r,s,t) with qt(i,j,k,r_nbor)
318318
//
319319
if (bx.contains(IntVect(AMREX_D_DECL(r,s,t)))) {
320-
amrex::Gpu::Atomic::Add(&U_out(r,s,t,n),fac*update/nrs(r,s,t));
320+
amrex::HostDevice::Atomic::Add(&U_out(r,s,t,n),fac*update/nrs(r,s,t));
321321
}
322322

323323
if (as_crse) {

0 commit comments

Comments
 (0)