浏览代码

Optimize best implementation selection when the codelet does not have a model

Samuel Thibault 5 年之前
父节点
当前提交
8f2566fc09
共有 1 个文件被更改,包括 9 次插入3 次删除
  1. 9 3
      src/sched_policies/component_best_implementation.c

+ 9 - 3
src/sched_policies/component_best_implementation.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2013                                     Inria
  * Copyright (C) 2014,2016,2017                           CNRS
- * Copyright (C) 2014-2018                                Université de Bordeaux
+ * Copyright (C) 2014-2018,2020                           Université de Bordeaux
  * Copyright (C) 2013                                     Simon Archipoff
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -30,8 +30,14 @@ static int find_best_impl(unsigned sched_ctx_id, struct starpu_task * task, int
 {
 	double len = DBL_MAX;
 	int best_impl = -1;
-	int impl;
-	for(impl = 0; impl < STARPU_MAXIMPLEMENTATIONS; impl++)
+	unsigned impl;
+	if (!task->cl->model)
+	{
+		/* No perfmodel, first available will be fine */
+		starpu_worker_can_execute_task_first_impl(workerid, task, &impl);
+		best_impl = impl;
+	}
+	else for(impl = 0; impl < STARPU_MAXIMPLEMENTATIONS; impl++)
 	{
 		if(starpu_worker_can_execute_task(workerid, task, impl))
 		{