pub struct GgmlBackend { /* private fields */ }Expand description
A safe wrapper around ggml_backend.
Implementations§
Source§impl GgmlBackend
impl GgmlBackend
Sourcepub fn set_n_threads(&self, n_threads: i32)
pub fn set_n_threads(&self, n_threads: i32)
Set the number of threads for the CPU backend.
Sourcepub fn alloc_ctx_tensors(&self, ctx: &GgmlContext) -> *mut ggml_backend_buffer
pub fn alloc_ctx_tensors(&self, ctx: &GgmlContext) -> *mut ggml_backend_buffer
Allocate all tensors in a context on this backend.
Returns the buffer handle which must be kept alive.
Sourcepub fn graph_compute(&self, graph: &mut GgmlGraph)
pub fn graph_compute(&self, graph: &mut GgmlGraph)
Compute a graph.
Sourcepub fn default_buffer_type(&self) -> ggml_backend_buffer_type_t
pub fn default_buffer_type(&self) -> ggml_backend_buffer_type_t
Get the default buffer type for this backend.
Sourcepub fn as_ptr(&self) -> ggml_backend_t
pub fn as_ptr(&self) -> ggml_backend_t
Get the raw backend pointer.
Trait Implementations§
Source§impl Debug for GgmlBackend
impl Debug for GgmlBackend
Auto Trait Implementations§
impl Freeze for GgmlBackend
impl RefUnwindSafe for GgmlBackend
impl !Send for GgmlBackend
impl !Sync for GgmlBackend
impl Unpin for GgmlBackend
impl UnsafeUnpin for GgmlBackend
impl UnwindSafe for GgmlBackend
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