pub struct LlamaBackendDevice { /* private fields */ }Expand description
Opaque ggml backend device handle returned by LlamaModel::get_device.
Use Self::name, Self::description, Self::device_type, and
Self::memory to inspect the device. The handle is valid for the lifetime
of the parent LlamaModel.
Implementations§
Source§impl LlamaBackendDevice
impl LlamaBackendDevice
Sourcepub fn name(&self) -> Result<&str, StringFromModelError>
pub fn name(&self) -> Result<&str, StringFromModelError>
Human-readable device name (e.g. CUDA0, Metal).
§Errors
Returns an error when the name pointer is null or not valid UTF-8.
Sourcepub fn description(&self) -> Result<&str, StringFromModelError>
pub fn description(&self) -> Result<&str, StringFromModelError>
Longer device description (often includes hardware name).
§Errors
Returns an error when the description pointer is null or not valid UTF-8.
Sourcepub fn device_type(&self) -> LlamaBackendDeviceType
pub fn device_type(&self) -> LlamaBackendDeviceType
Device class (CPU, GPU, integrated GPU, …).
Trait Implementations§
Source§impl Clone for LlamaBackendDevice
impl Clone for LlamaBackendDevice
Source§fn clone(&self) -> LlamaBackendDevice
fn clone(&self) -> LlamaBackendDevice
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LlamaBackendDevice
Source§impl Debug for LlamaBackendDevice
impl Debug for LlamaBackendDevice
impl Eq for LlamaBackendDevice
Source§impl PartialEq for LlamaBackendDevice
impl PartialEq for LlamaBackendDevice
Source§fn eq(&self, other: &LlamaBackendDevice) -> bool
fn eq(&self, other: &LlamaBackendDevice) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LlamaBackendDevice
Auto Trait Implementations§
impl !Send for LlamaBackendDevice
impl !Sync for LlamaBackendDevice
impl Freeze for LlamaBackendDevice
impl RefUnwindSafe for LlamaBackendDevice
impl Unpin for LlamaBackendDevice
impl UnsafeUnpin for LlamaBackendDevice
impl UnwindSafe for LlamaBackendDevice
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