pub struct CpuKernel {
pub workgroup_size: [u32; 3],
}Expand description
A CPU compute kernel: runs f(global_id) for every invocation in the
workgroup grid, in parallel across a simple thread-per-row scheme.
Fields§
§workgroup_size: [u32; 3]Implementations§
Source§impl CpuKernel
impl CpuKernel
pub fn new(workgroup_size: [u32; 3]) -> Self
Sourcepub fn dispatch<F>(&self, groups: [u32; 3], f: F)
pub fn dispatch<F>(&self, groups: [u32; 3], f: F)
Dispatch the kernel on CPU. Calls f(global_x, global_y, global_z)
for every invocation.
Sourcepub fn total_invocations(&self, groups: [u32; 3]) -> u64
pub fn total_invocations(&self, groups: [u32; 3]) -> u64
Total number of invocations for the given dispatch size.
Auto Trait Implementations§
impl Freeze for CpuKernel
impl RefUnwindSafe for CpuKernel
impl Send for CpuKernel
impl Sync for CpuKernel
impl Unpin for CpuKernel
impl UnsafeUnpin for CpuKernel
impl UnwindSafe for CpuKernel
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.