Fix free_gpu
[alexxy/gromacs.git] / src / gromacs / gpu_utils / gpu_utils.h
index b1cc07b51f9b656dcd9d46f6575537638ae33d93..a3254bd467cdc9cf9226459d570cc326ec333ef1 100644 (file)
@@ -125,8 +125,12 @@ void init_gpu(const gmx::MDLogger &GPU_FUNC_ARGUMENT(mdlog),
 
 /*! \brief Frees up the CUDA GPU used by the active context at the time of calling.
  *
- * The context is explicitly destroyed and therefore all data uploaded to the GPU
- * is lost. This should only be called when none of this data is required anymore.
+ * If \c deviceInfo is nullptr, then it is understood that no device
+ * was selected so no context is active to be freed. Otherwise, the
+ * context is explicitly destroyed and therefore all data uploaded to
+ * the GPU is lost. This must only be called when none of this data is
+ * required anymore, because subsequent attempts to free memory
+ * associated with the context will otherwise fail.
  *
  * Calls gmx_warning upon errors.
  *