Clear device force buffer if it was reallocated
[alexxy/gromacs.git] / src / gromacs / mdtypes / state_propagator_data_gpu_impl.h
index 70365ac62eba349060f56b5f89c8970cec324f5b..af073b6284dde35d568465192004b375be8b2dd0 100644 (file)
@@ -137,6 +137,8 @@ public:
 
 
     /*! \brief Set the ranges for local and non-local atoms and reallocates buffers.
+     *
+     * Reallocates coordinate, velocities and force buffers on the device.
      *
      * \note
      * The coordinates buffer is (re)allocated, when required by PME, with a padding,
@@ -144,6 +146,10 @@ public:
      * is scheduled in the \p pmeStream_ (unlike the coordinates H2D) as only the PME
      * task uses this padding area.
      *
+     * \note
+     * The force buffer is cleared if its size increases, so that previously unused
+     * memory is cleared before forces are accumulated.
+     *
      *  \param[in] numAtomsLocal  Number of atoms in local domain.
      *  \param[in] numAtomsAll    Total number of atoms to handle.
      */