Class CudaEvent
Managed wrapper around a CUDA event handle. CUDA event 句柄的托管封装。
public sealed class CudaEvent : IDisposable
- Inheritance
-
CudaEvent
- Implements
- Inherited Members
Constructors
CudaEvent()
Creates a CUDA event with default flags. 使用默认标志创建 CUDA event。
public CudaEvent()
CudaEvent(CudaEventCreationFlags)
Creates a CUDA event with explicit creation flags. 使用显式创建标志创建 CUDA event。
public CudaEvent(CudaEventCreationFlags flags)
Parameters
flagsCudaEventCreationFlagsThe CUDA event creation flags. CUDA event 创建标志。
Properties
Flags
Gets the effective CUDA event flags. 获取实际生效的 CUDA event 标志。
public CudaEventCreationFlags Flags { get; }
Property Value
Methods
Dispose()
Releases the native CUDA event handle. 释放原生 CUDA event 句柄。
public void Dispose()
ElapsedTimeSince(CudaEvent)
Measures elapsed time since a start event. 计算从起始 event 到当前 event 的耗时。
public float ElapsedTimeSince(CudaEvent startEvent)
Parameters
startEventCudaEventThe starting CUDA event. 起始 CUDA event。
Returns
- float
The elapsed time in milliseconds. 耗时(毫秒)。
IsReady()
Gets whether the CUDA event has already completed. 获取该 CUDA event 是否已经完成。
public bool IsReady()
Returns
Record(CudaStream)
Records this event on a CUDA stream. 在 CUDA stream 上记录当前 event。
public void Record(CudaStream stream)
Parameters
streamCudaStreamThe stream that receives the record operation. 接收 record 操作的 stream。
Record(CudaStream, CudaEventRecordFlags)
Records this CUDA event into a stream with explicit event-record flags. 使用显式 event-record flags 将当前 CUDA event 记录到 stream。
public void Record(CudaStream stream, CudaEventRecordFlags flags)
Parameters
streamCudaStreamThe stream that receives the event record operation. 接收 event record 操作的 stream。
flagsCudaEventRecordFlagsCUDA event-record flags. CUDA event record 标志。
Synchronize()
Blocks until the CUDA event is completed. 阻塞直到 CUDA event 完成。
public void Synchronize()