7
7
extern "C" {
8
8
#endif
9
9
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
-
33
10
// the compute plan that needs to be prepared for ggml_graph_compute()
34
11
// since https://github.com/ggerganov/ggml/issues/287
35
12
struct ggml_cplan {
@@ -75,14 +52,11 @@ extern "C" {
75
52
GGML_BACKEND_API float ggml_get_f32_nd (const struct ggml_tensor * tensor , int i0 , int i1 , int i2 , int i3 );
76
53
GGML_BACKEND_API void ggml_set_f32_nd (const struct ggml_tensor * tensor , int i0 , int i1 , int i2 , int i3 , float value );
77
54
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 );
86
60
87
61
// ggml_graph_plan() has to be called before ggml_graph_compute()
88
62
// when plan.work_size > 0, caller must allocate memory for plan.work_data
@@ -104,10 +78,10 @@ extern "C" {
104
78
GGML_BACKEND_API int ggml_cpu_has_sse3 (void );
105
79
GGML_BACKEND_API int ggml_cpu_has_ssse3 (void );
106
80
GGML_BACKEND_API int ggml_cpu_has_avx (void );
81
+ GGML_BACKEND_API int ggml_cpu_has_avx_vnni (void );
107
82
GGML_BACKEND_API int ggml_cpu_has_avx2 (void );
108
83
GGML_BACKEND_API int ggml_cpu_has_f16c (void );
109
84
GGML_BACKEND_API int ggml_cpu_has_fma (void );
110
- GGML_BACKEND_API int ggml_cpu_has_avx_vnni (void );
111
85
GGML_BACKEND_API int ggml_cpu_has_avx512 (void );
112
86
GGML_BACKEND_API int ggml_cpu_has_avx512_vbmi (void );
113
87
GGML_BACKEND_API int ggml_cpu_has_avx512_vnni (void );
0 commit comments