1use cubecl_common::device::{Device, DeviceId};
2
3pub const AMD_MAX_BINDINGS: u32 = 1024;
8
9#[derive(new, Clone, PartialEq, Eq, Default, Hash)]
10pub struct AmdDevice {
11 pub index: usize,
12}
13
14impl core::fmt::Debug for AmdDevice {
15 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16 f.write_fmt(format_args!("AmdDevice({})", self.index))
17 }
18}
19
20impl Device for AmdDevice {
21 fn from_id(device_id: DeviceId) -> Self {
22 Self {
23 index: device_id.index_id as usize,
24 }
25 }
26
27 fn to_id(&self) -> DeviceId {
28 DeviceId {
29 type_id: 0,
30 index_id: self.index as u16,
31 }
32 }
33}