Library/ManagedCuda/CudaStream.cs
/// <summary>
/// Wait on a memory location<para/>
/// Enqueues a synchronization of the stream on the given memory location. Work
/// ordered after the operation will block until the given condition on the
/// memory is satisfied. By default, the condition is to wait for (int32_t)(*addr - value) >= 0, a cyclic greater-or-equal.
/// <para/>
/// Other condition types can be specified via \p flags.
/// <para/>
/// If the memory was registered via ::cuMemHostRegister(), the device pointer
/// should be obtained with::cuMemHostGetDevicePointer(). This function cannot
/// be used with managed memory(::cuMemAllocManaged).
/// <para/>
/// Support for this can be queried with ::cuDeviceGetAttribute() and
/// ::CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_MEM_OPS. The requirements are
/// compute capability 7.0 or greater, and on Windows, that the device be in
/// TCC mode.
/// </summary>
/// <param name="addr">The memory location to wait on.</param>
/// <param name="value">The value to compare with the memory location.</param>
/// <param name="flags">See::CUstreamWaitValue_flags.</param>
Wait on a memory location
Enqueues a synchronization of the stream on the given memory location. Work
ordered after the operation will block until the given condition on the
memory is satisfied. By default, the condition is to wait for (int32_t)(*addr - value) >= 0, a cyclic greater-or-equal.

Other condition types can be specified via \p flags.

If the memory was registered via ::cuMemHostRegister(), the device pointer
should be obtained with::cuMemHostGetDevicePointer(). This function cannot
be used with managed memory(::cuMemAllocManaged).

Support for this can be queried with ::cuDeviceGetAttribute() and
::CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_MEM_OPS. The requirements are
compute capability 7.0 or greater, and on Windows, that the device be in
TCC mode.
Wait on a memory location Enqueues a synchronization of the stream on the given memory location . Work ordered after the operation will block until the given condition on the memory is satisfied . By default the condition is to wait for ( int32_t ) ( * addr - value ) > = 0 a cyclic greater - or - equal . Other condition types can be specified via \ p flags . If the memory was registered via :: cuMemHostRegister () the device pointer should be obtained with :: cuMemHostGetDevicePointer () . This function cannot be used with managed memory ( :: cuMemAllocManaged ) . Support for this can be queried with :: cuDeviceGetAttribute () and :: CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_MEM_OPS . The requirements are compute capability 7 . 0 or greater and on Windows that the device be in TCC mode .
public void WaitValue(CUdeviceptr addr, ulong value, CUstreamWaitValue_flags flags)
        {
            CUResult res = DriverAPINativeMethods.Events.cuStreamWaitValue64(_stream, addr, value, flags);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuStreamWaitValue64", res));
            if (res != CUResult.Success) throw new CudaException(res);
        }
public void WaitValue ( CUdeviceptr addr , ulong value , CUstreamWaitValue_flags flags ) { CUResult res = DriverAPINativeMethods . Events . cuStreamWaitValue64 ( _stream , addr , value , flags ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != CUResult . Success ) throw new CudaException ( res ) ; }
Wait on a memory location
Enqueues a synchronization of the stream on the given memory location.
Wait on a memory location Enqueues a synchronization of the stream on the given memory location .
addr
CUdeviceptr
The memory location to wait on.
The memory location to wait on .
value
ulong
The value to compare with the memory location.
The value to compare with the memory location .
flags
CUstreamWaitValue_flags
None