pub struct KernelOp {
pub kind: KernelOpKind,
pub operands: Vec<u32>,
pub result: Option<u32>,
}Expand description
One lowered op in the kernel body. Operands are referenced by
32-bit id; the id space is per-KernelBody. SoA-friendly: an
emitter walks body.ops linearly and looks up operand ops by id
when needed.
Fields§
§kind: KernelOpKind§operands: Vec<u32>Operand ids into the same KernelBody.ops (or the literal pool
for Literal* kinds - see the per-kind documentation).
result: Option<u32>Result id this op assigns. None for ops with no value
(stores, barriers, returns, structured-control-flow markers).
Implementations§
Source§impl KernelOp
impl KernelOp
Sourcepub fn result_id_count(&self) -> u32
pub fn result_id_count(&self) -> u32
Number of result ids this op defines.
Sourcepub fn result_ids(&self) -> impl Iterator<Item = u32> + '_
pub fn result_ids(&self) -> impl Iterator<Item = u32> + '_
Every result id produced by this op.
Most descriptor ops produce zero or one id. Matrix MMA produces a
compact four-id accumulator tuple starting at result.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for KernelOp
impl<'de> Deserialize<'de> for KernelOp
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for KernelOp
impl StructuralPartialEq for KernelOp
Auto Trait Implementations§
impl Freeze for KernelOp
impl RefUnwindSafe for KernelOp
impl Send for KernelOp
impl Sync for KernelOp
impl Unpin for KernelOp
impl UnsafeUnpin for KernelOp
impl UnwindSafe for KernelOp
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,
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§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.