← Back to C-Kernel-Engine Docs Doxygen Source Documentation
Loading...
Searching...
No Matches
ck_topology.h File Reference

Go to the source code of this file.

Functions

int ck_topology_allowed_cpus (void)
int ck_topology_big_cpus (int *cpus, int max_cpus)
int ck_topology_heterogeneous (void)

Function Documentation

◆ ck_topology_allowed_cpus()

int ck_topology_allowed_cpus ( void )

Definition at line 142 of file ck_topology.c.

143{
144 pthread_once(&g_topology_once, topology_init);
145 return g_topology.n_allowed;
146}
static pthread_once_t g_topology_once
Definition ck_topology.c:52
static ck_topology_state_t g_topology
Definition ck_topology.c:51
static void topology_init(void)

References g_topology, g_topology_once, and topology_init().

◆ ck_topology_big_cpus()

int ck_topology_big_cpus ( int * cpus,
int max_cpus )

Definition at line 154 of file ck_topology.c.

155{
156 pthread_once(&g_topology_once, topology_init);
157 if (!cpus || max_cpus <= 0) return 0;
158 int n = g_topology.n_big;
159 if (n > max_cpus) n = max_cpus;
160 for (int i = 0; i < n; ++i) {
161 cpus[i] = g_topology.big_cpus[i];
162 }
163 return n;
164}

References g_topology, g_topology_once, and topology_init().

Referenced by ck_threadpool_maybe_pin_big_cores().

◆ ck_topology_heterogeneous()

int ck_topology_heterogeneous ( void )

Definition at line 148 of file ck_topology.c.

149{
150 pthread_once(&g_topology_once, topology_init);
151 return g_topology.heterogeneous;
152}

References g_topology, g_topology_once, and topology_init().

Referenced by ck_threadpool_maybe_pin_big_cores().