pub enum KernelClass {
Copy,
Map,
Transcendental,
Reduce,
}Expand description
Serial cost class of a kernel; see the module documentation of strided-basic/src/cost.rs for the
table.
§Examples
use strided_basic::execution::KernelClass;
assert!(KernelClass::Transcendental.ns_per_element() > KernelClass::Map.ns_per_element());
// 1e6 elements at the rate of this host's class.
let ns = KernelClass::Map.ns_per_element() * 1e6;
assert_eq!(KernelClass::Map.estimate(1_000_000).as_nanos() as f64, ns.round());Variants§
Copy
Copies, fills, permutations and index gathers.
Map
Element-wise arithmetic and fused arithmetic chains.
Transcendental
exp-like functions.
Reduce
Reductions and line kernels that read each source element once.
Implementations§
Source§impl KernelClass
impl KernelClass
Sourcepub fn ns_per_element(self) -> f64
pub fn ns_per_element(self) -> f64
Serial throughput of the class in nanoseconds per element on this host
(ns_per_element_of of HostClass::detect()).
Sourcepub const fn ns_per_element_of(self, host: HostClass) -> f64
pub const fn ns_per_element_of(self, host: HostClass) -> f64
Serial throughput of the class in nanoseconds per element on a host class (the table in the module documentation).
Trait Implementations§
Source§impl Clone for KernelClass
impl Clone for KernelClass
impl Copy for KernelClass
Source§impl Debug for KernelClass
impl Debug for KernelClass
impl Eq for KernelClass
Source§impl Hash for KernelClass
impl Hash for KernelClass
Source§impl PartialEq for KernelClass
impl PartialEq for KernelClass
impl StructuralPartialEq for KernelClass
Auto Trait Implementations§
impl Freeze for KernelClass
impl RefUnwindSafe for KernelClass
impl Send for KernelClass
impl Sync for KernelClass
impl Unpin for KernelClass
impl UnsafeUnpin for KernelClass
impl UnwindSafe for KernelClass
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