#[repr(i32)]pub enum LlamaLoadMode {
Auto = -1,
None = 0,
Mmap = 1,
Mlock = 2,
MmapMlock = 3,
DirectIo = 4,
}Expand description
Exact model-file loading strategy exposed by llama.cpp.
llama_load_mode is a signed enum on every target because of the negative
LLAMA_LOAD_MODE_AUTO discriminant, so each variant uses as _ to coerce to
the #[repr(i32)] type (matching token_type).
Variants§
Auto = -1
Pick the strategy from the backend devices’ capabilities: memory-map when every device supports it, otherwise fall back to a plain read. This is llama.cpp’s default.
None = 0
No memory mapping, locking, or direct I/O.
Mmap = 1
Memory-map model files when supported.
Mlock = 2
Read model files normally and lock loaded pages in memory.
MmapMlock = 3
Memory-map model files and lock mapped pages in memory.
DirectIo = 4
Use direct I/O when supported.
Trait Implementations§
Source§impl Clone for LlamaLoadMode
impl Clone for LlamaLoadMode
Source§fn clone(&self) -> LlamaLoadMode
fn clone(&self) -> LlamaLoadMode
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 LlamaLoadMode
Source§impl Debug for LlamaLoadMode
impl Debug for LlamaLoadMode
impl Eq for LlamaLoadMode
Source§impl PartialEq for LlamaLoadMode
impl PartialEq for LlamaLoadMode
impl StructuralPartialEq for LlamaLoadMode
Auto Trait Implementations§
impl Freeze for LlamaLoadMode
impl RefUnwindSafe for LlamaLoadMode
impl Send for LlamaLoadMode
impl Sync for LlamaLoadMode
impl Unpin for LlamaLoadMode
impl UnsafeUnpin for LlamaLoadMode
impl UnwindSafe for LlamaLoadMode
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