Skip to main content

occupancy_for_launch

Function occupancy_for_launch 

Source
pub fn occupancy_for_launch(
    config: &LaunchConfig,
    registers_per_thread: u32,
    limits: &SmResourceLimits,
) -> Result<OccupancyResult, GpuOptimError>
Expand description

Convenience wrapper computing occupancy for a crate::backends::LaunchConfig.

The total threads per block is the product of the configured block dimensions, and the per-block shared memory is taken from the launch config’s shared_memory_size. registers_per_thread must be supplied by the caller (it is a property of the compiled kernel, not of the launch geometry).