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/src/ggml-metal/ggml-metal-context.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 / src / ggml-metal / ggml-metal-context.h` 42 lines ยท 1454 bytes Raw Blame History 1 #pragma once 2 3 #include "ggml-metal-device.h" 4 5 #ifdef __cplusplus 6 extern "C" { 7 #endif 8 9 // 10 // backend context 11 // 12 13 typedef struct ggml_metal * ggml_metal_t; 14 15 ggml_metal_t ggml_metal_init(ggml_metal_device_t dev); 16 void ggml_metal_free(ggml_metal_t ctx); 17 18 const char * ggml_metal_get_name(ggml_metal_t ctx); 19 20 void ggml_metal_synchronize(ggml_metal_t ctx); 21 22 void ggml_metal_set_tensor_async(ggml_metal_t ctx, struct ggml_tensor * tensor, const void * data, size_t offset, size_t size); 23 void ggml_metal_get_tensor_async(ggml_metal_t ctx, const struct ggml_tensor * tensor, void * data, size_t offset, size_t size); 24 bool ggml_metal_cpy_tensor_async(ggml_metal_t ctx_src, ggml_metal_t ctx_dst, const struct ggml_tensor * src, struct ggml_tensor * dst); 25 26 enum ggml_status ggml_metal_graph_compute (ggml_metal_t ctx, struct ggml_cgraph * gf); 27 void ggml_metal_graph_optimize(ggml_metal_t ctx, struct ggml_cgraph * gf); 28 29 void ggml_metal_event_record(ggml_metal_t ctx, ggml_metal_event_t ev); 30 void ggml_metal_event_wait (ggml_metal_t ctx, ggml_metal_event_t ev); 31 32 ggml_metal_event_t ggml_metal_get_ev_cpy(ggml_metal_t ctx); 33 34 void ggml_metal_set_n_cb (ggml_metal_t ctx, int n_cb); 35 void ggml_metal_set_abort_callback (ggml_metal_t ctx, ggml_abort_callback abort_callback, void * user_data); 36 37 bool ggml_metal_supports_family (ggml_metal_t ctx, int family); 38 void ggml_metal_capture_next_compute(ggml_metal_t ctx); 39 40 #ifdef __cplusplus 41 } 42 #endif