Class CudaEvent
Wrapps a CUevent handle.
Inheritance
Implements
Inherited Members
Namespace: ManagedCuda
Assembly: ManagedCuda.dll
Syntax
public class CudaEvent : IDisposable
Constructors
| Improve this Doc View SourceCudaEvent()
Creates a new Event using Default
Declaration
public CudaEvent()
CudaEvent(CUEventFlags)
Creates a new Event
Declaration
public CudaEvent(CUEventFlags flags)
Parameters
Type | Name | Description |
---|---|---|
CUEventFlags | flags | Parameters for event creation |
Properties
| Improve this Doc View SourceEvent
returns the wrapped CUevent handle
Declaration
public CUevent Event { get; set; }
Property Value
Type | Description |
---|---|
CUevent |
Methods
| Improve this Doc View SourceDispose()
Dispose
Declaration
public void Dispose()
Dispose(Boolean)
For IDisposable
Declaration
protected virtual void Dispose(bool fDisposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | fDisposing |
ElapsedTime(CudaEvent, CudaEvent)
Computes the elapsed time between two events (in milliseconds with a resolution of around 0.5 microseconds). If either event has not been recorded yet, this function throws ErrorNotReady. If either event has been recorded with a non-zero stream, the result is undefined.
Declaration
public static float ElapsedTime(CudaEvent eventStart, CudaEvent eventEnd)
Parameters
Type | Name | Description |
---|---|---|
CudaEvent | eventStart | |
CudaEvent | eventEnd |
Returns
Type | Description |
---|---|
System.Single |
Finalize()
For dispose
Declaration
protected void Finalize()
Query()
Returns true if the event has actually been recorded, or false if not. If Record() has not been called on this event, the function throws ErrorInvalidValue.
Declaration
public bool Query()
Returns
Type | Description |
---|---|
System.Boolean |
Record()
Records an event. If stream
is non-zero, the event is recorded after all preceding operations in the stream have been
completed; otherwise, it is recorded after all preceding operations in the CUDA context have been completed. Since
operation is asynchronous, Query() and/or Synchronize() must be used to determine when the event
has actually been recorded.
If Record() has previously been called and the event has not been recorded yet, this function throws ErrorInvalidValue.
Declaration
public void Record()
Record(CUstream)
Records an event. If stream
is non-zero, the event is recorded after all preceding operations in the stream have been
completed; otherwise, it is recorded after all preceding operations in the CUDA context have been completed. Since
operation is asynchronous, Query() and/or Synchronize() must be used to determine when the event
has actually been recorded.
If Record() has previously been called and the event has not been recorded yet, this function throws ErrorInvalidValue.
Declaration
public void Record(CUstream stream)
Parameters
Type | Name | Description |
---|---|---|
CUstream | stream |
Synchronize()
Waits until the event has actually been recorded. If Record() has been called on this event, the function returns ErrorInvalidValue. Waiting for an event that was created with the BlockingSync flag will cause the calling CPU thread to block until the event has actually been recorded.
If Record() has previously been called and the event has not been recorded yet, this function throws ErrorInvalidValue.
Declaration
public void Synchronize()