Sfoglia il codice sorgente

Don't duplicate topology in starpu_get_hwloc_topology

Followup of d4aa592d0
Philippe SWARTVAGHER 4 anni fa
parent
commit
42bcc20e86
3 ha cambiato i file con 7 aggiunte e 6 eliminazioni
  1. 2 2
      ChangeLog
  2. 3 2
      include/starpu_helper.h
  3. 2 2
      src/core/topology.c

+ 2 - 2
ChangeLog

@@ -37,8 +37,8 @@ New features:
     thread.
   * New function starpu_get_pu_os_index() to convert logical index of a PU to
     its OS index.
-  * New function starpu_get_hwloc_topology() to get a copy of the hwloc
-    topology used by StarPU.
+  * New function starpu_get_hwloc_topology() to get the hwloc topology used by
+    StarPU.
   * Add a task prefetch level, to improve retaining data in accelerators so we
     can make prefetch more aggressive.
 

+ 3 - 2
include/starpu_helper.h

@@ -202,9 +202,10 @@ int starpu_get_pu_os_index(unsigned logical_index);
 
 #ifdef STARPU_HAVE_HWLOC
 /**
-   Get a copy of the hwloc topology used by StarPU.
+   Get the hwloc topology used by StarPU. One can use this pointer to get
+   information about topology, but not to change settings related to topology.
 */
-int starpu_get_hwloc_topology(hwloc_topology_t* topology);
+hwloc_topology_t starpu_get_hwloc_topology(void);
 #endif
 /** @} */
 

+ 2 - 2
src/core/topology.c

@@ -3072,10 +3072,10 @@ int starpu_get_pu_os_index(unsigned logical_index)
 }
 
 #ifdef STARPU_HAVE_HWLOC
-int starpu_get_hwloc_topology(hwloc_topology_t* topology)
+hwloc_topology_t starpu_get_hwloc_topology(void)
 {
 	struct _starpu_machine_config *config = _starpu_get_machine_config();
 
-	return hwloc_topology_dup(topology, config->topology.hwtopology);
+	return config->topology.hwtopology;
 }
 #endif