瀏覽代碼

include: move definition of struct starpu_machine_topology

Nathalie Furmento 12 年之前
父節點
當前提交
00e36894cf
共有 2 個文件被更改,包括 36 次插入36 次删除
  1. 0 36
      include/starpu_scheduler.h
  2. 36 0
      include/starpu_worker.h

+ 0 - 36
include/starpu_scheduler.h

@@ -20,10 +20,6 @@
 
 #include <starpu.h>
 
-#ifdef STARPU_HAVE_HWLOC
-#include <hwloc.h>
-#endif
-
 #ifdef __cplusplus
 extern "C"
 {
@@ -31,38 +27,6 @@ extern "C"
 
 struct starpu_task;
 
-struct starpu_machine_topology
-{
-	unsigned nworkers;
-
-	unsigned ncombinedworkers;
-
-	unsigned nsched_ctxs;
-#ifdef STARPU_HAVE_HWLOC
-	hwloc_topology_t hwtopology;
-#else
-	/* We maintain ABI compatibility with and without hwloc */
-	void *dummy;
-#endif
-
-	unsigned nhwcpus;
-	unsigned nhwcudagpus;
-	unsigned nhwopenclgpus;
-
-	unsigned ncpus;
-	unsigned ncudagpus;
-	unsigned nopenclgpus;
-
-	/* Where to bind workers ? */
-	unsigned workers_bindid[STARPU_NMAXWORKERS];
-
-	/* Which GPU(s) do we use for CUDA ? */
-	unsigned workers_cuda_gpuid[STARPU_NMAXWORKERS];
-
-	/* Which GPU(s) do we use for OpenCL ? */
-	unsigned workers_opencl_gpuid[STARPU_NMAXWORKERS];
-};
-
 /* This structure contains all the methods that implement a scheduling policy.
  * An application may specify which scheduling strategy in the "sched_policy"
  * field of the starpu_conf structure passed to the starpu_init function. */

+ 36 - 0
include/starpu_worker.h

@@ -21,6 +21,11 @@
 #include <stdlib.h>
 #include <starpu_config.h>
 
+#ifdef STARPU_HAVE_HWLOC
+#include <hwloc.h>
+#endif
+
+
 #ifdef __cplusplus
 extern "C"
 {
@@ -39,6 +44,37 @@ struct starpu_sched_ctx_iterator
 	int cursor;
 };
 
+struct starpu_machine_topology
+{
+	unsigned nworkers;
+
+	unsigned ncombinedworkers;
+
+	unsigned nsched_ctxs;
+#ifdef STARPU_HAVE_HWLOC
+	hwloc_topology_t hwtopology;
+#else
+	/* We maintain ABI compatibility with and without hwloc */
+	void *dummy;
+#endif
+
+	unsigned nhwcpus;
+	unsigned nhwcudagpus;
+	unsigned nhwopenclgpus;
+
+	unsigned ncpus;
+	unsigned ncudagpus;
+	unsigned nopenclgpus;
+
+	/* Where to bind workers ? */
+	unsigned workers_bindid[STARPU_NMAXWORKERS];
+
+	/* Which GPU(s) do we use for CUDA ? */
+	unsigned workers_cuda_gpuid[STARPU_NMAXWORKERS];
+
+	/* Which GPU(s) do we use for OpenCL ? */
+	unsigned workers_opencl_gpuid[STARPU_NMAXWORKERS];
+};
 
 /* generic structure used by the scheduling contexts to iterate the workers */
 struct starpu_worker_collection