pub enum Operation {
Show 21 variants
Copy(Value),
ConstructAggregate(Vec<Value>),
ExtractAggregateField(AggregateExtractOperands),
DeclareVariable {
value_ty: Type,
addr_space: AddressSpace,
alignment: usize,
},
Memory(Memory),
Arithmetic(Arithmetic),
Comparison(Comparison),
Bitwise(Bitwise),
Operator(Operator),
Atomic(AtomicOp),
Metadata(Metadata),
Branch(Branch),
Synchronization(Synchronization),
WorkgroupUniformLoad(Value),
Plane(Plane),
CoopMma(CoopMma),
Barrier(BarrierOps),
Tma(TmaOps),
TensorIndexing(TensorIndexingOps),
NonSemantic(NonSemantic),
Marker(Marker),
}Expand description
All operations that can be used in a GPU compute shader.
Notes:
Operator can be vectorized, but other operations can’t. Therefore, during tracing, only operators can be registered.
Variants§
Copy(Value)
ConstructAggregate(Vec<Value>)
Construct an aggregate (i.e. fat pointer) that’s later disaggregated into normal values supported by codegen. Not allowed to exist after the disaggregation pass.
ExtractAggregateField(AggregateExtractOperands)
Extract a specific field from an aggregate (i.e. read the length from a slice ptr). Not allowed to exist after the disaggregation pass.
DeclareVariable
Memory(Memory)
Arithmetic(Arithmetic)
Comparison(Comparison)
Bitwise(Bitwise)
Operator(Operator)
Atomic(AtomicOp)
Metadata(Metadata)
Branch(Branch)
Synchronization(Synchronization)
WorkgroupUniformLoad(Value)
Barrier followed by a load whose result is workgroup-uniform.
Mirrors WGSL’s workgroupUniformLoad: the input is a reference into
workgroup-shared memory (&list[i], produced by Memory::Index),
and both the non-atomic and atomic WGSL overloads map here. Other
backends lower this to a sync_cube followed by a regular (or atomic)
load — uniformity is implicit there.
Plane(Plane)
CoopMma(CoopMma)
Barrier(BarrierOps)
Tma(TmaOps)
TensorIndexing(TensorIndexingOps)
NonSemantic(NonSemantic)
Non-semantic instructions (i.e. comments, debug info)
Marker(Marker)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Operation
impl<'de> Deserialize<'de> for Operation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Operation
Source§impl From<AggregateExtractOperands> for Operation
impl From<AggregateExtractOperands> for Operation
Source§fn from(value: AggregateExtractOperands) -> Self
fn from(value: AggregateExtractOperands) -> Self
Source§impl From<Arithmetic> for Operation
impl From<Arithmetic> for Operation
Source§fn from(value: Arithmetic) -> Self
fn from(value: Arithmetic) -> Self
Source§impl From<BarrierOps> for Operation
impl From<BarrierOps> for Operation
Source§fn from(value: BarrierOps) -> Self
fn from(value: BarrierOps) -> Self
Source§impl From<Comparison> for Operation
impl From<Comparison> for Operation
Source§fn from(value: Comparison) -> Self
fn from(value: Comparison) -> Self
Source§impl From<NonSemantic> for Operation
impl From<NonSemantic> for Operation
Source§fn from(value: NonSemantic) -> Self
fn from(value: NonSemantic) -> Self
Source§impl From<Synchronization> for Operation
impl From<Synchronization> for Operation
Source§fn from(value: Synchronization) -> Self
fn from(value: Synchronization) -> Self
Source§impl From<TensorIndexingOps> for Operation
impl From<TensorIndexingOps> for Operation
Source§fn from(value: TensorIndexingOps) -> Self
fn from(value: TensorIndexingOps) -> Self
Source§impl OperationReflect for Operation
impl OperationReflect for Operation
Source§fn args(&self) -> Option<Vec<Value>>
fn args(&self) -> Option<Vec<Value>>
Value, returns
None instead.fn args_mut(&mut self) -> Option<Vec<&mut Value>>
Source§fn from_code_and_args(op_code: Self::OpCode, args: &[Value]) -> Option<Self>
fn from_code_and_args(op_code: Self::OpCode, args: &[Value]) -> Option<Self>
None if not all
arguments are Value.Source§fn sanitize_args(&mut self, scope: &Scope)
fn sanitize_args(&mut self, scope: &Scope)
fn read_pointers(&self) -> Vec<Value>
fn write_pointers(&self) -> Vec<Value>
Source§fn is_commutative(&self) -> bool
fn is_commutative(&self) -> bool
impl StructuralPartialEq for Operation
Auto Trait Implementations§
impl !RefUnwindSafe for Operation
impl !Send for Operation
impl !Sync for Operation
impl !UnwindSafe for Operation
impl Freeze for Operation
impl Unpin for Operation
impl UnsafeUnpin for Operation
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.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 more