Skip to content

Commit

Permalink
Work around a nvcc bug
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Oct 13, 2024
1 parent 3bbf233 commit 89d45c5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Src/EB/AMReX_algoim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,16 @@ compute_integrals (MultiFab& intgmf, IntVect nghost)

if (Gpu::inLaunchRegion())
{
#if defined(AMREX_USE_CUDA)
// It appears that there is a nvcc bug. We have to use the
// 4D ParallelFor here, even though ncomp is 1.
int ncomp = fg.nComp();
amrex::ParallelFor(bx, ncomp,
[=] AMREX_GPU_DEVICE (int i, int j, int k, int) noexcept
#else
amrex::ParallelFor(bx,
[=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
#endif
{
const auto ebflag = fg(i,j,k);
if (ebflag.isRegular()) {
Expand Down

0 comments on commit 89d45c5

Please sign in to comment.