/// <summary> /// Issues all previously queued OpenCL commands in the command-queue to the device /// associated with the command-queue. /// </summary> /// <remarks> /// <see cref="Flush"/> only guarantees that all queued commands will eventually be /// submitted to the appropriate device. There is no guarantee that they will be /// complete after <see cref="Flush"/> returns. /// /// <para>Any blocking commands queued in a command-queue and <see cref="Dispose"/> /// perform an implicit flush of the command-queue. These blocking commands are /// <see cref="EnqueueReadBuffer"/>, <see cref="EnqueueReadBufferRect"/>, or /// <see cref="EnqueueReadImage"/> with <c>blocking</c> set to <c>true</c>; /// <see cref="EnqueueWriteBuffer"/>, <see cref="EnqueueWriteBufferRect"/>, or /// <see cref="EnqueueWriteImage"/> with <c>blocking_write</c> set to <c>true</c>; /// <see cref="EnqueueMapBuffer"/> or <see cref="EnqueueMapImage"/> with /// <c>blocking_map</c> set to <c>true</c>; or <see cref="Event.WaitAll"/>.</para> /// /// <para>To use event objects that refer to commands enqueued in a command-queue /// as event objects to wait on by commands enqueued in a different command-queue, /// the application must call a <see cref="Flush"/> or any blocking commands that /// perform an implicit flush of the command-queue where the commands that refer /// to these event objects are enqueued.</para> /// </remarks> public void Flush() { ThrowIfDisposed(); UnsafeNativeMethods.Flush(Handle); }