#include "ckernel_engine.h"#include "ck_threadpool.h"#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <errno.h>Go to the source code of this file.
Macros | |
| #define | CK_ADD_PAIR(pid, cid) |
Functions | |
| int | ck_get_num_threads (void) |
| int | ck_get_physical_cores (void) |
| ck_threadpool_t * | ck_get_threadpool (void) |
| static int | ck_parse_env_int (const char *name) |
| void | ck_set_num_threads (int num_threads) |
| void | ck_set_strict_parity (int enabled) |
| int | ck_strict_parity_enabled (void) |
| void | ck_threadpool_init (void) |
| void | ck_threadpool_shutdown (void) |
Variables | |
| static int | ck_strict_parity = 0 |
| static int | g_num_threads = 0 |
| static int | g_threads_initialized = 0 |
| #define CK_ADD_PAIR | ( | pid, | |
| cid | |||
| ) |
| int ck_get_num_threads | ( | void | ) |
Definition at line 178 of file ckernel_strict.c.
References ck_set_num_threads(), g_num_threads, and g_threads_initialized.
Referenced by gemm_blocked_serial(), and global_pool_init().
| int ck_get_physical_cores | ( | void | ) |
Definition at line 62 of file ckernel_strict.c.
References CK_ADD_PAIR.
Referenced by ck_set_num_threads(), and ck_threadpool_create().
| ck_threadpool_t* ck_get_threadpool | ( | void | ) |
Get the global thread pool handle for dispatch. Convenience wrapper — initializes on first call.
Definition at line 218 of file ckernel_strict.c.
References ck_threadpool_global().
|
static |
| void ck_set_num_threads | ( | int | num_threads | ) |
Definition at line 148 of file ckernel_strict.c.
References ck_get_physical_cores(), ck_parse_env_int(), g_num_threads, and g_threads_initialized.
Referenced by ck_get_num_threads().
| void ck_set_strict_parity | ( | int | enabled | ) |
| int ck_strict_parity_enabled | ( | void | ) |
Definition at line 33 of file ckernel_strict.c.
References ck_strict_parity.
Referenced by ck_q8k_activations_enabled(), gemm_avx512_parallel(), gemm_blocked_serial(), gemm_fine_grained_parallel(), gemm_naive_parallel(), gemm_nn_avx512(), gemm_nn_blocked(), gemm_nn_parallel(), gemm_tn_avx512(), gemm_tn_blocked(), and gemm_tn_parallel().
| void ck_threadpool_init | ( | void | ) |
Initialize the global thread pool. Called once during engine startup (e.g., from ck_model_init). Uses ck_get_num_threads() for thread count (respects CK_NUM_THREADS env).
Safe to call multiple times — subsequent calls are no-ops.
Definition at line 198 of file ckernel_strict.c.
References ck_threadpool_global().
| void ck_threadpool_shutdown | ( | void | ) |
Shut down the global thread pool. Called during engine teardown. Workers are joined and freed.
Definition at line 209 of file ckernel_strict.c.
References ck_threadpool_global_destroy().
|
static |
Definition at line 20 of file ckernel_strict.c.
Referenced by ck_set_strict_parity(), and ck_strict_parity_enabled().
|
static |
Definition at line 42 of file ckernel_strict.c.
Referenced by ck_get_num_threads(), and ck_set_num_threads().
|
static |
Definition at line 43 of file ckernel_strict.c.
Referenced by ck_get_num_threads(), and ck_set_num_threads().