1use cubecl_common::device::{Device, DeviceId};
2use cubecl_runtime::client::ComputeClient;
3
4#[derive(Hash, PartialEq, Eq, Debug, Clone)]
6pub struct CubeTuneId {
7    device: DeviceId,
8    name: &'static str,
9}
10
11impl CubeTuneId {
12    pub fn new<R: crate::Runtime>(client: &ComputeClient<R::Server>, device: &R::Device) -> Self {
14        Self {
15            device: device.to_id(),
16            name: R::name(client),
17        }
18    }
19}
20
21impl core::fmt::Display for CubeTuneId {
22    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23        f.write_fmt(format_args!(
24            "device-{}-{}-{}",
25            self.device.type_id, self.device.index_id, self.name
26        ))
27    }
28}