pub struct OccupancyCalculator { /* private fields */ }Expand description
CPU-side occupancy estimator — no GPU calls required.
Given device hardware parameters, this struct computes how many warps can be concurrently resident for a given kernel configuration.
Implementations§
Source§impl OccupancyCalculator
impl OccupancyCalculator
Sourcepub fn new(device_info: DeviceOccupancyInfo) -> Self
pub fn new(device_info: DeviceOccupancyInfo) -> Self
Create a new calculator from device occupancy information.
Sourcepub fn device_info(&self) -> &DeviceOccupancyInfo
pub fn device_info(&self) -> &DeviceOccupancyInfo
Return a reference to the underlying device info.
Sourcepub fn estimate_occupancy(
&self,
block_size: u32,
registers_per_thread: u32,
shared_memory: u32,
) -> OccupancyEstimate
pub fn estimate_occupancy( &self, block_size: u32, registers_per_thread: u32, shared_memory: u32, ) -> OccupancyEstimate
Estimate occupancy for the given kernel configuration.
§Parameters
block_size— threads per block.registers_per_thread— registers consumed by each thread.shared_memory— shared memory per block in bytes.
Trait Implementations§
Source§impl Clone for OccupancyCalculator
impl Clone for OccupancyCalculator
Source§fn clone(&self) -> OccupancyCalculator
fn clone(&self) -> OccupancyCalculator
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 OccupancyCalculator
impl RefUnwindSafe for OccupancyCalculator
impl Send for OccupancyCalculator
impl Sync for OccupancyCalculator
impl Unpin for OccupancyCalculator
impl UnsafeUnpin for OccupancyCalculator
impl UnwindSafe for OccupancyCalculator
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