diff --git a/Src/Base/AMReX_MultiFabUtil.H b/Src/Base/AMReX_MultiFabUtil.H index 0740069c683..8c14adb24f1 100644 --- a/Src/Base/AMReX_MultiFabUtil.H +++ b/Src/Base/AMReX_MultiFabUtil.H @@ -334,7 +334,7 @@ namespace amrex * Return a HostVector that contains the sum of the given MultiFab data in the plane * with the given normal direction. The size of the vector is * domain.length(direction) x ncomp. The vector is actually a 2D array, where the - * element for component icomp at spatial index k is at [icomp*ncomp+k]. + * element for component icomp at spatial index k is at [icomp+ncomp*k]. * * \param mf MultiFab data for summing * \param icomp starting component diff --git a/Src/Base/AMReX_MultiFabUtil.cpp b/Src/Base/AMReX_MultiFabUtil.cpp index 98e14650c36..1e04a16693d 100644 --- a/Src/Base/AMReX_MultiFabUtil.cpp +++ b/Src/Base/AMReX_MultiFabUtil.cpp @@ -822,7 +822,7 @@ namespace amrex #ifdef AMREX_USE_GPU if (Gpu::inLaunchRegion()) { - Gpu::DeviceVector dv(domain.length(direction), Real(0.0)); + Gpu::DeviceVector dv(hv.size(), Real(0.0)); Real* p = dv.data(); for (MFIter mfi(mf); mfi.isValid(); ++mfi) {