pub struct InputScalar { /* private fields */ }Expand description
A way to define an input scalar without a generic attached to it.
It uses comptime enum with zero-cost runtime abstraction for kernel generation.
Implementations§
Source§impl InputScalar
impl InputScalar
Sourcepub fn new<E>(val: E, dtype: impl Into<StorageType>) -> InputScalarwhere
E: ToPrimitive,
pub fn new<E>(val: E, dtype: impl Into<StorageType>) -> InputScalarwhere
E: ToPrimitive,
Creates an InputScalar from the given element and dtype.
§Panics
If the given numeric element can’t be transformed into the passed ElemType.
Source§impl InputScalar
impl InputScalar
Sourcepub fn get<C>(&self) -> Cwhere
C: Scalar,
pub fn get<C>(&self) -> Cwhere
C: Scalar,
Reads the scalar with the given element type.
Performs casting if necessary.
pub fn __expand_get<C>(
scope: &mut Scope,
this: <InputScalar as CubeType>::ExpandType,
) -> <C as CubeType>::ExpandTypewhere
C: Scalar,
Trait Implementations§
Source§impl Clone for InputScalar
impl Clone for InputScalar
Source§fn clone(&self) -> InputScalar
fn clone(&self) -> InputScalar
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 moreSource§impl CubeType for InputScalar
impl CubeType for InputScalar
Source§impl Debug for InputScalar
impl Debug for InputScalar
Source§impl LaunchArg for InputScalar
impl LaunchArg for InputScalar
Source§type RuntimeArg<R: Runtime> = InputScalar
type RuntimeArg<R: Runtime> = InputScalar
The runtime argument for the kernel.
Source§type CompilationArg = InputScalarCompilationArg
type CompilationArg = InputScalarCompilationArg
Compilation argument.
fn register<R>(
arg: <InputScalar as LaunchArg>::RuntimeArg<R>,
launcher: &mut KernelLauncher<R>,
) -> <InputScalar as LaunchArg>::CompilationArgwhere
R: Runtime,
Source§fn expand(
arg: &<InputScalar as LaunchArg>::CompilationArg,
builder: &mut KernelBuilder,
) -> <InputScalar as CubeType>::ExpandType
fn expand( arg: &<InputScalar as LaunchArg>::CompilationArg, builder: &mut KernelBuilder, ) -> <InputScalar as CubeType>::ExpandType
Register an input variable during compilation that fill the
KernelBuilder.Source§fn expand_output(
arg: &Self::CompilationArg,
builder: &mut KernelBuilder,
) -> Self::ExpandType
fn expand_output( arg: &Self::CompilationArg, builder: &mut KernelBuilder, ) -> Self::ExpandType
Register an output variable during compilation that fill the
KernelBuilder.impl Copy for InputScalar
Auto Trait Implementations§
impl Freeze for InputScalar
impl RefUnwindSafe for InputScalar
impl Send for InputScalar
impl Sync for InputScalar
impl Unpin for InputScalar
impl UnsafeUnpin for InputScalar
impl UnwindSafe for InputScalar
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<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> TuneInputs for T
impl<T> TuneInputs for T
Source§impl<T> ViewLayoutLaunchArg for Twhere
T: LaunchArg,
impl<T> ViewLayoutLaunchArg for Twhere
T: LaunchArg,
Source§type RuntimeArg<R: Runtime> = <T as LaunchArg>::RuntimeArg<R>
type RuntimeArg<R: Runtime> = <T as LaunchArg>::RuntimeArg<R>
The runtime argument for the kernel.
Source§type CompilationArg = <T as LaunchArg>::CompilationArg
type CompilationArg = <T as LaunchArg>::CompilationArg
Compilation argument.
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
Register an input variable during compilation that fill the
KernelBuilder.Source§fn expand_output(
arg: &<T as ViewLayoutLaunchArg>::CompilationArg,
_ty: Type,
builder: &mut KernelBuilder,
) -> <T as CubeType>::ExpandType
fn expand_output( arg: &<T as ViewLayoutLaunchArg>::CompilationArg, _ty: Type, builder: &mut KernelBuilder, ) -> <T as CubeType>::ExpandType
Register an output variable during compilation that fill the
KernelBuilder.