From 8b455ff9c46aa8d8a378d8c262eea8edcdf10e3f Mon Sep 17 00:00:00 2001 From: Dave Grote Date: Fri, 9 Aug 2019 16:37:29 -0700 Subject: Fix charge deposition for GPU --- Source/Particles/WarpXParticleContainer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Source/Particles/WarpXParticleContainer.cpp') diff --git a/Source/Particles/WarpXParticleContainer.cpp b/Source/Particles/WarpXParticleContainer.cpp index c4e670bf8..aa74f9c4a 100644 --- a/Source/Particles/WarpXParticleContainer.cpp +++ b/Source/Particles/WarpXParticleContainer.cpp @@ -587,7 +587,8 @@ WarpXParticleContainer::DepositCharge (WarpXParIter& pti, RealVector& wp, #ifdef AMREX_USE_GPU // No tiling on GPU: rho_arr points to the full rho array. - Array4 const& rho_arr = rho->array(pti); + MultiFab rhoi(*rho, amrex::make_alias, icomp, 1); + Array4 const& rho_arr = rhoi.array(pti); #else // Tiling is on: rho_arr points to local_rho[thread_num] const Box tb = amrex::convert(tilebox, IntVect::TheUnitVector()); -- cgit v1.2.3