77extern "C" {
88#endif
99
10- // Scheduling priorities
11- enum ggml_sched_priority {
12- GGML_SCHED_PRIO_NORMAL ,
13- GGML_SCHED_PRIO_MEDIUM ,
14- GGML_SCHED_PRIO_HIGH ,
15- GGML_SCHED_PRIO_REALTIME
16- };
17-
18- // Threadpool params
19- // Use ggml_threadpool_params_default() or ggml_threadpool_params_init() to populate the defaults
20- struct ggml_threadpool_params {
21- bool cpumask [GGML_MAX_N_THREADS ]; // mask of cpu cores (all-zeros means use default affinity settings)
22- int n_threads ; // number of threads
23- enum ggml_sched_priority prio ; // thread priority
24- uint32_t poll ; // polling level (0 - no polling, 100 - aggressive polling)
25- bool strict_cpu ; // strict cpu placement
26- bool paused ; // start in paused state
27- };
28-
29- struct ggml_threadpool ; // forward declaration, see ggml.c
30-
31- typedef struct ggml_threadpool * ggml_threadpool_t ;
32-
3310 // the compute plan that needs to be prepared for ggml_graph_compute()
3411 // since https://github.com/ggerganov/ggml/issues/287
3512 struct ggml_cplan {
@@ -75,14 +52,11 @@ extern "C" {
7552 GGML_BACKEND_API float ggml_get_f32_nd (const struct ggml_tensor * tensor , int i0 , int i1 , int i2 , int i3 );
7653 GGML_BACKEND_API void ggml_set_f32_nd (const struct ggml_tensor * tensor , int i0 , int i1 , int i2 , int i3 , float value );
7754
78- GGML_BACKEND_API struct ggml_threadpool_params ggml_threadpool_params_default (int n_threads );
79- GGML_BACKEND_API void ggml_threadpool_params_init (struct ggml_threadpool_params * p , int n_threads );
80- GGML_BACKEND_API bool ggml_threadpool_params_match (const struct ggml_threadpool_params * p0 , const struct ggml_threadpool_params * p1 );
81- GGML_BACKEND_API struct ggml_threadpool * ggml_threadpool_new (struct ggml_threadpool_params * params );
82- GGML_BACKEND_API void ggml_threadpool_free (struct ggml_threadpool * threadpool );
83- GGML_BACKEND_API int ggml_threadpool_get_n_threads (struct ggml_threadpool * threadpool );
84- GGML_BACKEND_API void ggml_threadpool_pause (struct ggml_threadpool * threadpool );
85- GGML_BACKEND_API void ggml_threadpool_resume (struct ggml_threadpool * threadpool );
55+ GGML_BACKEND_API struct ggml_threadpool * ggml_threadpool_new (struct ggml_threadpool_params * params );
56+ GGML_BACKEND_API void ggml_threadpool_free (struct ggml_threadpool * threadpool );
57+ GGML_BACKEND_API int ggml_threadpool_get_n_threads (struct ggml_threadpool * threadpool );
58+ GGML_BACKEND_API void ggml_threadpool_pause (struct ggml_threadpool * threadpool );
59+ GGML_BACKEND_API void ggml_threadpool_resume (struct ggml_threadpool * threadpool );
8660
8761 // ggml_graph_plan() has to be called before ggml_graph_compute()
8862 // when plan.work_size > 0, caller must allocate memory for plan.work_data
@@ -104,10 +78,10 @@ extern "C" {
10478 GGML_BACKEND_API int ggml_cpu_has_sse3 (void );
10579 GGML_BACKEND_API int ggml_cpu_has_ssse3 (void );
10680 GGML_BACKEND_API int ggml_cpu_has_avx (void );
81+ GGML_BACKEND_API int ggml_cpu_has_avx_vnni (void );
10782 GGML_BACKEND_API int ggml_cpu_has_avx2 (void );
10883 GGML_BACKEND_API int ggml_cpu_has_f16c (void );
10984 GGML_BACKEND_API int ggml_cpu_has_fma (void );
110- GGML_BACKEND_API int ggml_cpu_has_avx_vnni (void );
11185 GGML_BACKEND_API int ggml_cpu_has_avx512 (void );
11286 GGML_BACKEND_API int ggml_cpu_has_avx512_vbmi (void );
11387 GGML_BACKEND_API int ggml_cpu_has_avx512_vnni (void );
0 commit comments