pub struct Event { /* private fields */ }Expand description
A CUDA event (Runtime API).
Implementations§
Source§impl Event
impl Event
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Create an event with default flags (timing enabled, spinning wait).
Sourcepub fn no_timing() -> Result<Self>
pub fn no_timing() -> Result<Self>
Create an event optimized for synchronization (no timing data).
Sourcepub fn with_flags(flags: u32) -> Result<Self>
pub fn with_flags(flags: u32) -> Result<Self>
Create an event with raw flags (see cudaEventFlags).
Sourcepub fn synchronize(&self) -> Result<()>
pub fn synchronize(&self) -> Result<()>
Block the calling host thread until the event has completed.
Sourcepub fn is_complete(&self) -> Result<bool>
pub fn is_complete(&self) -> Result<bool>
Ok(true) if the event has completed.
Sourcepub fn elapsed_time_ms(start: &Event, end: &Event) -> Result<f32>
pub fn elapsed_time_ms(start: &Event, end: &Event) -> Result<f32>
Milliseconds of device work between start and end. Both must have
been created with timing enabled.
Sourcepub fn as_raw(&self) -> cudaEvent_t
pub fn as_raw(&self) -> cudaEvent_t
Raw cudaEvent_t. Use with care.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more