Skip to main content

DeviceParams

Struct DeviceParams 

Source
pub struct DeviceParams {
    pub cc: &'static str,
    pub sm_count: u32,
    pub max_threads_per_sm: u32,
    pub max_warps_per_sm: u32,
    pub max_blocks_per_sm: u32,
    pub smem_per_block_default: u64,
    pub smem_per_sm: u64,
}
Expand description

Per-SM limits by compute capability.

Every field but sm_count is a compute-capability fact, taken from the CUDA C++ Programming Guide’s “Technical Specifications per Compute Capability” table. sm_count is a product fact — two parts at the same capability differ — so each entry names the part its count came from.

An unknown cc is an error, never a guess: a fabricated capacity would produce an occupancy number, and an occupancy number is exactly the sort of thing a reader believes.

Fields§

§cc: &'static str

The capability this row describes, as "<major>.<minor>" — the string --cc is matched against.

§sm_count: u32

Streaming multiprocessors on the named part. Not a capability fact.

Ranking within one kernel’s space is barely sensitive to it: it enters only through waves = grid / (blocks_per_sm * sm_count), a constant divisor that scales every candidate’s cost alike, and it changes an ordering only where the .max(1.0) clamp on waves bites. It matters for reading waves as a number, not for choosing between candidates.

§max_threads_per_sm: u32

Resident threads per SM. With max_warps_per_sm this is the same fact twice — a warp is 32 threads — and a test holds them equal.

§max_warps_per_sm: u32

Resident warps per SM; the occupancy denominator.

§max_blocks_per_sm: u32

Resident thread blocks per SM. Binds before the thread limit for small blocks, which is why a 32-thread block rarely fills an SM.

§smem_per_block_default: u64

Statically allocatable shared memory per block, without the dynamic opt-in. 48 KiB on every architecture here — deliberately flat.

§smem_per_sm: u64

Shared memory per SM. Note this is the per-SM capacity, one KiB above the per-block opt-in maximum on Ampere and later, where the driver reserves 1 KiB.

Trait Implementations§

Source§

impl Clone for DeviceParams

Source§

fn clone(&self) -> DeviceParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DeviceParams

Source§

impl Debug for DeviceParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.