style: format Rust workspace
This commit is contained in:
@@ -48,9 +48,7 @@ pub fn device_info(device: u32) -> Result<DeviceInfo> {
|
||||
// Heap-allocate oversized buffer for cudaDeviceProp (layout varies by CUDA version).
|
||||
// CUDA 12.x struct is ~5-6 KB; use 32 KB to guard against future growth.
|
||||
let mut prop_buf = vec![0u8; 32768];
|
||||
error::check(unsafe {
|
||||
ffi::cudaGetDeviceProperties(prop_buf.as_mut_ptr(), device as i32)
|
||||
})?;
|
||||
error::check(unsafe { ffi::cudaGetDeviceProperties(prop_buf.as_mut_ptr(), device as i32) })?;
|
||||
// Name is always the first field: char[256].
|
||||
let name = unsafe { CStr::from_ptr(prop_buf.as_ptr() as *const c_char) }
|
||||
.to_string_lossy()
|
||||
|
||||
Reference in New Issue
Block a user