Struct rustacuda::device::Device [−][src]
pub struct Device { /* fields omitted */ }
Expand description
Opaque handle to a CUDA device.
Implementations
Get the number of CUDA-capable devices.
Returns the number of devices with compute-capability 2.0 or greater which are available for execution.
Example
use rustacuda::device::Device; let num_devices = Device::num_devices()?; println!("Number of devices: {}", num_devices);
Get a handle to the ordinal
’th CUDA device.
Ordinal must be in the range 0..num_devices()
. If not, an error will be returned.
Example
use rustacuda::device::Device; let device = Device::get_device(0)?; println!("Device Name: {}", device.name()?);
Return an iterator over all CUDA devices.
Example
use rustacuda::device::Device; for device in Device::devices()? { let device = device?; println!("Device Name: {}", device.name()?); }
Returns the total amount of memory available on the device in bytes.
Example
use rustacuda::device::Device; let device = Device::get_device(0)?; println!("Device Memory: {}", device.total_memory()?);
Returns the name of this device.
Example
use rustacuda::device::Device; let device = Device::get_device(0)?; println!("Device Name: {}", device.name()?);
Returns the UUID of this device.
Example
use rustacuda::device::Device; let device = Device::get_device(0)?; println!("Device UUID: {:?}", device.uuid()?);
Returns information about this device.
Example
use rustacuda::device::{Device, DeviceAttribute}; let device = Device::get_device(0)?; println!("Max Threads Per Block: {}", device.get_attribute(DeviceAttribute::MaxThreadsPerBlock).unwrap());
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Device
impl UnwindSafe for Device
Blanket Implementations
Mutably borrows from an owned value. Read more