pub enum Variable<D: Dialect> {
Show 51 variants
AbsolutePos(Elem<D>),
AbsolutePosBaseName,
AbsolutePosX,
AbsolutePosY,
AbsolutePosZ,
UnitPos,
UnitPosBaseName,
UnitPosX,
UnitPosY,
UnitPosZ,
CubePos(Elem<D>),
CubePosBaseName,
CubePosX,
CubePosY,
CubePosZ,
CubeDim,
CubeDimBaseName,
CubeDimX,
CubeDimY,
CubeDimZ,
CubeCount(Elem<D>),
CubeCountBaseName,
CubeCountX,
CubeCountY,
CubeCountZ,
PlaneDim,
PlaneDimChecked,
PlanePos,
UnitPosPlane,
ClusterRank,
ClusterIndexX,
ClusterIndexY,
ClusterIndexZ,
GlobalInputArray(Id, Item<D>),
GlobalOutputArray(Id, Item<D>),
GlobalScalar {
id: Id,
elem: Elem<D>,
in_struct: bool,
},
ConstantArray(Id, Item<D>, usize),
Constant(ConstantValue, Item<D>),
TensorMap(Id),
LocalMut {
id: Id,
item: Item<D>,
},
LocalConst {
id: Id,
item: Item<D>,
},
Named {
name: &'static str,
item: Item<D>,
},
Slice {
id: Id,
item: Item<D>,
},
SharedArray(Id, Item<D>, usize),
Shared(Id, Item<D>),
LocalArray(Id, Item<D>, usize),
WmmaFragment {
id: Id,
frag: Fragment<D>,
},
Pipeline {
id: Id,
},
Barrier {
id: Id,
level: BarrierLevel,
},
BarrierToken {
id: Id,
level: BarrierLevel,
},
Tmp {
id: Id,
item: Item<D>,
is_declared: bool,
is_ptr: bool,
is_const: bool,
},
}Variants§
AbsolutePos(Elem<D>)
AbsolutePosBaseName
AbsolutePosX
AbsolutePosY
AbsolutePosZ
UnitPos
UnitPosBaseName
UnitPosX
UnitPosY
UnitPosZ
CubePos(Elem<D>)
CubePosBaseName
CubePosX
CubePosY
CubePosZ
CubeDim
CubeDimBaseName
CubeDimX
CubeDimY
CubeDimZ
CubeCount(Elem<D>)
CubeCountBaseName
CubeCountX
CubeCountY
CubeCountZ
PlaneDim
PlaneDimChecked
PlanePos
UnitPosPlane
ClusterRank
ClusterIndexX
ClusterIndexY
ClusterIndexZ
GlobalInputArray(Id, Item<D>)
GlobalOutputArray(Id, Item<D>)
GlobalScalar
ConstantArray(Id, Item<D>, usize)
Constant(ConstantValue, Item<D>)
TensorMap(Id)
LocalMut
LocalConst
Named
Slice
LocalArray(Id, Item<D>, usize)
WmmaFragment
Pipeline
Barrier
BarrierToken
Tmp
Implementations§
Source§impl<D: Dialect> Variable<D>
impl<D: Dialect> Variable<D>
pub fn is_optimized(&self) -> bool
Sourcepub fn tmp(item: Item<D>) -> Self
pub fn tmp(item: Item<D>) -> Self
Create a temporary variable.
Also see Self::tmp_declared for a version that needs custom declaration.
pub fn to_const(&mut self)
Sourcepub fn reinterpret_ptr(&self, f: &mut Formatter<'_>, item: Item<D>) -> Self
pub fn reinterpret_ptr(&self, f: &mut Formatter<'_>, item: Item<D>) -> Self
Create a temporary variable with a reinterpret_cast.
Sourcepub fn tmp_ptr(item: Item<D>) -> Self
pub fn tmp_ptr(item: Item<D>) -> Self
Create a temporary pointer variable.
Also see Self::tmp_declared for a version that needs custom declaration.
Sourcepub fn tmp_declared(item: Item<D>) -> Self
pub fn tmp_declared(item: Item<D>) -> Self
Create a temporary variable with a custom declaration.
§Notes
Calling var.fmt_left() will assume the variable already exist.
pub fn optimized_args<const N: usize>(args: [Self; N]) -> OptimizedArgs<N, D>
pub fn optimized(&self) -> Self
pub fn is_always_scalar(&self) -> bool
pub fn index(&self, index: usize) -> IndexedVariable<D>
pub fn const_qualifier(&self) -> &str
pub fn id(&self) -> Option<Id>
Sourcepub fn fmt_ptr(&self) -> String
pub fn fmt_ptr(&self) -> String
Format variable for a pointer argument. Slices and buffers are already pointers, so we just leave them as is to avoid accidental double pointers
Sourcepub fn fmt_cast_to(&self, item: Item<D>) -> String
pub fn fmt_cast_to(&self, item: Item<D>) -> String
Format an item with a specific type, casting if necessary
Trait Implementations§
impl<D: Copy + Dialect> Copy for Variable<D>
impl<D: Dialect> StructuralPartialEq for Variable<D>
Auto Trait Implementations§
impl<D> Freeze for Variable<D>
impl<D> RefUnwindSafe for Variable<D>where
D: RefUnwindSafe,
impl<D> Send for Variable<D>
impl<D> Sync for Variable<D>
impl<D> Unpin for Variable<D>where
D: Unpin,
impl<D> UnwindSafe for Variable<D>where
D: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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