Make DeviceContext into a proper class
[alexxy/gromacs.git] / src / gromacs / mdtypes / state_propagator_data_gpu.h
index d75cd78ea1e2b742d559580b7d92ccfe5144a019..034e7eb604d1e0c6348b8dd8a45c015b30527315 100644 (file)
@@ -59,6 +59,7 @@
 
 #include "locality.h"
 
+class DeviceContext;
 class GpuEventSynchronizer;
 struct gmx_wallcycle;
 
@@ -100,8 +101,6 @@ public:
      *
      * \todo Make a \p CommandStream visible in the CPU parts of the code so we
      *       will not have to pass a void*.
-     * \todo Make a \p DeviceContext object visible in CPU parts of the code so we
-     *       will not have to pass a void*.
      *
      *  \param[in] pmeStream       Device PME stream, nullptr allowed.
      *  \param[in] localStream     Device NBNXM local stream, nullptr allowed.
@@ -111,13 +110,13 @@ public:
      *  \param[in] paddingSize     Padding size for coordinates buffer.
      *  \param[in] wcycle          Wall cycle counter data.
      */
-    StatePropagatorDataGpu(const void*        pmeStream,
-                           const void*        localStream,
-                           const void*        nonLocalStream,
-                           const void*        deviceContext,
-                           GpuApiCallBehavior transferKind,
-                           int                paddingSize,
-                           gmx_wallcycle*     wcycle);
+    StatePropagatorDataGpu(const void*          pmeStream,
+                           const void*          localStream,
+                           const void*          nonLocalStream,
+                           const DeviceContext& deviceContext,
+                           GpuApiCallBehavior   transferKind,
+                           int                  paddingSize,
+                           gmx_wallcycle*       wcycle);
 
     /*! \brief Constructor to use in PME-only rank and in tests.
      *
@@ -135,11 +134,11 @@ public:
      *  \param[in] paddingSize     Padding size for coordinates buffer.
      *  \param[in] wcycle          Wall cycle counter data.
      */
-    StatePropagatorDataGpu(const void*        pmeStream,
-                           const void*        deviceContext,
-                           GpuApiCallBehavior transferKind,
-                           int                paddingSize,
-                           gmx_wallcycle*     wcycle);
+    StatePropagatorDataGpu(const void*          pmeStream,
+                           const DeviceContext& deviceContext,
+                           GpuApiCallBehavior   transferKind,
+                           int                  paddingSize,
+                           gmx_wallcycle*       wcycle);
 
     //! Move constructor
     StatePropagatorDataGpu(StatePropagatorDataGpu&& other) noexcept;