Enum candle_core::Device
source · pub enum Device {
Cpu,
Cuda(CudaDevice),
Metal(MetalDevice),
}
Variants§
Implementations§
source§impl Device
impl Device
pub fn new_cuda(ordinal: usize) -> Result<Self>
pub fn new_metal(ordinal: usize) -> Result<Self>
pub fn set_seed(&self, seed: u64) -> Result<()>
pub fn same_device(&self, rhs: &Self) -> bool
pub fn location(&self) -> DeviceLocation
pub fn is_cpu(&self) -> bool
pub fn is_cuda(&self) -> bool
pub fn is_metal(&self) -> bool
pub fn cuda_if_available(ordinal: usize) -> Result<Self>
pub fn synchronize(&self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Device
impl RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl UnwindSafe for Device
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more