pub struct EventTimer { /* private fields */ }
Expand description
Timer based on CUDA events.
Times the duration of operations scheduled on a CUDA stream.
Example:
let timer = EventTimer::record_start(&stream).unwrap();
// ... schedule some work on the queue ...
timer.record_stop(&stream).unwrap();
let time_in_ms = timer.synchronize_and_time().unwrap();
Implementations
sourceimpl EventTimer
impl EventTimer
sourcepub fn record_start(stream: &Stream) -> CudaResult<Self>
pub fn record_start(stream: &Stream) -> CudaResult<Self>
Starts recording time.
sourcepub fn record_stop(&self, stream: &Stream) -> CudaResult<()>
pub fn record_stop(&self, stream: &Stream) -> CudaResult<()>
Stops recording time.
sourcepub fn synchronize_and_time(&self) -> CudaResult<f32>
pub fn synchronize_and_time(&self) -> CudaResult<f32>
Waits for the timer to finish and returns the duration in milliseconds.
Auto Trait Implementations
impl RefUnwindSafe for EventTimer
impl !Send for EventTimer
impl !Sync for EventTimer
impl Unpin for EventTimer
impl UnwindSafe for EventTimer
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more