pub struct GpuLimits {
pub max_shared_bytes: usize,
pub max_cube_count: (u32, u32, u32),
pub max_units_per_cube: u32,
pub max_cube_dim: (u32, u32, u32),
pub max_binding_bytes: u64,
pub plane_size_min: u32,
pub plane_size_max: u32,
}Expand description
Every device limit that dispatch geometry and staging decisions depend on.
Read once per client via GpuLimits::from_client and passed around as
data. Fields mirror cubecl’s HardwareProperties and
MemoryDeviceProperties.
§Note
The values a backend reports are not uniform. Apple Silicon via wgpu gives 32768 bytes of shared memory, a plane size pinned to 32/32 and a 4 GiB binding limit. Integrated parts report as little as 16384 bytes of shared memory, AMD reports a plane size of 64, and Intel reports a range because the real value depends on register pressure and cannot be queried ahead of time.
Fields§
Shared memory available to one workgroup, in bytes
max_cube_count: (u32, u32, u32)Maximum number of cubes per grid dimension, as (x, y, z)
max_units_per_cube: u32Maximum number of units in a single cube
max_cube_dim: (u32, u32, u32)Maximum extent of a cube per dimension, as (x, y, z)
max_binding_bytes: u64Largest single allocation or binding the device accepts, in bytes
plane_size_min: u32Smallest plane size the device may use
plane_size_max: u32Largest plane size the device may use
Implementations§
Source§impl GpuLimits
impl GpuLimits
Sourcepub fn from_client<R: Runtime>(client: &ComputeClient<R>) -> Self
pub fn from_client<R: Runtime>(client: &ComputeClient<R>) -> Self
Read the limits from a live compute client.
ComputeClient::properties() is a field borrow rather than a device
query, so this is cheap enough to call per allocation. It is still
worth hoisting where several decisions share the same client.
§Params
client- CubeCL compute client for the target device
§Returns
A GpuLimits describing that device.
§Note
The cube-count limit comes from the client properties rather than from
Runtime::max_cube_count(). The latter is a per-backend constant: the
wgpu implementation returns u16::MAX on every device regardless of
what the adapter actually supports, which is a safe floor but discards
headroom on hardware that allows more.
Trait Implementations§
impl Copy for GpuLimits
impl Eq for GpuLimits
impl StructuralPartialEq for GpuLimits
Auto Trait Implementations§
impl Freeze for GpuLimits
impl RefUnwindSafe for GpuLimits
impl Send for GpuLimits
impl Sync for GpuLimits
impl Unpin for GpuLimits
impl UnsafeUnpin for GpuLimits
impl UnwindSafe for GpuLimits
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<C> CloneExpand for Cwhere
C: Clone,
impl<C> CloneExpand for Cwhere
C: Clone,
fn __expand_clone_method(&self, _scope: &mut Scope) -> C
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.