[−][src]Struct rustacuda::device::Device
Opaque handle to a CUDA device.
Implementations
impl Device
[src]
pub fn num_devices() -> CudaResult<u32>
[src]
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);
pub fn get_device(ordinal: u32) -> CudaResult<Device>
[src]
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()?);
pub fn devices() -> CudaResult<Devices>
[src]
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()?); }
pub fn total_memory(self) -> CudaResult<usize>
[src]
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()?);
pub fn name(self) -> CudaResult<String>
[src]
Returns the name of this device.
Example
use rustacuda::device::Device; let device = Device::get_device(0)?; println!("Device Name: {}", device.name()?);
pub fn get_attribute(self, attr: DeviceAttribute) -> CudaResult<i32>
[src]
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
impl Clone for Device
[src]
impl Copy for Device
[src]
impl Debug for Device
[src]
impl Eq for Device
[src]
impl Hash for Device
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Device> for Device
[src]
impl StructuralEq for Device
[src]
impl StructuralPartialEq for Device
[src]
Auto Trait Implementations
impl RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl UnwindSafe for Device
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,