diff --git a/src/wrap_cl.hpp b/src/wrap_cl.hpp
index 98964056f9def5a86286065b584b6235ea3cca53..9de1c2cda96587132255caf9e36a0fd3136f4596 100644
--- a/src/wrap_cl.hpp
+++ b/src/wrap_cl.hpp
@@ -496,6 +496,19 @@ namespace pyopencl
   // }}}
 
 
+  // {{{ utility functions
+
+  inline bool is_queue_out_of_order(cl_command_queue queue)
+  {
+      cl_command_queue_properties param_value;
+      PYOPENCL_CALL_GUARDED(clGetCommandQueueInfo,
+          (queue, CL_QUEUE_PROPERTIES, sizeof(param_value), &param_value, 0));
+      return param_value & CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE;
+  }
+
+  // }}}
+
+
   // {{{ buffer interface helper