Struct hwlocality::memory::attribute::MemoryAttributeBuilder

source ·
pub struct MemoryAttributeBuilder<'editor, 'topology> { /* private fields */ }
Available on crate feature hwloc-2_3_0 only.
Expand description

Mechanism to configure a memory attribute

Implementations§

source§

impl MemoryAttributeBuilder<'_, '_>

source

pub fn set_values( &mut self, find_values: impl FnOnce(&Topology) -> (Option<Vec<MemoryAttributeLocation<'_>>>, Vec<(&TopologyObject, u64)>), ) -> Result<(), HybridError<ValueInputError>>

Set attribute values for (initiator, target node) pairs

Given a read-only view of the underlying Topology, the provided find_values callback should conceptually extract a list of (initiator, target, value) tuples if this memory attribute has initiators (flag MemoryAttributeFlags::NEED_INITIATOR was set at attribute registration time), and a list of (target, value) tuples if the attribute has no initiators.

However, for efficiency reasons, the callback does not literally return a list of ternary tuples with an optional initiator member, as this would require one initiator check per attribute value. Instead, the callback returns a list of (target, value) pairs along with an optional list of initiators. If a list of initiators is provided, it must be as long as the provided list of (target, value) pairs.

Initiators should be specified as CpuSet when referring to accesses performed by CPU cores. The Object initiator type is currently unused internally by hwloc, but users may for instance use it to provide custom information about host memory accesses performed by GPUs.

§Errors

Trait Implementations§

source§

impl<'editor, 'topology> Debug for MemoryAttributeBuilder<'editor, 'topology>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'editor, 'topology> Freeze for MemoryAttributeBuilder<'editor, 'topology>

§

impl<'editor, 'topology> RefUnwindSafe for MemoryAttributeBuilder<'editor, 'topology>

§

impl<'editor, 'topology> Send for MemoryAttributeBuilder<'editor, 'topology>

§

impl<'editor, 'topology> Sync for MemoryAttributeBuilder<'editor, 'topology>

§

impl<'editor, 'topology> Unpin for MemoryAttributeBuilder<'editor, 'topology>

§

impl<'editor, 'topology> !UnwindSafe for MemoryAttributeBuilder<'editor, 'topology>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V