pub enum CollectiveKernel {
AllReduceMean,
}Expand description
Kernels used by crate::multi_gpu for collective (cross-device)
operations. Kept as a sibling to OptimizerKernel rather than folded
into it: a reduction is not an optimizer step, and giving it its own type
keeps that honest at the API level.
Variants§
AllReduceMean
Divide a local buffer by the replica count — the finishing step of a
sum-then-average all-reduce. See wgsl::ALL_REDUCE_MEAN.
Implementations§
Source§impl CollectiveKernel
impl CollectiveKernel
Sourcepub fn source_for(self, backend: GpuBackend) -> Option<&'static str>
pub fn source_for(self, backend: GpuBackend) -> Option<&'static str>
Shader source for backend, or None when that backend has no source.
Sourcepub fn cache_key(self, backend: GpuBackend) -> &'static str
pub fn cache_key(self, backend: GpuBackend) -> &'static str
Cache key combining the kernel and the backend it was compiled for.
Trait Implementations§
Source§impl Clone for CollectiveKernel
impl Clone for CollectiveKernel
Source§fn clone(&self) -> CollectiveKernel
fn clone(&self) -> CollectiveKernel
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 CollectiveKernel
Source§impl Debug for CollectiveKernel
impl Debug for CollectiveKernel
impl Eq for CollectiveKernel
Source§impl Hash for CollectiveKernel
impl Hash for CollectiveKernel
Source§impl PartialEq for CollectiveKernel
impl PartialEq for CollectiveKernel
impl StructuralPartialEq for CollectiveKernel
Auto Trait Implementations§
impl Freeze for CollectiveKernel
impl RefUnwindSafe for CollectiveKernel
impl Send for CollectiveKernel
impl Sync for CollectiveKernel
impl Unpin for CollectiveKernel
impl UnsafeUnpin for CollectiveKernel
impl UnwindSafe for CollectiveKernel
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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