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-et/ggml-et-kernels.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-et / ggml-et-kernels.h` 48 lines ยท 2364 bytes Raw Blame History 1 #pragma once 2 3 #include "ggml-et-common.h" 4 5 #include 6 #include 7 #include 8 9 #define ET_TRACE_BUFFER_SIZE (1024 * 1024 * 8UL) 10 11 // Load kernel from file or embedded data and store handle in device context 12 // Returns true on success, false on failure 13 // 14 // Loading strategy: 15 // - If GGML_ET_KERNELS_PATH env var is set: tries to load from ${GGML_ET_KERNELS_PATH}/${kernel_name}.elf 16 // - If file not found or env var not set: falls back to embedded kernel data 17 // - Returns false if kernel cannot be loaded from either source 18 // 19 // Kernel is loaded using the device's default stream 20 bool ggml_et_load_kernel(ggml_backend_et_device_context * dev_ctx, const std::string & kernel_name); 21 22 // Launch kernel with parameters on device's default stream 23 // Performs lazy loading: automatically loads kernel if not already loaded 24 // Kernel path: ${GGML_ET_KERNELS_PATH}/${kernel_name}.elf (default: /opt/et/ggml/kernels/) 25 // Returns true on success, false on failure 26 // Execution is synchronous - waits for completion 27 bool ggml_et_launch_kernel(ggml_backend_et_device_context * dev_ctx, 28 const std::string & kernel_name, 29 void * params, 30 size_t params_size, 31 uint64_t shire_mask = 0xFFFFFFFF, 32 bool enable_print = false, 33 bool sync_error_check = false); 34 35 void ggml_et_uberkernel_begin_graph(ggml_backend_et_uberkernel_context * uk_ctx); 36 bool ggml_et_uberkernel_end_graph(ggml_backend_et_device_context * dev_ctx); 37 void ggml_et_uberkernel_abort_graph(ggml_backend_et_uberkernel_context * uk_ctx); 38 bool ggml_et_uberkernel_failed(const ggml_backend_et_uberkernel_context * uk_ctx); 39 40 // Unload kernel from device and free resources 41 // Safe to call even if kernel not loaded 42 void ggml_et_unload_kernel(ggml_backend_et_device_context * dev_ctx, const std::string & kernel_name); 43 44 // Unload all kernels from device context 45 // Called during device cleanup 46 void ggml_et_unload_all_kernels(ggml_backend_et_device_context * dev_ctx); 47 48 std::vector> ggml_et_get_loaded_kernels(ggml_backend_et_device_context * dev_ctx);