From 26c8d3d98f478075f35da08e7cd722899c18cec2 Mon Sep 17 00:00:00 2001
From: Stan Moore <stanmoore1@gmail.com>
Date: Wed, 25 Jan 2017 12:53:55 -0700
Subject: [PATCH] Fixing GPU memory issue in fix_langevin_kokkos

---
 src/KOKKOS/fix_langevin_kokkos.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/KOKKOS/fix_langevin_kokkos.cpp b/src/KOKKOS/fix_langevin_kokkos.cpp
index b51c934c3e..0572dcedbe 100644
--- a/src/KOKKOS/fix_langevin_kokkos.cpp
+++ b/src/KOKKOS/fix_langevin_kokkos.cpp
@@ -177,11 +177,12 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
 
   // account for bias velocity
   if(tbiasflag == BIAS){
+    atomKK->sync(temperature->execution_space,temperature->datamask_read);
     temperature->compute_scalar();
     temperature->remove_bias_all(); // modifies velocities
     // if temeprature compute is kokkosized host-devcie comm won't be needed
-    atomKK->modified(Host,V_MASK);
-    atomKK->sync(execution_space,V_MASK);
+    atomKK->modified(temperature->execution_space,temperature->datamask_modify);
+    atomKK->sync(execution_space,temperature->datamask_modify);
   }
 
   // compute langevin force in parallel on the device
@@ -508,8 +509,10 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
   DeviceType::fence();
 
   if(tbiasflag == BIAS){
+    atomKK->sync(temperature->execution_space,temperature->datamask_read);
     temperature->restore_bias_all(); // modifies velocities
-    atomKK->modified(Host,V_MASK);
+    atomKK->modified(temperature->execution_space,temperature->datamask_modify);
+    atomKK->sync(execution_space,temperature->datamask_modify);
   }
 
   // set modify flags for the views modified in post_force functor
-- 
GitLab