pub struct LaunchConfig {
pub grid_dim: (u32, u32, u32),
pub block_dim: (u32, u32, u32),
pub shared_mem_bytes: u32,
}Expand description
Kernel launch configuration (CUDA-style grid/block decomposition).
For CPU and Metal backends these values are informational only; the actual parallelism strategy is determined by the backend itself.
Fields§
§grid_dim: (u32, u32, u32)Number of thread-blocks (x, y, z).
block_dim: (u32, u32, u32)Threads per block (x, y, z).
Dynamic shared memory per block in bytes.
Implementations§
Source§impl LaunchConfig
impl LaunchConfig
Sourcepub fn for_n_elements(n: usize) -> Self
pub fn for_n_elements(n: usize) -> Self
Auto-compute a 1-D launch configuration for n elements.
Uses a block size of 256 threads and rounds the grid up to cover all
elements. shared_mem_bytes is set to zero.
Sourcepub fn default_1d() -> Self
pub fn default_1d() -> Self
A sensible default 1-D config (1 block of 256 threads).
Trait Implementations§
Source§impl Clone for LaunchConfig
impl Clone for LaunchConfig
Source§fn clone(&self) -> LaunchConfig
fn clone(&self) -> LaunchConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 LaunchConfig
impl Debug for LaunchConfig
Source§impl PartialEq for LaunchConfig
impl PartialEq for LaunchConfig
Source§fn eq(&self, other: &LaunchConfig) -> bool
fn eq(&self, other: &LaunchConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for LaunchConfig
impl Eq for LaunchConfig
impl StructuralPartialEq for LaunchConfig
Auto Trait Implementations§
impl Freeze for LaunchConfig
impl RefUnwindSafe for LaunchConfig
impl Send for LaunchConfig
impl Sync for LaunchConfig
impl Unpin for LaunchConfig
impl UnsafeUnpin for LaunchConfig
impl UnwindSafe for LaunchConfig
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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