|
@@ -3056,3 +3056,17 @@ void starpu_topology_print(FILE *output)
|
|
|
fprintf(output, "\n");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+int starpu_get_pu_os_index(unsigned logical_index)
|
|
|
+{
|
|
|
+#ifdef STARPU_HAVE_HWLOC
|
|
|
+ struct _starpu_machine_config *config = _starpu_get_machine_config();
|
|
|
+ struct _starpu_machine_topology *topology = &config->topology;
|
|
|
+
|
|
|
+ hwloc_topology_t topo = topology->hwtopology;
|
|
|
+
|
|
|
+ return hwloc_get_obj_by_type(topo, HWLOC_OBJ_PU, logical_index)->os_index;
|
|
|
+#else
|
|
|
+ return logical_index;
|
|
|
+#endif
|
|
|
+}
|