Replace functions deprecated in OpenCL 1.2
[alexxy/gromacs.git] / src / gromacs / mdlib / nbnxn_ocl / nbnxn_ocl.cpp
index 476372e455b7cb514d6cccdb1bdd78dcd5fa9c0f..344464350d0831bd9ee4032aeed1f2c727ec2a1b 100644 (file)
@@ -325,7 +325,11 @@ void sync_ocl_event(cl_command_queue stream, cl_event *ocl_event)
     cl_int gmx_unused cl_error;
 
     /* Enqueue wait */
+#ifdef CL_VERSION_1_2
+    cl_error = clEnqueueBarrierWithWaitList(stream, 1, ocl_event, NULL);
+#else
     cl_error = clEnqueueWaitForEvents(stream, 1, ocl_event);
+#endif
 
     assert(CL_SUCCESS == cl_error);
 
@@ -453,7 +457,11 @@ void nbnxn_gpu_launch_kernel(gmx_nbnxn_ocl_t               *nb,
     {
         if (iloc == eintLocal)
         {
+#ifdef CL_VERSION_1_2
+            cl_error = clEnqueueMarkerWithWaitList(stream, 0, NULL, &(nb->misc_ops_done));
+#else
             cl_error = clEnqueueMarker(stream, &(nb->misc_ops_done));
+#endif
             assert(CL_SUCCESS == cl_error);
         }
         else
@@ -946,7 +954,11 @@ void nbnxn_gpu_launch_cpyback(gmx_nbnxn_ocl_t               *nb,
        data back first. */
     if (iloc == eintNonlocal)
     {
+#ifdef CL_VERSION_1_2
+        cl_error = clEnqueueMarkerWithWaitList(stream, 0, NULL, &(nb->nonlocal_done));
+#else
         cl_error = clEnqueueMarker(stream, &(nb->nonlocal_done));
+#endif
         assert(CL_SUCCESS == cl_error);
     }