pub struct MockBackend { /* private fields */ }Expand description
A mock backend for testing distributed operations in a single process. Simulates distributed communication without actual network operations.
Implementations§
Source§impl MockBackend
impl MockBackend
Trait Implementations§
Source§impl Backend for MockBackend
impl Backend for MockBackend
Source§fn world_size(&self) -> usize
fn world_size(&self) -> usize
Returns the total world size.
Source§fn all_reduce(&self, data: &mut [f32], op: ReduceOp)
fn all_reduce(&self, data: &mut [f32], op: ReduceOp)
Performs all-reduce operation.
Source§fn all_gather(&self, send_data: &[f32], recv_data: &mut [f32])
fn all_gather(&self, send_data: &[f32], recv_data: &mut [f32])
Performs all-gather operation.
Source§fn reduce_scatter(&self, send_data: &[f32], recv_data: &mut [f32], op: ReduceOp)
fn reduce_scatter(&self, send_data: &[f32], recv_data: &mut [f32], op: ReduceOp)
Performs reduce-scatter operation.
Source§fn gather(&self, send_data: &[f32], recv_data: &mut [f32], dst: usize)
fn gather(&self, send_data: &[f32], recv_data: &mut [f32], dst: usize)
Performs gather operation.
Source§fn scatter(&self, send_data: &[f32], recv_data: &mut [f32], src: usize)
fn scatter(&self, send_data: &[f32], recv_data: &mut [f32], src: usize)
Performs scatter operation.
Auto Trait Implementations§
impl Freeze for MockBackend
impl RefUnwindSafe for MockBackend
impl Send for MockBackend
impl Sync for MockBackend
impl Unpin for MockBackend
impl UnwindSafe for MockBackend
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> 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