1
0
Fork 0
mirror of https://github.com/TransparentLC/opencl_vanity_gpg.git synced 2025-10-20 15:24:08 +00:00

chore: better list devices

This commit is contained in:
GZTime 2025-01-09 12:32:17 +08:00
parent 329649b9ad
commit cb5eca7d82
No known key found for this signature in database
GPG key ID: 373640C748EA3E19
2 changed files with 4 additions and 10 deletions

View file

@ -24,7 +24,10 @@ fn main() -> anyhow::Result<()> {
let device_list = utils::DeviceList::new()?; let device_list = utils::DeviceList::new()?;
if ARGS.list_device { if ARGS.list_device {
info!("Available OpenCL devices: \n{:?}", device_list); info!("Available OpenCL devices: \n");
for (i, device) in device_list.iter().enumerate() {
println!("Device #{} - {:?}", i, device);
}
return Ok(()); return Ok(());
} }

View file

@ -76,12 +76,3 @@ impl std::ops::Deref for DeviceList {
&self.0 &self.0
} }
} }
impl std::fmt::Debug for DeviceList {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
for (index, device) in self.0.iter().enumerate() {
writeln!(f, "Device #{} - {:?}\n", index, device)?;
}
Ok(())
}
}