diff options
author | 2019-04-16 18:11:19 -0700 | |
---|---|---|
committer | 2019-04-16 18:11:19 -0700 | |
commit | 6a5d24349be3496500520573017129e3e4eb6179 (patch) | |
tree | 9ac53229028282e76cdba1aa39ec75ba0c5ee787 /Source/Filter/BilinearFilter.cpp | |
parent | f11745ce48d8189e68ac8343aa279b17eaf4248f (diff) | |
parent | 046be9226fa55982cfceb74f49d94d7dd979c5aa (diff) | |
download | WarpX-6a5d24349be3496500520573017129e3e4eb6179.tar.gz WarpX-6a5d24349be3496500520573017129e3e4eb6179.tar.zst WarpX-6a5d24349be3496500520573017129e3e4eb6179.zip |
Merge pull request #89 from ECP-WarpX/gpu-filter-fix
fix memory error
Diffstat (limited to 'Source/Filter/BilinearFilter.cpp')
-rw-r--r-- | Source/Filter/BilinearFilter.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/Filter/BilinearFilter.cpp b/Source/Filter/BilinearFilter.cpp index 524e9e1b6..4017d3f73 100644 --- a/Source/Filter/BilinearFilter.cpp +++ b/Source/Filter/BilinearFilter.cpp @@ -86,9 +86,9 @@ BilinearFilter::ApplyStencil (MultiFab& dstmf, const MultiFab& srcmf, int scomp, const Box& tbx = mfi.growntilebox(); const Box& gbx = amrex::grow(tbx,stencil_length_each_dir-1); // tmpfab has enough ghost cells for the stencil - tmpfab.resize(gbx,ncomp); - FArrayBox* tmpfab_ptr = &tmpfab; - const FArrayBox* srcfab_ptr = &srcfab; + AsyncFab tmp_async_fab(tmpfab,gbx,ncomp); + FArrayBox* tmpfab_ptr = tmp_async_fab.fabPtr(); + const FArrayBox* srcfab_ptr = srcmf.fabPtr(mfi); // Copy values in srcfab into tmpfab const Box& ibx = gbx & srcfab.box(); AMREX_LAUNCH_HOST_DEVICE_LAMBDA(gbx, tgbx, @@ -102,9 +102,7 @@ BilinearFilter::ApplyStencil (MultiFab& dstmf, const MultiFab& srcmf, int scomp, }); // Apply filter - Filter(tbx, tmpfab, dstfab, 0, dcomp, ncomp); - - Gpu::Device::streamSynchronize(); // needed because of the resize above + Filter(tbx, tmp_async_fab.hostFab(), dstfab, 0, dcomp, ncomp); } } } |