Make DeviceStream into a class
[alexxy/gromacs.git] / src / gromacs / gpu_utils / gpueventsynchronizer_ocl.h
index b9298f385fcc82ad5173927a8585d23e521660e6..9a62b5b6d47efdab66a56cdfa91377d93ae58501 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2018,2019, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -85,10 +85,10 @@ public:
     /*! \brief Marks the synchronization point in the \p stream.
      * Should be called first and then followed by waitForEvent().
      */
-    inline void markEvent(CommandStream stream)
+    inline void markEvent(const DeviceStream& deviceStream)
     {
         GMX_ASSERT(nullptr == event_, "Do not call markEvent more than once!");
-        cl_int clError = clEnqueueMarkerWithWaitList(stream, 0, nullptr, &event_);
+        cl_int clError = clEnqueueMarkerWithWaitList(deviceStream.stream(), 0, nullptr, &event_);
         if (CL_SUCCESS != clError)
         {
             GMX_THROW(gmx::InternalError("Failed to enqueue the GPU synchronization event: "
@@ -112,9 +112,9 @@ public:
      *  After enqueue, the associated event is released, so this method should
      *  be only called once per markEvent() call.
      */
-    inline void enqueueWaitEvent(CommandStream stream)
+    inline void enqueueWaitEvent(const DeviceStream& deviceStream)
     {
-        cl_int clError = clEnqueueBarrierWithWaitList(stream, 1, &event_, nullptr);
+        cl_int clError = clEnqueueBarrierWithWaitList(deviceStream.stream(), 1, &event_, nullptr);
         if (CL_SUCCESS != clError)
         {
             GMX_THROW(gmx::InternalError("Failed to enqueue device barrier for the GPU event: "