first_cpu:-1;}intget_cpu_affinity_(void){returnget_cpu_affinity();}/* Fortran interface *//* * Set CPU affinity to one core. */voidset_cpu_affinity(int cpu){cpu_set_t coremask;/* core affinity mask */CPU_ZERO(&coremask);CPU_SET(cpu,&coremask);if(sched_setaffinity(gettid(),si...
// First, save our cpumask (the user may want it back.) cpu_set_t old; CPU_ZERO(&old); TC_CHECK_EQ(0, sched_getaffinity(0, sizeof(cpu_set_t), &old)); CpuSet old; old.Zero(); TC_CHECK_EQ(0, old.GetAffinity(0)); // Here's the basic idea: if we run on every CPU...
UNUSED(mask); return true; } static bool ggml_thread_apply_priority(int32_t prio) { UNUSED(prio); return true; } #endif static bool ggml_thread_cpumask_is_valid(const bool * mask) { 0 comments on commit 947538a Please sign in to comment. Footer...
CPU_SETSIZE is the total number of CPUs in a CPU set, and __CPU_BITS is the number of bits used in each integer to hold the bit mask. To access the bit for a particular CPU, you divide the CPU number by __CPU_BITS to get the array index, and use the modulus as a lef...