Lines Matching +full:num +full:- +full:ids
2 * kmp_affinity.h -- header for affinity management
5 //===----------------------------------------------------------------------===//
9 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
11 //===----------------------------------------------------------------------===//
30 this->zero(); in Mask()
40 hwloc_bitmap_copy(mask, convert->mask); in copy()
44 hwloc_bitmap_and(mask, mask, convert->mask); in bitwise_and()
48 hwloc_bitmap_or(mask, mask, convert->mask); in bitwise_or()
53 return hwloc_bitmap_isequal(mask, convert->mask); in is_equal()
56 int end() const override { return -1; } in end()
97 if (support->cpubind->set_proc_cpubind) { in set_process_affinity()
112 int group = -1; in get_proc_group()
126 return -1; in get_proc_group()
155 if (topology_support && topology_support->cpubind->set_thisthread_cpubind && in determine_capable()
156 topology_support->cpubind->get_thisthread_cpubind && in determine_capable()
157 topology_support->discovery->pu && !__kmp_hwloc_error) { in determine_capable()
178 KMPAffinity::Mask *allocate_mask_array(int num) override { in allocate_mask_array() argument
179 return new Mask[num]; in allocate_mask_array()
370 mask[i] = convert->mask[i]; in copy()
376 mask[i] &= convert->mask[i]; in bitwise_and()
382 mask[i] |= convert->mask[i]; in bitwise_or()
393 if (mask[i] != convert->mask[i]) in is_equal()
446 if (retval == -1 && errno == 1) { in set_system_affinity()
487 int retval = (r == 0 ? 0 : -1); in get_system_affinity()
508 int retval = (r == 0 ? 0 : -1); in set_system_affinity()
535 KMPAffinity::Mask *allocate_mask_array(int num) override { in allocate_mask_array() argument
536 return new Mask[num]; in allocate_mask_array()
589 mask[i] = convert->mask[i]; in copy()
594 mask[i] &= convert->mask[i]; in bitwise_and()
599 mask[i] |= convert->mask[i]; in bitwise_or()
608 if (mask[i] != convert->mask[i]) in is_equal()
647 return -1; in set_system_affinity()
678 this->zero(); in get_system_affinity()
691 return -1; in get_system_affinity()
726 int group = -1; in get_proc_group()
734 return -1; in get_proc_group()
746 KMPAffinity::Mask *allocate_mask_array(int num) override { in allocate_mask_array() argument
747 return new Mask[num]; in allocate_mask_array()
770 static const int UNKNOWN_CORE_EFF = -1;
841 static const int UNKNOWN_ID = -1;
842 static const int MULTIPLE_ID = -2;
845 int ids[KMP_HW_LAST]; variable
854 ids[i] = UNKNOWN_ID; in clear()
876 // Keep quick topology ratios, for non-uniform topologies,
885 // topologies. Core efficiencies will range from 0 to num efficiencies - 1
892 // Each hw_thread's ids and sub_ids are depth deep
909 void _insert_layer(kmp_hw_t type, const int *ids);
916 // Count each item & get the num x's per y
922 // This is done by having the layer take on the id = UNKNOWN_ID (-1)
970 // Check if the hardware ids are unique, if they are
1017 for (int level = level1; level > level2; --level) in calculate_ratio()
1034 return -1; in get_level()
1038 return -1; in get_level()
1046 return _get_ncores_with_attr(attr, -1, true); in get_ncores_with_attr()
1075 int num[MAX_ATTRS]; member
1093 kmp_hw_t type1 = ((const item_t *)i1)->type; in hw_subset_compare()
1094 kmp_hw_t type2 = ((const item_t *)i2)->type; in hw_subset_compare()
1095 int level1 = __kmp_topology->get_level(type1); in hw_subset_compare()
1096 int level2 = __kmp_topology->get_level(type2); in hw_subset_compare()
1097 return level1 - level2; in hw_subset_compare()
1112 retval->depth = 0; in allocate()
1113 retval->capacity = initial_capacity; in allocate()
1114 retval->set = 0ull; in allocate()
1115 retval->absolute = false; in allocate()
1116 retval->items = (item_t *)__kmp_allocate(sizeof(item_t) * initial_capacity); in allocate()
1120 __kmp_free(subset->items); in deallocate()
1125 void push_back(int num, kmp_hw_t type, int offset, kmp_hw_attr_t attr) { in push_back() argument
1128 // Add the num, offset, and attr to this item in push_back()
1133 items[i].num[idx] = num; in push_back()
1139 if (depth == capacity - 1) { in push_back()
1149 items[depth].num[0] = num; in push_back()
1168 items[j - 1] = items[j]; in remove()
1170 depth--; in remove()
1194 // Do not target-layer-canonicalize absolute KMP_HW_SUBSETS in canonicalize()
1198 // Do not target-layer-canonicalize KMP_HW_SUBSETS when the in canonicalize()
1201 if (top->get_level(type) == KMP_HW_UNKNOWN) in canonicalize()
1208 if (top->get_equivalent_type(items[i].type) == type) { in canonicalize()
1229 printf(" num: %d, offset: %d, attr: ", items[i].num[j], in dump()
1248 /* A structure for holding machine-specific hierarchy info to be computed once
1286 int hier_depth = __kmp_topology->get_depth(); in deriveLevels()
1287 for (int i = hier_depth - 1, level = 0; i >= 0; --i, ++level) { in deriveLevels()
1288 numPerLevel[level] = __kmp_topology->get_ratio(i); in deriveLevels()
1314 dirty value observed when static library is re-initialized multiple times in init()
1315 (e.g. when non-OpenMP thread repeatedly launches/joins thread that uses in init()
1330 if (__kmp_topology && __kmp_topology->get_depth() > 0) { in init()
1340 for (int i = maxLevels - 1; i >= 0; in init()
1341 --i) // count non-empty levels to get depth in init()
1342 if (numPerLevel[i] != 1 || depth > 1) // only count one top-level '1' in init()
1350 for (kmp_uint32 d = 0; d < depth - 1; ++d) { // optimize hierarchy width in init()
1368 skipPerLevel[i] = numPerLevel[i - 1] * skipPerLevel[i - 1]; in init()
1371 skipPerLevel[i] = 2 * skipPerLevel[i - 1]; in init()
1391 kmp_uint32 old_sz = skipPerLevel[depth - 1]; in resize()
1395 skipPerLevel[i] = 2 * skipPerLevel[i - 1]; in resize()
1396 numPerLevel[i - 1] *= 2; in resize()
1436 skipPerLevel[i] = 2 * skipPerLevel[i - 1]; in resize()