Generic CPU topology discovery (affinity-aware, capacity-based). More...
Go to the source code of this file.
Macros | |
| #define | _GNU_SOURCE |
| #define | CK_TOPOLOGY_HETEROGENEOUS_RATIO_X100 115 |
| #define | CK_TOPOLOGY_MAX_CPUS 1024 |
| #define | CK_TOPOLOGY_TOP_TIER_PCT 90 |
Functions | |
| int | ck_topology_allowed_cpus (void) |
| int | ck_topology_big_cpus (int *cpus, int max_cpus) |
| int | ck_topology_heterogeneous (void) |
| static void | topology_discover (void) |
| static void | topology_init (void) |
Variables | |
| static ck_topology_state_t | g_topology |
| static pthread_once_t | g_topology_once = PTHREAD_ONCE_INIT |
Generic CPU topology discovery (affinity-aware, capacity-based).
Discovery is cached process-wide (pthread_once) because sysfs content and the process affinity mask are effectively fixed for the lifetime of an inference process, and dispatch paths query this on every GEMV.
Definition in file ck_topology.c.
| #define _GNU_SOURCE |
Definition at line 18 of file ck_topology.c.
| #define CK_TOPOLOGY_HETEROGENEOUS_RATIO_X100 115 |
Definition at line 37 of file ck_topology.c.
Referenced by topology_discover().
| #define CK_TOPOLOGY_MAX_CPUS 1024 |
Definition at line 33 of file ck_topology.c.
Referenced by topology_discover().
| #define CK_TOPOLOGY_TOP_TIER_PCT 90 |
Definition at line 42 of file ck_topology.c.
Referenced by topology_discover().
| int ck_topology_allowed_cpus | ( | void | ) |
Definition at line 142 of file ck_topology.c.
References g_topology, g_topology_once, and topology_init().
| int ck_topology_big_cpus | ( | int * | cpus, |
| int | max_cpus ) |
Definition at line 154 of file ck_topology.c.
References g_topology, g_topology_once, and topology_init().
Referenced by ck_threadpool_maybe_pin_big_cores().
| int ck_topology_heterogeneous | ( | void | ) |
Definition at line 148 of file ck_topology.c.
References g_topology, g_topology_once, and topology_init().
Referenced by ck_threadpool_maybe_pin_big_cores().
|
static |
Definition at line 79 of file ck_topology.c.
References CK_TOPOLOGY_HETEROGENEOUS_RATIO_X100, CK_TOPOLOGY_MAX_CPUS, CK_TOPOLOGY_TOP_TIER_PCT, g_topology, and ids.
Referenced by main(), and topology_init().
|
static |
Definition at line 137 of file ck_topology.c.
References topology_discover().
Referenced by ck_topology_allowed_cpus(), ck_topology_big_cpus(), and ck_topology_heterogeneous().
|
static |
Definition at line 51 of file ck_topology.c.
Referenced by ck_topology_allowed_cpus(), ck_topology_big_cpus(), ck_topology_heterogeneous(), and topology_discover().
|
static |
Definition at line 52 of file ck_topology.c.
Referenced by ck_topology_allowed_cpus(), ck_topology_big_cpus(), and ck_topology_heterogeneous().