pub struct KernelAssertions;Expand description
Convenience assertion helpers that produce DebugEvents instead of
panicking, suitable for GPU kernel emulation / validation.
Implementations§
Source§impl KernelAssertions
impl KernelAssertions
Sourcepub fn assert_bounds(index: usize, len: usize, name: &str) -> Option<DebugEvent>
pub fn assert_bounds(index: usize, len: usize, name: &str) -> Option<DebugEvent>
Assert that index < len. Returns an event if the assertion fails.
Sourcepub fn assert_not_nan(value: f64, name: &str) -> Option<DebugEvent>
pub fn assert_not_nan(value: f64, name: &str) -> Option<DebugEvent>
Assert that value is not NaN. Returns an event if it is.
Sourcepub fn assert_finite(value: f64, name: &str) -> Option<DebugEvent>
pub fn assert_finite(value: f64, name: &str) -> Option<DebugEvent>
Assert that value is finite (not NaN and not Inf). Returns an event
if it is not.
Sourcepub fn assert_positive(value: f64, name: &str) -> Option<DebugEvent>
pub fn assert_positive(value: f64, name: &str) -> Option<DebugEvent>
Assert that value is strictly positive. Returns an event if it is
not (including NaN, zero, and negative values).
Trait Implementations§
Source§impl Clone for KernelAssertions
impl Clone for KernelAssertions
Source§fn clone(&self) -> KernelAssertions
fn clone(&self) -> KernelAssertions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KernelAssertions
impl Debug for KernelAssertions
impl Copy for KernelAssertions
Auto Trait Implementations§
impl Freeze for KernelAssertions
impl RefUnwindSafe for KernelAssertions
impl Send for KernelAssertions
impl Sync for KernelAssertions
impl Unpin for KernelAssertions
impl UnsafeUnpin for KernelAssertions
impl UnwindSafe for KernelAssertions
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