pub enum KnownScale {
None,
Global(f32),
Whole(f32),
}Expand description
The part of each read’s scale the caller already knew when it built the view, held in one register rather than read per position; whatever is not known up front is read through the scales view. The discriminant is comptime, so each variant compiles its own kernel with nothing of the others in it.
Variants§
None
Nothing known up front: each read looks its whole scale up at its position.
Global(f32)
The per-tensor scale of a two-level scheme; each read still looks its block scale up and multiplies this in.
Whole(f32)
The whole scale, whatever the caller multiplied into it. The scales view is never read: its address arithmetic and its load leave the kernel.
Implementations§
Source§impl KnownScale
impl KnownScale
pub fn new_None() -> Self
pub fn __expand_new_None(_: &Scope) -> KnownScaleExpand
pub fn new_Global(_0: f32) -> Self
pub fn __expand_new_Global( _: &Scope, _0: <f32 as CubeType>::ExpandType, ) -> KnownScaleExpand
pub fn new_Whole(_0: f32) -> Self
pub fn __expand_new_Whole( _: &Scope, _0: <f32 as CubeType>::ExpandType, ) -> KnownScaleExpand
Source§impl KnownScale
impl KnownScale
Sourcepub fn effective(&self, scale: f32) -> f32
pub fn effective(&self, scale: f32) -> f32
The scale a value dequantizes against once scale, looked up for its position, meets what
this register holds.
Sourcepub fn __expand_effective(
scope: &Scope,
this: &<Self as CubeType>::ExpandType,
scale: <f32 as CubeType>::ExpandType,
) -> <f32 as CubeType>::ExpandType
pub fn __expand_effective( scope: &Scope, this: &<Self as CubeType>::ExpandType, scale: <f32 as CubeType>::ExpandType, ) -> <f32 as CubeType>::ExpandType
The scale a value dequantizes against once scale, looked up for its position, meets what
this register holds.
Trait Implementations§
Source§impl Clone for KnownScale
impl Clone for KnownScale
Source§fn clone(&self) -> KnownScale
fn clone(&self) -> KnownScale
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for KnownScale
Source§impl CubeDebug for KnownScale
impl CubeDebug for KnownScale
Source§fn set_debug_name(&self, scope: &Scope, name: &'static str)
fn set_debug_name(&self, scope: &Scope, name: &'static str)
Source§impl CubeType for KnownScale
impl CubeType for KnownScale
Source§impl LaunchArg for KnownScale
impl LaunchArg for KnownScale
Source§type RuntimeArg<R: Runtime> = KnownScaleArgs<R>
type RuntimeArg<R: Runtime> = KnownScaleArgs<R>
Source§type CompilationArg = KnownScaleCompilationArg
type CompilationArg = KnownScaleCompilationArg
fn register<R: Runtime>( runtime_arg: Self::RuntimeArg<R>, launcher: &mut KernelLauncher<R>, ) -> Self::CompilationArg
Source§fn expand(
arg: &Self::CompilationArg,
builder: &mut KernelBuilder,
) -> <Self as CubeType>::ExpandType
fn expand( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> <Self as CubeType>::ExpandType
KernelBuilder.Auto Trait Implementations§
impl Freeze for KnownScale
impl RefUnwindSafe for KnownScale
impl Send for KnownScale
impl Sync for KnownScale
impl Unpin for KnownScale
impl UnsafeUnpin for KnownScale
impl UnwindSafe for KnownScale
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneExpand for Twhere
T: Clone,
impl<T> CloneExpand for Twhere
T: Clone,
fn __expand_clone_method(&self, _: &Scope) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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)
&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)
&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> ⓘ
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> ⓘ
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 moreimpl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> TuneInputs for T
impl<T> TuneInputs for T
Source§impl<T> ViewLayoutLaunchArg for T
impl<T> ViewLayoutLaunchArg for T
Source§type RuntimeArg<R: Runtime> = <T as LaunchArg>::RuntimeArg<R>
type RuntimeArg<R: Runtime> = <T as LaunchArg>::RuntimeArg<R>
Source§type CompilationArg = <T as LaunchArg>::CompilationArg
type CompilationArg = <T as LaunchArg>::CompilationArg
fn register<R, B>( arg: <T as ViewLayoutLaunchArg>::RuntimeArg<R>, _buffer: &B, _ty: Type, launcher: &mut KernelLauncher<R>, ) -> <T as ViewLayoutLaunchArg>::CompilationArg
Source§fn expand(
arg: &<T as ViewLayoutLaunchArg>::CompilationArg,
_ty: Type,
builder: &mut KernelBuilder,
) -> <T as CubeType>::ExpandType
fn expand( arg: &<T as ViewLayoutLaunchArg>::CompilationArg, _ty: Type, builder: &mut KernelBuilder, ) -> <T as CubeType>::ExpandType
KernelBuilder.Source§fn expand_output(
arg: &Self::CompilationArg,
ty: Type,
builder: &mut KernelBuilder,
) -> <Self as CubeType>::ExpandType
fn expand_output( arg: &Self::CompilationArg, ty: Type, builder: &mut KernelBuilder, ) -> <Self as CubeType>::ExpandType
KernelBuilder.