pub struct MlxStreamThreadLocal(/* private fields */);Expand description
Per-thread MLX stream slot for one device.
Implementations§
Source§impl MlxStreamThreadLocal
impl MlxStreamThreadLocal
Sourcepub fn for_device(device: &MlxDeviceHandle) -> Result<Self, MlxCError>
pub fn for_device(device: &MlxDeviceHandle) -> Result<Self, MlxCError>
Creates the thread-local slot for one device’s stream.
Sourcepub fn set(&mut self, source: &Self) -> Result<(), MlxCError>
pub fn set(&mut self, source: &Self) -> Result<(), MlxCError>
Copies the source slot handle into this slot.
Sourcepub fn stream(&self) -> Result<MlxStream, MlxCError>
pub fn stream(&self) -> Result<MlxStream, MlxCError>
Copies the slot’s current stream into an owned handle.
Sourcepub fn synchronize(&self) -> Result<(), MlxCError>
pub fn synchronize(&self) -> Result<(), MlxCError>
Synchronizes the slot’s current stream.
Trait Implementations§
Source§impl Debug for MlxStreamThreadLocal
impl Debug for MlxStreamThreadLocal
Source§impl Drop for MlxStreamThreadLocal
impl Drop for MlxStreamThreadLocal
Auto Trait Implementations§
impl !Send for MlxStreamThreadLocal
impl !Sync for MlxStreamThreadLocal
impl Freeze for MlxStreamThreadLocal
impl RefUnwindSafe for MlxStreamThreadLocal
impl Unpin for MlxStreamThreadLocal
impl UnsafeUnpin for MlxStreamThreadLocal
impl UnwindSafe for MlxStreamThreadLocal
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