aboutsummaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/Filter/BilinearFilter.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/Filter/BilinearFilter.cpp b/Source/Filter/BilinearFilter.cpp
index 524e9e1b6..868d6d384 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 = dstmf.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);
}
}
}