13 #ifndef HWLOC_HELPER_H
14 #define HWLOC_HELPER_H
17 #error Please include the main hwloc.h instead
95 if (!next || !next->
cpuset)
134 unsigned depth,
unsigned idx) __hwloc_attribute_pure;
137 unsigned depth,
unsigned idx)
187 static __hwloc_inline
unsigned
189 unsigned depth) __hwloc_attribute_pure;
190 static __hwloc_inline
unsigned
218 static __hwloc_inline
int
221 static __hwloc_inline
int
244 static __hwloc_inline
int
247 static __hwloc_inline
int
332 if (!next || !next->
cpuset)
384 if (obj->
depth < depth)
386 while (ancestor && ancestor->
depth > depth)
387 ancestor = ancestor->
parent;
398 while (ancestor && ancestor->
type != type)
399 ancestor = ancestor->
parent;
414 while (obj1 != obj2) {
419 if (obj1 != obj2 && obj1->
depth == obj2->
depth) {
431 static __hwloc_inline
int
433 static __hwloc_inline
int
448 if (prev->
parent != parent)
480 static __hwloc_inline
int
486 for (depth=0; ; depth++) {
526 current = current->
parent;
543 while (current && current->
cpuset) {
547 current = current->
parent;
674 for(i=0; i<nr; i++) {
722 static __hwloc_inline
int
727 unsigned until,
unsigned long flags)
731 unsigned given, givenweight;
740 for (i = 0; i < n_roots; i++)
744 for (i = 0, given = 0, givenweight = 0; i < n_roots; i++) {
745 unsigned chunk, weight;
755 chunk = (( (givenweight+weight) * n + tot_weight-1) / tot_weight)
756 - (( givenweight * n + tot_weight-1) / tot_weight);
757 if (!root->
arity || chunk <= 1 || root->
depth >= until) {
762 for (j=0; j < chunk; j++)
778 givenweight += weight;
942 static __hwloc_inline
void
970 static __hwloc_inline
void
991 static __hwloc_inline
void
1022 static __hwloc_inline
void
1121 while (obj && obj->
cpuset) {
1146 static __hwloc_inline
int
1149 float *
latency,
float *reverse_latency)
1153 unsigned first_logical ;
1162 if (distances && distances->
latency) {
1163 const float * latency_matrix = distances->
latency;
1167 *latency = latency_matrix[l1*nbobjs+l2];
1168 *reverse_latency = latency_matrix[l2*nbobjs+l1];
1195 while (obj && !obj->
cpuset) {
1216 unsigned domain,
unsigned bus,
unsigned dev,
unsigned func)
1235 unsigned domain = 0;
1236 unsigned bus, dev, func;
1238 if (sscanf(busid,
"%x:%x.%x", &bus, &dev, &func) != 3
1239 && sscanf(busid,
"%x:%x:%x.%x", &domain, &bus, &dev, &func) != 4) {
1269 static __hwloc_inline
int
1271 unsigned domain,
unsigned bus)
1287 unsigned domain,
unsigned bus)