Browse Source

best_impl: Get arch only once

Samuel Thibault 5 years ago
parent
commit
a5cc37717f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/sched_policies/component_best_implementation.c

+ 1 - 1
src/sched_policies/component_best_implementation.c

@@ -31,6 +31,7 @@ static int find_best_impl(unsigned sched_ctx_id, struct starpu_task * task, int
 	double len = DBL_MAX;
 	int best_impl = -1;
 	unsigned impl;
+	struct starpu_perfmodel_arch* archtype = starpu_worker_get_perf_archtype(workerid, sched_ctx_id);
 	if (!task->cl->model)
 	{
 		/* No perfmodel, first available will be fine */
@@ -41,7 +42,6 @@ static int find_best_impl(unsigned sched_ctx_id, struct starpu_task * task, int
 	{
 		if(starpu_worker_can_execute_task(workerid, task, impl))
 		{
-			struct starpu_perfmodel_arch* archtype = starpu_worker_get_perf_archtype(workerid, sched_ctx_id);
 			double d = starpu_task_expected_length(task, archtype, impl);
 			if(isnan(d))
 			{