vyre-wgpu 0.1.0

wgpu backend for vyre IR — implements VyreBackend, owns GPU runtime, buffer pool, pipeline cache
Documentation
use vyre::ops::graph::MAX_BFS_QUEUE;
/// Compute the maximum BFS queue slots that fit in the device's workgroup memory.
///
/// The BFS kernel stores a `var<workgroup> queue: array<u32, N>` which occupies
/// `N * 4` bytes of shared memory. This function queries
/// `device.limits().max_compute_workgroup_storage_size` and returns the largest
/// N that fits, clamped to [`MAX_BFS_QUEUE`].
///
/// If `toml_override` is `Some(n)`, that value is used directly but still
/// clamped to the device's physical limit to prevent silent pipeline creation
/// failures.
#[must_use]
pub fn bfs_queue_slots_for_device(device: &wgpu::Device, toml_override: Option<u32>) -> u32 {
    let shared_bytes = device.limits().max_compute_workgroup_storage_size;
    let device_max = shared_bytes / 4;

    let requested = toml_override.unwrap_or(MAX_BFS_QUEUE);
    requested.min(device_max)
}