pub struct ScalarKernelIr { /* private fields */ }Expand description
Validated IR for a kernel with one scalar output.
Implementations§
Source§impl ScalarKernelIr
impl ScalarKernelIr
Sourcepub fn new(
values: Vec<KernelValue>,
root: KernelValueId,
) -> Result<Self, KernelIrError>
pub fn new( values: Vec<KernelValue>, root: KernelValueId, ) -> Result<Self, KernelIrError>
Validates values and constructs a scalar kernel rooted at root.
§Errors
Returns KernelIrError when the value list is empty, root or an
operand is out of bounds, values are not topologically ordered, a
value’s kind or class is inconsistent with its instruction, or the
root is not scalar.
Sourcepub fn validate(&self) -> Result<(), KernelIrError>
pub fn validate(&self) -> Result<(), KernelIrError>
Revalidates ordering, types, classes, and the scalar root.
§Errors
Returns KernelIrError when the IR is empty, its root or an operand
is out of bounds, its values are not topologically ordered, or a
value’s kind, class, or shape is inconsistent with its instruction.
Sourcepub fn values(&self) -> &[KernelValue]
pub fn values(&self) -> &[KernelValue]
Returns all IR values in topological order.
Sourcepub fn root(&self) -> KernelValueId
pub fn root(&self) -> KernelValueId
Returns the scalar output identifier.
Trait Implementations§
Source§impl Clone for ScalarKernelIr
impl Clone for ScalarKernelIr
Source§fn clone(&self) -> ScalarKernelIr
fn clone(&self) -> ScalarKernelIr
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 moreAuto Trait Implementations§
impl Freeze for ScalarKernelIr
impl RefUnwindSafe for ScalarKernelIr
impl Send for ScalarKernelIr
impl Sync for ScalarKernelIr
impl Unpin for ScalarKernelIr
impl UnsafeUnpin for ScalarKernelIr
impl UnwindSafe for ScalarKernelIr
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