Skip to content

Commit

Permalink
fix cpu code
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Feb 9, 2024
1 parent 195d6af commit 08a6670
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Source/reactions/Castro_react.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Castro::react_state(MultiFab& s, MultiFab& r, Real time, Real dt, const int stra
int num_failed = 0;

#ifdef _OPENMP
#pragma omp parallel reduction(+:num_failed);
#pragma omp parallel reduction(+:num_failed)
#endif
for (MFIter mfi(s, TilingIfNotGPU()); mfi.isValid(); ++mfi)
{
Expand All @@ -210,7 +210,11 @@ Castro::react_state(MultiFab& s, MultiFab& r, Real time, Real dt, const int stra
const auto problo = geom.ProbLoArray();
#endif

#if defined(AMREX_USE_GPU)
ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k)
#else
LoopOnCpu(bx, [&] (int i, int j, int k) mutable
#endif
{

burn_t burn_state;
Expand Down Expand Up @@ -549,7 +553,11 @@ Castro::react_state(Real time, Real dt)
const auto dx = geom.CellSizeArray();
const auto problo = geom.ProbLoArray();

#if defined(AMREX_USE_GPU)
ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k)
#else
LoopOnCpu(bx, [&] (int i, int j, int k) mutable
#endif
{
burn_t burn_state;

Expand Down

0 comments on commit 08a6670

Please sign in to comment.