ソースを参照

prevent hwloc from loading useless components

Samuel Thibault 7 年 前
コミット
71f0ec26df
共有3 個のファイルを変更した11 個の追加0 個の削除を含む
  1. 1 0
      configure.ac
  2. 1 0
      src/core/perfmodel/perfmodel_bus.c
  3. 9 0
      src/core/topology.c

+ 1 - 0
configure.ac

@@ -3235,6 +3235,7 @@ AS_IF([test "$have_valid_hwloc" = "yes"],
       ])
 
 AC_CHECK_FUNCS([hwloc_topology_dup])
+AC_CHECK_FUNCS([hwloc_topology_set_components])
 AM_CONDITIONAL(STARPU_HWLOC_HAVE_TOPOLOGY_DUP, test $ac_cv_func_hwloc_topology_dup = yes)
 
 LDFLAGS="${SAVED_LDFLAGS}"

+ 1 - 0
src/core/perfmodel/perfmodel_bus.c

@@ -740,6 +740,7 @@ static void benchmark_all_gpu_devices(void)
 
 #ifdef STARPU_HAVE_HWLOC
 	hwloc_topology_init(&hwtopology);
+	_starpu_topology_filter(topology);
 	hwloc_topology_load(hwtopology);
 #endif
 

+ 9 - 0
src/core/topology.c

@@ -1191,6 +1191,15 @@ void _starpu_topology_filter(hwloc_topology_t topology)
 #else
 	hwloc_topology_set_flags(topology, HWLOC_TOPOLOGY_FLAG_IO_DEVICES | HWLOC_TOPOLOGY_FLAG_IO_BRIDGES);
 #endif
+#ifdef HAVE_HWLOC_TOPOLOGY_SET_COMPONENTS
+#  ifndef STARPU_USE_CUDA
+	hwloc_topology_set_components(hwtopology, HWLOC_TOPOLOGY_COMPONENTS_FLAG_BLACKLIST, "cuda");
+	hwloc_topology_set_components(hwtopology, HWLOC_TOPOLOGY_COMPONENTS_FLAG_BLACKLIST, "nvml");
+#  endif
+#  ifndef STARPU_USE_OPENCL
+	hwloc_topology_set_components(hwtopology, HWLOC_TOPOLOGY_COMPONENTS_FLAG_BLACKLIST, "opencl");
+#  endif
+#endif
 }
 #endif