From a2c2201deccf27db319fb86835db5519689e4d1f Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Wed, 16 Oct 2024 10:44:03 -0700 Subject: [PATCH] Update Src/Base/AMReX_GpuLaunchFunctsG.H Co-authored-by: Alexander Sinn <64009254+AlexanderSinn@users.noreply.github.com> --- Src/Base/AMReX_GpuLaunchFunctsG.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Base/AMReX_GpuLaunchFunctsG.H b/Src/Base/AMReX_GpuLaunchFunctsG.H index ff1d9d2900..ddd2286cd7 100644 --- a/Src/Base/AMReX_GpuLaunchFunctsG.H +++ b/Src/Base/AMReX_GpuLaunchFunctsG.H @@ -809,7 +809,7 @@ ParallelFor (Gpu::KernelInfo const&, T n, L const& f) noexcept auto tid = T(MT)*T(blockIdx.x)+T(threadIdx.x); if (tid < nleft) { detail::call_f_scalar_handler(f, tid+ndone, - Gpu::Handler(amrex::min((std::uint64_t(nleft)-tid+(std::uint64_t)threadIdx.x), + Gpu::Handler(amrex::min((std::uint64_t(nleft-tid)+(std::uint64_t)threadIdx.x), (std::uint64_t)blockDim.x))); } });