pub struct ComputeProfiler { /* private fields */ }Expand description
Profiles compute dispatches with per-dispatch GPU timing.
Implementations§
Source§impl ComputeProfiler
impl ComputeProfiler
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Enable or disable profiling.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Whether profiling is enabled.
Sourcepub fn collect_results(&mut self, gl: &Context)
pub fn collect_results(&mut self, gl: &Context)
Collect results for all completed queries.
Sourcepub fn last_ms(&self, name: &str) -> Option<f64>
pub fn last_ms(&self, name: &str) -> Option<f64>
Get the last timing for a named dispatch in milliseconds.
Sourcepub fn average_ms(&self, name: &str) -> Option<f64>
pub fn average_ms(&self, name: &str) -> Option<f64>
Get the average timing for a named dispatch over the history window.
Sourcepub fn min_max_ms(&self, name: &str) -> Option<(f64, f64)>
pub fn min_max_ms(&self, name: &str) -> Option<(f64, f64)>
Get the min/max timing for a named dispatch.
Sourcepub fn dispatch_names(&self) -> Vec<&str>
pub fn dispatch_names(&self) -> Vec<&str>
Get all dispatch names that have been profiled.
Sourcepub fn reset_history(&mut self)
pub fn reset_history(&mut self)
Reset all history.
Auto Trait Implementations§
impl Freeze for ComputeProfiler
impl RefUnwindSafe for ComputeProfiler
impl Send for ComputeProfiler
impl Sync for ComputeProfiler
impl Unpin for ComputeProfiler
impl UnsafeUnpin for ComputeProfiler
impl UnwindSafe for ComputeProfiler
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.