Przeglądaj źródła

optimize _starpu_get_nsched_ctxs a bit

Samuel Thibault 9 lat temu
rodzic
commit
8e3f965cb6
2 zmienionych plików z 5 dodań i 6 usunięć
  1. 0 6
      src/core/sched_ctx.c
  2. 5 0
      src/core/workers.c

+ 0 - 6
src/core/sched_ctx.c

@@ -1469,12 +1469,6 @@ unsigned _starpu_sched_ctx_allow_hypervisor(unsigned sched_ctx_id)
 	return 0;
 }
 
-unsigned _starpu_get_nsched_ctxs()
-{
-	struct _starpu_machine_config *config = (struct _starpu_machine_config *)_starpu_get_machine_config();
-	return config->topology.nsched_ctxs;
-}
-
 void starpu_sched_ctx_set_policy_data(unsigned sched_ctx_id, void* policy_data)
 {
 	struct _starpu_sched_ctx *sched_ctx = _starpu_get_sched_ctx_struct(sched_ctx_id);

+ 5 - 0
src/core/workers.c

@@ -1792,6 +1792,11 @@ unsigned starpu_worker_is_combined_worker(int id)
 	return id >= (int)config.topology.nworkers;
 }
 
+unsigned _starpu_get_nsched_ctxs()
+{
+	return config.topology.nsched_ctxs;
+}
+
 struct _starpu_sched_ctx *_starpu_get_sched_ctx_struct(unsigned id)
 {
 	if(id == STARPU_NMAX_SCHED_CTXS) return NULL;