Browse Source

task_submit: always call starpu_perfmodel_init when a model is defined, this ensures model->state will be allocated

Nathalie Furmento 10 years ago
parent
commit
c6df644385
1 changed files with 6 additions and 3 deletions
  1. 6 3
      src/core/task.c

+ 6 - 3
src/core/task.c

@@ -485,9 +485,12 @@ int starpu_task_submit(struct starpu_task *task)
 
 		_starpu_detect_implicit_data_deps(task);
 
-
-		if (task->cl->model && task->cl->model->symbol)
-			_starpu_load_perfmodel(task->cl->model);
+		if (task->cl->model)
+		{
+			starpu_perfmodel_init(NULL, task->cl->model);
+			if (task->cl->model->symbol)
+				_starpu_load_perfmodel(task->cl->model);
+		}
 
 		if (task->cl->power_model && task->cl->power_model->symbol)
 			_starpu_load_perfmodel(task->cl->power_model);