Lines Matching +full:layer +full:- +full:depth
2 * kmp_affinity.h -- header for affinity management
5 //===----------------------------------------------------------------------===//
9 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
11 //===----------------------------------------------------------------------===//
30 this->zero();
40 hwloc_bitmap_copy(mask, convert->mask);
44 hwloc_bitmap_and(mask, mask, convert->mask);
48 hwloc_bitmap_or(mask, mask, convert->mask);
53 return hwloc_bitmap_isequal(mask, convert->mask);
56 int end() const override { return -1; }
97 if (support->cpubind->set_proc_cpubind) {
112 int group = -1;
126 return -1;
155 if (topology_support && topology_support->cpubind->set_thisthread_cpubind &&
156 topology_support->cpubind->get_thisthread_cpubind &&
157 topology_support->discovery->pu && !__kmp_hwloc_error) {
370 mask[i] = convert->mask[i];
376 mask[i] &= convert->mask[i];
382 mask[i] |= convert->mask[i];
393 if (mask[i] != convert->mask[i])
446 if (retval == -1 && errno == 1) {
487 int retval = (r == 0 ? 0 : -1);
508 int retval = (r == 0 ? 0 : -1);
589 mask[i] = convert->mask[i];
594 mask[i] &= convert->mask[i];
599 mask[i] |= convert->mask[i];
608 if (mask[i] != convert->mask[i])
647 return -1;
678 this->zero();
691 return -1;
726 int group = -1;
734 return -1;
770 static const int UNKNOWN_CORE_EFF = -1;
841 static const int UNKNOWN_ID = -1;
842 static const int MULTIPLE_ID = -2;
867 int depth;
869 // The following arrays are all 'depth' long and have been
876 // Keep quick topology ratios, for non-uniform topologies,
881 // Storage containing the absolute number of each topology layer
885 // topologies. Core efficiencies will range from 0 to num efficiencies - 1
892 // Each hw_thread's ids and sub_ids are depth deep
908 // Insert a new topology layer after allocation
922 // This is done by having the layer take on the id = UNKNOWN_ID (-1)
941 // all cores per the layer 'above'
1014 KMP_DEBUG_ASSERT(level1 >= 0 && level1 < depth);
1015 KMP_DEBUG_ASSERT(level2 >= 0 && level2 < depth);
1017 for (int level = level1; level > level2; --level)
1022 KMP_DEBUG_ASSERT(level >= 0 && level < depth);
1025 int get_depth() const { return depth; };
1027 KMP_DEBUG_ASSERT(level >= 0 && level < depth);
1034 return -1;
1035 for (int i = 0; i < depth; ++i)
1038 return -1;
1041 KMP_DEBUG_ASSERT(level >= 0 && level < depth);
1046 return _get_ncores_with_attr(attr, -1, true);
1083 int depth;
1093 kmp_hw_t type1 = ((const item_t *)i1)->type;
1094 kmp_hw_t type2 = ((const item_t *)i2)->type;
1095 int level1 = __kmp_topology->get_level(type1);
1096 int level2 = __kmp_topology->get_level(type2);
1097 return level1 - level2;
1112 retval->depth = 0;
1113 retval->capacity = initial_capacity;
1114 retval->set = 0ull;
1115 retval->absolute = false;
1116 retval->items = (item_t *)__kmp_allocate(sizeof(item_t) * initial_capacity);
1120 __kmp_free(subset->items);
1126 for (int i = 0; i < depth; ++i) {
1127 // Found an existing item for this layer type
1139 if (depth == capacity - 1) {
1142 for (int i = 0; i < depth; ++i)
1147 items[depth].num_attrs = 1;
1148 items[depth].type = type;
1149 items[depth].num[0] = num;
1150 items[depth].offset[0] = offset;
1151 items[depth].attr[0] = attr;
1152 depth++;
1155 int get_depth() const { return depth; }
1157 KMP_DEBUG_ASSERT(index >= 0 && index < depth);
1161 KMP_DEBUG_ASSERT(index >= 0 && index < depth);
1165 KMP_DEBUG_ASSERT(index >= 0 && index < depth);
1167 for (int j = index + 1; j < depth; ++j) {
1168 items[j - 1] = items[j];
1170 depth--;
1174 qsort(items, depth, sizeof(item_t), hw_subset_compare);
1189 // module layer.
1194 // Do not target-layer-canonicalize absolute KMP_HW_SUBSETS
1198 // Do not target-layer-canonicalize KMP_HW_SUBSETS when the
1201 if (top->get_level(type) == KMP_HW_UNKNOWN)
1208 if (top->get_equivalent_type(items[i].type) == type) {
1224 printf("* depth: %d\n", depth);
1226 for (int i = 0; i < depth; ++i) {
1248 /* A structure for holding machine-specific hierarchy info to be computed once
1267 /** This is specifically the depth of the machine configuration hierarchy, in
1271 kmp_uint32 depth;
1286 int hier_depth = __kmp_topology->get_depth();
1287 for (int i = hier_depth - 1, level = 0; i >= 0; --i, ++level) {
1288 numPerLevel[level] = __kmp_topology->get_ratio(i);
1293 : maxLevels(7), depth(1), uninitialized(not_initialized), resizing(0) {}
1314 dirty value observed when static library is re-initialized multiple times
1315 (e.g. when non-OpenMP thread repeatedly launches/joins thread that uses
1317 depth = 1;
1330 if (__kmp_topology && __kmp_topology->get_depth() > 0) {
1340 for (int i = maxLevels - 1; i >= 0;
1341 --i) // count non-empty levels to get depth
1342 if (numPerLevel[i] != 1 || depth > 1) // only count one top-level '1'
1343 depth++;
1350 for (kmp_uint32 d = 0; d < depth - 1; ++d) { // optimize hierarchy width
1357 depth++;
1367 for (kmp_uint32 i = 1; i < depth; ++i)
1368 skipPerLevel[i] = numPerLevel[i - 1] * skipPerLevel[i - 1];
1370 for (kmp_uint32 i = depth; i < maxLevels; ++i)
1371 skipPerLevel[i] = 2 * skipPerLevel[i - 1];
1391 kmp_uint32 old_sz = skipPerLevel[depth - 1];
1394 for (kmp_uint32 i = depth; i < maxLevels && nproc > old_sz; ++i) {
1395 skipPerLevel[i] = 2 * skipPerLevel[i - 1];
1396 numPerLevel[i - 1] *= 2;
1398 depth++;
1404 depth++;
1436 skipPerLevel[i] = 2 * skipPerLevel[i - 1];