pub struct LaunchGeometry { /* private fields */ }Expand description
Grid, block and dynamic shared-memory dimensions, independent of launch attributes.
Implementations§
Source§impl LaunchGeometry
impl LaunchGeometry
Sourcepub fn create(
grid_dim: Dim3,
block_dim: Dim3,
shared_memory_bytes: usize,
) -> Result<Self>
pub fn create( grid_dim: Dim3, block_dim: Dim3, shared_memory_bytes: usize, ) -> Result<Self>
Creates nonzero grid and block dimensions with a representable shared-memory byte count.
Device and kernel limits are checked during preparation or by CUDA during submission.
§Errors
Returns an error for zero dimensions or a shared-memory byte count exceeding u32::MAX.
Returns the dynamic shared-memory bytes per block.
Replaces the dynamic shared-memory byte count.
§Errors
Returns an error if the byte count exceeds u32::MAX.
Sourcepub fn try_for_1d_grid(element_count: usize, block_size: usize) -> Result<Self>
pub fn try_for_1d_grid(element_count: usize, block_size: usize) -> Result<Self>
Creates a one-dimensional launch covering element_count elements with block_size threads per block.
Each grid axis rounds up to a whole block. Dynamic shared memory starts at zero. Device and kernel limits are checked during preparation or submission.
§Errors
Returns Error::NotPositive if an element extent or block dimension is zero, or Error::OutOfRange if a computed grid dimension or supplied block dimension exceeds u32::MAX.
Sourcepub fn for_1d_grid(element_count: usize, block_size: usize) -> Self
pub fn for_1d_grid(element_count: usize, block_size: usize) -> Self
Creates a one-dimensional launch covering element_count elements with block_size threads per block.
Uses the same rounding, shared-memory defaults, and validation as Self::try_for_1d_grid.
§Panics
Panics if an element extent or block dimension is zero, or if a computed grid dimension or supplied block dimension exceeds u32::MAX.
Use Self::try_for_1d_grid to handle these errors.
Sourcepub fn try_for_num_elems(
element_count: usize,
block_size: usize,
) -> Result<Self>
pub fn try_for_num_elems( element_count: usize, block_size: usize, ) -> Result<Self>
Creates a one-dimensional launch covering element_count elements with block_size threads per block.
Equivalent to Self::try_for_1d_grid.
Each grid axis rounds up to a whole block. Dynamic shared memory starts at zero. Device and kernel limits are checked during preparation or submission.
§Errors
Returns Error::NotPositive if an element extent or block dimension is zero, or Error::OutOfRange if a computed grid dimension or supplied block dimension exceeds u32::MAX.
Sourcepub fn for_num_elems(element_count: usize, block_size: usize) -> Self
pub fn for_num_elems(element_count: usize, block_size: usize) -> Self
Creates a one-dimensional launch covering element_count elements with block_size threads per block.
Equivalent to Self::try_for_1d_grid.
Uses the same rounding, shared-memory defaults, and validation as Self::try_for_num_elems.
§Panics
Panics if an element extent or block dimension is zero, or if a computed grid dimension or supplied block dimension exceeds u32::MAX.
Use Self::try_for_num_elems to handle these errors.
Sourcepub fn try_for_2d_grid(
width: usize,
height: usize,
block_width: usize,
block_height: usize,
) -> Result<Self>
pub fn try_for_2d_grid( width: usize, height: usize, block_width: usize, block_height: usize, ) -> Result<Self>
Creates a two-dimensional launch covering width by height elements with the supplied block width and height.
Each grid axis rounds up to a whole block. Dynamic shared memory starts at zero. Device and kernel limits are checked during preparation or submission.
§Errors
Returns Error::NotPositive if an element extent or block dimension is zero, or Error::OutOfRange if a computed grid dimension or supplied block dimension exceeds u32::MAX.
Sourcepub fn for_2d_grid(
width: usize,
height: usize,
block_width: usize,
block_height: usize,
) -> Self
pub fn for_2d_grid( width: usize, height: usize, block_width: usize, block_height: usize, ) -> Self
Creates a two-dimensional launch covering width by height elements with the supplied block width and height.
Uses the same rounding, shared-memory defaults, and validation as Self::try_for_2d_grid.
§Panics
Panics if an element extent or block dimension is zero, or if a computed grid dimension or supplied block dimension exceeds u32::MAX.
Use Self::try_for_2d_grid to handle these errors.
Sourcepub fn try_for_3d_grid(
width: usize,
height: usize,
depth: usize,
block_width: usize,
block_height: usize,
block_depth: usize,
) -> Result<Self>
pub fn try_for_3d_grid( width: usize, height: usize, depth: usize, block_width: usize, block_height: usize, block_depth: usize, ) -> Result<Self>
Creates a three-dimensional launch covering width by height by depth elements with the supplied block dimensions.
Each grid axis rounds up to a whole block. Dynamic shared memory starts at zero. Device and kernel limits are checked during preparation or submission.
§Errors
Returns Error::NotPositive if an element extent or block dimension is zero, or Error::OutOfRange if a computed grid dimension or supplied block dimension exceeds u32::MAX.
Sourcepub fn for_3d_grid(
width: usize,
height: usize,
depth: usize,
block_width: usize,
block_height: usize,
block_depth: usize,
) -> Self
pub fn for_3d_grid( width: usize, height: usize, depth: usize, block_width: usize, block_height: usize, block_depth: usize, ) -> Self
Creates a three-dimensional launch covering width by height by depth elements with the supplied block dimensions.
Uses the same rounding, shared-memory defaults, and validation as Self::try_for_3d_grid.
§Panics
Panics if an element extent or block dimension is zero, or if a computed grid dimension or supplied block dimension exceeds u32::MAX.
Use Self::try_for_3d_grid to handle these errors.
Trait Implementations§
Source§impl Clone for LaunchGeometry
impl Clone for LaunchGeometry
impl Copy for LaunchGeometry
Source§impl Debug for LaunchGeometry
impl Debug for LaunchGeometry
impl Eq for LaunchGeometry
Source§impl From<LaunchGeometry> for LaunchConfig
impl From<LaunchGeometry> for LaunchConfig
Source§fn from(geometry: LaunchGeometry) -> Self
fn from(geometry: LaunchGeometry) -> Self
Source§impl PartialEq for LaunchGeometry
impl PartialEq for LaunchGeometry
impl StructuralPartialEq for LaunchGeometry
Auto Trait Implementations§
impl Forget for LaunchGeometry
impl Freeze for LaunchGeometry
impl Move for LaunchGeometry
impl RefUnwindSafe for LaunchGeometry
impl Send for LaunchGeometry
impl Sync for LaunchGeometry
impl Unpin for LaunchGeometry
impl UnsafeUnpin for LaunchGeometry
impl UnwindSafe for LaunchGeometry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.