Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/ggml/blob/master/include/ggml-cpp.h # ggml [Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `ggml / include / ggml-cpp.h` 39 lines ยท 1652 bytes Raw Blame History 1 #pragma once 2 3 #ifndef __cplusplus 4 #error "This header is for C++ only" 5 #endif 6 7 #include "ggml.h" 8 #include "ggml-alloc.h" 9 #include "ggml-backend.h" 10 #include "gguf.h" 11 #include 12 13 // Smart pointers for ggml types 14 15 // ggml 16 17 struct ggml_context_deleter { void operator()(ggml_context * ctx) { ggml_free(ctx); } }; 18 struct gguf_context_deleter { void operator()(gguf_context * ctx) { gguf_free(ctx); } }; 19 20 typedef std::unique_ptr ggml_context_ptr; 21 typedef std::unique_ptr gguf_context_ptr; 22 23 // ggml-alloc 24 25 struct ggml_gallocr_deleter { void operator()(ggml_gallocr_t galloc) { ggml_gallocr_free(galloc); } }; 26 27 typedef std::unique_ptr ggml_gallocr_ptr; 28 29 // ggml-backend 30 31 struct ggml_backend_deleter { void operator()(ggml_backend_t backend) { ggml_backend_free(backend); } }; 32 struct ggml_backend_buffer_deleter { void operator()(ggml_backend_buffer_t buffer) { ggml_backend_buffer_free(buffer); } }; 33 struct ggml_backend_event_deleter { void operator()(ggml_backend_event_t event) { ggml_backend_event_free(event); } }; 34 struct ggml_backend_sched_deleter { void operator()(ggml_backend_sched_t sched) { ggml_backend_sched_free(sched); } }; 35 36 typedef std::unique_ptr ggml_backend_ptr; 37 typedef std::unique_ptr ggml_backend_buffer_ptr; 38 typedef std::unique_ptr ggml_backend_event_ptr; 39 typedef std::unique_ptr ggml_backend_sched_ptr;