17 #ifndef HWLOC_GLIBC_SCHED_H
18 #define HWLOC_GLIBC_SCHED_H
24 #if !defined _GNU_SOURCE || !defined _SCHED_H || (!defined CPU_SETSIZE && !defined sched_priority)
25 #error Please make sure to include sched.h before including glibc-sched.h, and define _GNU_SOURCE before any inclusion of sched.h
34 #ifdef HWLOC_HAVE_CPU_SET
49 static __hwloc_inline
int
51 cpu_set_t *schedset,
size_t schedsetsize)
55 CPU_ZERO_S(schedsetsize, schedset);
57 CPU_SET_S(cpu, schedsetsize, schedset);
58 hwloc_bitmap_foreach_end();
62 assert(schedsetsize ==
sizeof(cpu_set_t));
64 CPU_SET(cpu, schedset);
65 hwloc_bitmap_foreach_end();
77 static __hwloc_inline
int
79 const cpu_set_t *schedset,
size_t schedsetsize)
86 count = CPU_COUNT_S(schedsetsize, schedset);
89 if (CPU_ISSET_S(cpu, schedsetsize, schedset)) {
100 assert(schedsetsize ==
sizeof(cpu_set_t));
101 for(cpu=0; cpu<CPU_SETSIZE; cpu++)
102 if (CPU_ISSET(cpu, schedset))
HWLOC_DECLSPEC void hwloc_bitmap_zero(hwloc_bitmap_t bitmap)
Empty the bitmap bitmap.
#define hwloc_bitmap_foreach_begin(id, bitmap)
Loop macro iterating on bitmap bitmap.
Definition: bitmap.h:265
HWLOC_DECLSPEC void hwloc_bitmap_set(hwloc_bitmap_t bitmap, unsigned id)
Add index id in bitmap bitmap.
High-level hwloc traversal helpers.