Package ai.rapids.cudf
Class Cuda.Event
java.lang.Object
ai.rapids.cudf.Cuda.Event
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
- Cuda
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
boolean
Check to see if the event has completed or not.void
record()
Captures the contents of the default stream at the time of this call.void
record
(Cuda.Stream stream) Captures the contents of stream at the time of this call.void
sync()
Block the thread to wait for the event to complete.toString()
-
Constructor Details
-
Event
public Event()Create an event that is as fast as possible, timing is disabled and no blockingSync. -
Event
public Event(boolean enableTiming, boolean blockingSync) Create an event to be used for CUDA synchronization.- Parameters:
enableTiming
- true if the event should record timing information.blockingSync
- true if event should use blocking synchronization. A host thread that calls sync() to wait on an event created with this flag will block until the event actually completes.
-
-
Method Details
-
hasCompleted
public boolean hasCompleted()Check to see if the event has completed or not. This is the equivalent of cudaEventQuery.- Returns:
- true it has completed else false.
-
record
Captures the contents of stream at the time of this call. This event and stream must be on the same device. Calls such as hasCompleted() or Stream.waitEvent() will then examine or wait for completion of the work that was captured. Uses of stream after this call do not modify event.- Parameters:
stream
- the stream to record the state of.
-
record
public void record()Captures the contents of the default stream at the time of this call. -
sync
public void sync()Block the thread to wait for the event to complete. Note that this does not follow any of the java threading standards. Interrupt will not work to wake up the thread. -
toString
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-