13 #ifndef HWLOC_BITMAP_H
14 #define HWLOC_BITMAP_H
16 #include <hwloc/autogen/config.h>
94 HWLOC_DECLSPEC hwloc_bitmap_t
hwloc_bitmap_dup(hwloc_const_bitmap_t bitmap) __hwloc_attribute_malloc;
97 HWLOC_DECLSPEC
void hwloc_bitmap_copy(hwloc_bitmap_t dst, hwloc_const_bitmap_t src);
113 HWLOC_DECLSPEC
int hwloc_bitmap_snprintf(
char * __hwloc_restrict buf,
size_t buflen, hwloc_const_bitmap_t bitmap);
123 HWLOC_DECLSPEC
int hwloc_bitmap_sscanf(hwloc_bitmap_t bitmap, const
char * __hwloc_restrict
string);
250 HWLOC_DECLSPEC
unsigned long hwloc_bitmap_to_ulong(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
259 HWLOC_DECLSPEC
int hwloc_bitmap_isset(hwloc_const_bitmap_t bitmap,
unsigned id) __hwloc_attribute_pure;
265 HWLOC_DECLSPEC
int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
273 HWLOC_DECLSPEC
int hwloc_bitmap_isfull(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
279 HWLOC_DECLSPEC
int hwloc_bitmap_first(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
287 HWLOC_DECLSPEC
int hwloc_bitmap_next(hwloc_const_bitmap_t bitmap,
int prev) __hwloc_attribute_pure;
293 HWLOC_DECLSPEC
int hwloc_bitmap_last(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
302 HWLOC_DECLSPEC
int hwloc_bitmap_weight(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure;
319 #define hwloc_bitmap_foreach_begin(id, bitmap) \
321 assert(hwloc_bitmap_weight(bitmap) != -1); \
322 for (id = hwloc_bitmap_first(bitmap); \
323 (unsigned) id != (unsigned) -1; \
324 id = hwloc_bitmap_next(bitmap, id)) {
333 #define hwloc_bitmap_foreach_end() \
346 HWLOC_DECLSPEC
void hwloc_bitmap_or (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2);
352 HWLOC_DECLSPEC
void hwloc_bitmap_and (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2);
358 HWLOC_DECLSPEC
void hwloc_bitmap_andnot (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2);
364 HWLOC_DECLSPEC
void hwloc_bitmap_xor (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2);
370 HWLOC_DECLSPEC
void hwloc_bitmap_not (hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap);
381 HWLOC_DECLSPEC
int hwloc_bitmap_intersects (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure;
389 HWLOC_DECLSPEC
int hwloc_bitmap_isincluded (hwloc_const_bitmap_t sub_bitmap, hwloc_const_bitmap_t super_bitmap) __hwloc_attribute_pure;
395 HWLOC_DECLSPEC
int hwloc_bitmap_isequal (hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure;
414 HWLOC_DECLSPEC
int hwloc_bitmap_compare_first(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure;
433 HWLOC_DECLSPEC
int hwloc_bitmap_compare(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure;