pub struct KernelLaunchConfig {
pub workgroup_size: (u32, u32, u32),
pub workgroup_count: (u32, u32, u32),
pub shared_memory_size: Option<usize>,
pub stream_id: Option<usize>,
}Expand description
Kernel launch configuration
Fields§
§workgroup_size: (u32, u32, u32)Workgroup size (local work size)
workgroup_count: (u32, u32, u32)Number of workgroups (global work size / workgroup size)
Shared memory size in bytes
stream_id: Option<usize>Stream/queue for asynchronous execution
Implementations§
Source§impl KernelLaunchConfig
impl KernelLaunchConfig
Sourcepub fn linear(global_size: u32, workgroup_size: Option<u32>) -> Self
pub fn linear(global_size: u32, workgroup_size: Option<u32>) -> Self
Create a 1D launch configuration
Sourcepub fn grid_2d(
global_size: (u32, u32),
workgroup_size: Option<(u32, u32)>,
) -> Self
pub fn grid_2d( global_size: (u32, u32), workgroup_size: Option<(u32, u32)>, ) -> Self
Create a 2D launch configuration
Sourcepub fn grid_3d(
global_size: (u32, u32, u32),
workgroup_size: Option<(u32, u32, u32)>,
) -> Self
pub fn grid_3d( global_size: (u32, u32, u32), workgroup_size: Option<(u32, u32, u32)>, ) -> Self
Create a 3D launch configuration
Set shared memory size
Sourcepub fn with_stream(self, stream_id: usize) -> Self
pub fn with_stream(self, stream_id: usize) -> Self
Set execution stream
Sourcepub fn total_threads(&self) -> u64
pub fn total_threads(&self) -> u64
Get total number of threads
Trait Implementations§
Source§impl Clone for KernelLaunchConfig
impl Clone for KernelLaunchConfig
Source§fn clone(&self) -> KernelLaunchConfig
fn clone(&self) -> KernelLaunchConfig
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 moreAuto Trait Implementations§
impl Freeze for KernelLaunchConfig
impl RefUnwindSafe for KernelLaunchConfig
impl Send for KernelLaunchConfig
impl Sync for KernelLaunchConfig
impl Unpin for KernelLaunchConfig
impl UnsafeUnpin for KernelLaunchConfig
impl UnwindSafe for KernelLaunchConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more