aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceSolver.H
diff options
context:
space:
mode:
authorGravatar Axel Huebl <axel.huebl@plasma.ninja> 2021-06-16 17:48:06 -0700
committerGravatar GitHub <noreply@github.com> 2021-06-16 17:48:06 -0700
commit495d0520b4020a3c59df9b372f02d989a7180b31 (patch)
treecf18944a2f27ed2b4be0407ef1b9eba9c77d8e1d /Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceSolver.H
parentf1a0d49cc0ff8ac15cb128a09d8c3256eb259eb3 (diff)
downloadWarpX-495d0520b4020a3c59df9b372f02d989a7180b31.tar.gz
WarpX-495d0520b4020a3c59df9b372f02d989a7180b31.tar.zst
WarpX-495d0520b4020a3c59df9b372f02d989a7180b31.zip
Silver-Mueller: Avoid Managed Memory (#2019)
Avoid relying on managed memory usage in Silver-Mueller boundary conditions. Previously, we initialized the coefficients on the host, copied them to device and then accidentially used the device memory on the host again, as we calculated some constants. This now keeps the initial host-memory around so we can use it for host-only operations.
Diffstat (limited to 'Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceSolver.H')
-rw-r--r--Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceSolver.H6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceSolver.H b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceSolver.H
index 92812d4e0..5346604d4 100644
--- a/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceSolver.H
+++ b/Source/FieldSolver/FiniteDifferenceSolver/FiniteDifferenceSolver.H
@@ -110,9 +110,15 @@ class FiniteDifferenceSolver
#ifdef WARPX_DIM_RZ
amrex::Real m_dr, m_rmin;
int m_nmodes;
+ // host-only
+ amrex::Vector<amrex::Real> m_h_stencil_coefs_r, m_h_stencil_coefs_z;
+ // device copy after init
amrex::Gpu::DeviceVector<amrex::Real> m_stencil_coefs_r;
amrex::Gpu::DeviceVector<amrex::Real> m_stencil_coefs_z;
#else
+ // host-only
+ amrex::Vector<amrex::Real> m_h_stencil_coefs_x, m_h_stencil_coefs_y, m_h_stencil_coefs_z;
+ // device copy after init
amrex::Gpu::DeviceVector<amrex::Real> m_stencil_coefs_x;
amrex::Gpu::DeviceVector<amrex::Real> m_stencil_coefs_y;
amrex::Gpu::DeviceVector<amrex::Real> m_stencil_coefs_z;