public static int cuStreamWaitEvent(CUstream hStream, CUevent hEvent, int Flags)
    {
        return checkResult(cuStreamWaitEventNative(hStream, hEvent, Flags));
    }
public static int cuStreamWaitEvent ( CUstream hStream , CUevent hEvent , int Flags ) { return checkResult ( cuStreamWaitEventNative ( hStream , hEvent , Flags ) ) ; }
Make a compute stream wait on an event.

<pre>
CUresult cuStreamWaitEvent (
CUstream hStream,
CUevent hEvent,
unsigned int  Flags )
</pre>
<div>
<p>Make a compute stream wait on an event.
Makes all future work submitted to <tt>hStream</tt> wait until <tt>hEvent</tt> reports completion before beginning execution. This
synchronization will be performed efficiently on the device. The event
<tt>hEvent</tt> may be from a different
context than <tt>hStream</tt>, in which case this function will
perform cross-device synchronization.
</p>
<p>The stream <tt>hStream</tt> will wait
only for the completion of the most recent host call to cuEventRecord()
on <tt>hEvent</tt>. Once this call has returned, any functions
(including cuEventRecord() and cuEventDestroy()) may be called on <tt>hEvent</tt> again, and subsequent calls will not have any effect on
<tt>hStream</tt>.
</p>
<p>If <tt>hStream</tt> is 0 (the NULL
stream) any future work submitted in any stream will wait for <tt>hEvent</tt> to complete before beginning execution. This effectively
creates a barrier for all future work submitted to the context.
</p>
<p>If cuEventRecord() has not been called
on <tt>hEvent</tt>, this call acts as if the record has already
completed, and so is a functional no-op.
</p>
<div>
<span>Note:</span>
<p>Note that this
function may also return error codes from previous, asynchronous
launches.
</p>
</div>
</p>
</div>

@param hStream Stream to wait
@param hEvent Event to wait on (may not be NULL)
@param Flags Parameters for the operation (must be 0)

@return CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED,
CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_HANDLE,

@see JCudaDriver#cuStreamCreate
@see JCudaDriver#cuEventRecord
@see JCudaDriver#cuStreamQuery
@see JCudaDriver#cuStreamSynchronize
@see JCudaDriver#cuStreamAddCallback
@see JCudaDriver#cuStreamDestroy