cubecl-wgpu 0.11.0

WGPU runtime for the CubeCL
1
2
3
4
5
6
7
8
9
10
11
12
use cubecl_ir::{PhysicalDevice, RegistryEntryId};
use objc2_metal::MTLDevice;
use wgpu::hal;

pub fn describe_card(adapter: &wgpu::Adapter, physical: &mut PhysicalDevice) {
    // SAFETY: the Metal device is only read, while `adapter` keeps it alive.
    let Some(hal_adapter) = (unsafe { adapter.as_hal::<hal::api::Metal>() }) else {
        return;
    };
    let registry_id = hal_adapter.raw_device().registryID();
    physical.registry_entry_id = Some(RegistryEntryId::new(registry_id));
}