pub struct KernelParams {
pub workgroup_size: (u32, u32, u32),
pub dispatch_size: (u32, u32, u32),
pub entry_point: String,
}Expand description
Kernel execution parameters
Fields§
§workgroup_size: (u32, u32, u32)Workgroup size (x, y, z)
dispatch_size: (u32, u32, u32)Number of workgroups to dispatch (x, y, z)
entry_point: StringEntry point function name
Implementations§
Source§impl KernelParams
impl KernelParams
Sourcepub fn new(
workgroup_size: (u32, u32, u32),
dispatch_size: (u32, u32, u32),
) -> Self
pub fn new( workgroup_size: (u32, u32, u32), dispatch_size: (u32, u32, u32), ) -> Self
Create new kernel parameters
Sourcepub fn with_workgroup_size(self, x: u32, y: u32, z: u32) -> Self
pub fn with_workgroup_size(self, x: u32, y: u32, z: u32) -> Self
Set workgroup size
Sourcepub fn with_dispatch_size(self, x: u32, y: u32, z: u32) -> Self
pub fn with_dispatch_size(self, x: u32, y: u32, z: u32) -> Self
Set dispatch size
Sourcepub fn with_entry_point(self, entry_point: impl Into<String>) -> Self
pub fn with_entry_point(self, entry_point: impl Into<String>) -> Self
Set entry point
Sourcepub fn total_threads(&self) -> u64
pub fn total_threads(&self) -> u64
Calculate total number of threads
Trait Implementations§
Source§impl Clone for KernelParams
impl Clone for KernelParams
Source§fn clone(&self) -> KernelParams
fn clone(&self) -> KernelParams
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 KernelParams
impl Debug for KernelParams
Auto Trait Implementations§
impl Freeze for KernelParams
impl RefUnwindSafe for KernelParams
impl Send for KernelParams
impl Sync for KernelParams
impl Unpin for KernelParams
impl UnsafeUnpin for KernelParams
impl UnwindSafe for KernelParams
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