pub struct LlamaBackend {}
Expand description
Representation of an initialized llama backend This is required as a parameter for most llama functions as the backend must be initialized before any llama functions are called. This type is proof of initialization.
Implementations§
Source§impl LlamaBackend
impl LlamaBackend
Sourcepub fn init() -> Result<LlamaBackend>
pub fn init() -> Result<LlamaBackend>
Initialize the llama backend (without numa).
§Examples
let backend = LlamaBackend::init()?;
// the llama backend can only be initialized once
assert_eq!(Err(LLamaCppError::BackendAlreadyInitialized), LlamaBackend::init());
Sourcepub fn init_numa(strategy: NumaStrategy) -> Result<LlamaBackend>
pub fn init_numa(strategy: NumaStrategy) -> Result<LlamaBackend>
Initialize the llama backend (with numa).
let llama_backend = LlamaBackend::init_numa(NumaStrategy::MIRROR)?;
Trait Implementations§
Source§impl Debug for LlamaBackend
impl Debug for LlamaBackend
Source§impl Drop for LlamaBackend
Drops the llama backend.
impl Drop for LlamaBackend
Drops the llama backend.
let backend = LlamaBackend::init()?;
drop(backend);
// can be initialized again after being dropped
let backend = LlamaBackend::init()?;
Source§impl PartialEq for LlamaBackend
impl PartialEq for LlamaBackend
impl Eq for LlamaBackend
impl StructuralPartialEq for LlamaBackend
Auto Trait Implementations§
impl Freeze for LlamaBackend
impl RefUnwindSafe for LlamaBackend
impl Send for LlamaBackend
impl Sync for LlamaBackend
impl Unpin for LlamaBackend
impl UnwindSafe for LlamaBackend
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