pub struct ResourceBound {
pub amount: usize,
pub peak_per_s: f64,
}Expand description
A resource’s roofline record: how much of it a run must move, against the peak rate that resource can sustain.
Neutral by design: nothing here says whether amount counts bytes or
operations, or where peak_per_s came from, measured or modeled. That is
what lets AutotuneBound compose this with
a threshold instead of reimplementing the arithmetic.
Fields§
§amount: usizeHow much of the resource the run must move.
peak_per_s: f64The peak rate this resource can sustain, in the same unit as amount
per second.
Implementations§
Source§impl ResourceBound
impl ResourceBound
Sourcepub fn time_at_peak(&self) -> Option<Duration>
pub fn time_at_peak(&self) -> Option<Duration>
Time amount would take running at peak_per_s, with no allowance
for anything else the kernel does concurrently.
None for a peak_per_s that is zero, negative, NaN, or infinite:
none of those describe a real ceiling to divide by.
Trait Implementations§
Source§impl Clone for ResourceBound
impl Clone for ResourceBound
Source§fn clone(&self) -> ResourceBound
fn clone(&self) -> ResourceBound
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ResourceBound
Source§impl Debug for ResourceBound
impl Debug for ResourceBound
Source§impl<'de> Deserialize<'de> for ResourceBound
impl<'de> Deserialize<'de> for ResourceBound
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ResourceBound
impl PartialEq for ResourceBound
Source§impl Serialize for ResourceBound
impl Serialize for ResourceBound
impl StructuralPartialEq for ResourceBound
Auto Trait Implementations§
impl Freeze for ResourceBound
impl RefUnwindSafe for ResourceBound
impl Send for ResourceBound
impl Sync for ResourceBound
impl Unpin for ResourceBound
impl UnsafeUnpin for ResourceBound
impl UnwindSafe for ResourceBound
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
Converts
&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)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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