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-hexagon/htp/work-queue.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-hexagon / htp / work-queue.h` 38 lines ยท 1182 bytes Raw Blame History 1 #ifndef HTP_WORK_QUEUE_H 2 #define HTP_WORK_QUEUE_H 3 4 #include 5 #include 6 #include 7 8 typedef void (*work_queue_func_t)(unsigned int n, unsigned int i, void *); 9 10 struct work_queue_s; 11 typedef struct work_queue_s * work_queue_t; 12 13 #define WORK_QUEUE_MAX_N_THREADS 10 14 15 size_t work_queue_sizeof(uint32_t n_threads, uint32_t capacity, uint32_t stack_size); 16 size_t work_queue_alignof(void); 17 work_queue_t work_queue_init(void * ptr, uint32_t n_threads, uint32_t capacity, uint32_t stack_size); 18 void work_queue_free(work_queue_t q); 19 20 void work_queue_wakeup(work_queue_t q); 21 void work_queue_suspend(work_queue_t q); 22 23 bool work_queue_run_async(work_queue_t q, work_queue_func_t func, void * data, unsigned int n); 24 25 static inline bool work_queue_run(work_queue_t q, work_queue_func_t func, void * data, unsigned int n) { 26 if (n <= 1) { 27 func(n, 0, data); 28 return true; 29 } 30 return work_queue_run_async(q, func, data, n); 31 } 32 33 // Legacy compatibility 34 typedef work_queue_func_t worker_callback_t; 35 #define worker_pool_run_func work_queue_run 36 #define worker_pool work_queue 37 38 #endif // #ifndef HTP_WORK_QUEUE_H