sycl_rs/info/
device-info.rs1use sycl_rs_sys::device::ffi;
10
11use crate::{Result, device::Device, info::Info, private::Sealed};
12
13pub struct DeviceType;
15impl Sealed for DeviceType {}
16impl Info for DeviceType {
17 type Item = crate::info::DeviceType;
18 type Target = Device;
19 fn get_item(target: &Self::Target) -> Self::Item {
20 ffi::get_device_type(&target.0)
21 }
22}
23
24pub struct Version;
26impl Sealed for Version {}
27impl Info for Version {
28 type Item = String;
29 type Target = Device;
30 fn get_item(target: &Self::Target) -> Self::Item {
31 ffi::get_version(&target.0)
32 }
33}
34
35pub struct Name;
37impl Sealed for Name {}
38impl Info for Name {
39 type Item = String;
40 type Target = Device;
41 fn get_item(target: &Self::Target) -> Self::Item {
42 ffi::get_name(&target.0)
43 }
44}
45
46pub struct PciBdfAddress;
49impl Sealed for PciBdfAddress {}
50impl Info for PciBdfAddress {
51 type Item = Result<String>;
52 type Target = Device;
53 fn get_item(target: &Self::Target) -> Self::Item {
54 ffi::get_pci_bdf_address(&target.0)
55 }
56}