cubecl_runtime/device/cpu.rs
1use cubecl_common::device::{Device, DeviceId};
2
3/// The device of the CPU runtime. There is only one.
4#[derive(new, Clone, PartialEq, Eq, Default, Hash, Debug)]
5pub struct CpuDevice;
6
7impl Device for CpuDevice {
8 fn from_id(_device_id: DeviceId) -> Self {
9 Self
10 }
11
12 fn to_id(&self) -> DeviceId {
13 DeviceId {
14 type_id: 0,
15 index_id: 0,
16 }
17 }
18}