Struct HybridStats
pub struct HybridStats {
cpu_executions: AtomicU64,
gpu_executions: AtomicU64,
cpu_time_ns: AtomicU64,
gpu_time_ns: AtomicU64,
cpu_elements: AtomicU64,
gpu_elements: AtomicU64,
learned_threshold: AtomicU64,
}Expand description
Statistics for hybrid processing decisions.
Thread-safe via atomic operations.
Fields§
§cpu_executions: AtomicU64§gpu_executions: AtomicU64§cpu_time_ns: AtomicU64§gpu_time_ns: AtomicU64§cpu_elements: AtomicU64§gpu_elements: AtomicU64§learned_threshold: AtomicU64Implementations§
§impl HybridStats
impl HybridStats
pub fn new() -> HybridStats
pub fn new() -> HybridStats
Creates new empty statistics.
pub fn record_cpu_execution(&self, duration: Duration, elements: usize)
pub fn record_cpu_execution(&self, duration: Duration, elements: usize)
Records a CPU execution.
pub fn record_gpu_execution(&self, duration: Duration, elements: usize)
pub fn record_gpu_execution(&self, duration: Duration, elements: usize)
Records a GPU execution.
pub fn set_learned_threshold(&self, threshold: usize)
pub fn set_learned_threshold(&self, threshold: usize)
Updates the learned threshold.
pub fn learned_threshold(&self) -> usize
pub fn learned_threshold(&self) -> usize
Gets the learned threshold.
pub fn cpu_executions(&self) -> u64
pub fn cpu_executions(&self) -> u64
Gets the total CPU executions.
pub fn gpu_executions(&self) -> u64
pub fn gpu_executions(&self) -> u64
Gets the total GPU executions.
pub fn avg_cpu_time(&self) -> Duration
pub fn avg_cpu_time(&self) -> Duration
Gets the average CPU time per execution.
pub fn avg_gpu_time(&self) -> Duration
pub fn avg_gpu_time(&self) -> Duration
Gets the average GPU time per execution.
pub fn cpu_gpu_ratio(&self) -> f32
pub fn cpu_gpu_ratio(&self) -> f32
Gets the CPU/GPU execution ratio.
pub fn cpu_throughput(&self) -> f64
pub fn cpu_throughput(&self) -> f64
Gets the average CPU throughput (elements per second).
pub fn gpu_throughput(&self) -> f64
pub fn gpu_throughput(&self) -> f64
Gets the average GPU throughput (elements per second).
pub fn snapshot(&self) -> HybridStatsSnapshot
pub fn snapshot(&self) -> HybridStatsSnapshot
Creates a snapshot of the current statistics.
pub fn reset(&self)
pub fn reset(&self)
Resets all statistics to zero.
Trait Implementations§
§impl Debug for HybridStats
impl Debug for HybridStats
§impl Default for HybridStats
impl Default for HybridStats
§fn default() -> HybridStats
fn default() -> HybridStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for HybridStats
impl RefUnwindSafe for HybridStats
impl Send for HybridStats
impl Sync for HybridStats
impl Unpin for HybridStats
impl UnwindSafe for HybridStats
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.