Forráskód Böngészése

fixing perfmodel_history when model exists, but its state is NULL (reverted from commit b46f65f7250ad83f1f38b8a4eeee95336235d9fb)

Luka Stanisic 9 éve
szülő
commit
476884764f
1 módosított fájl, 3 hozzáadás és 3 törlés
  1. 3 3
      src/core/perfmodel/perfmodel_history.c

+ 3 - 3
src/core/perfmodel/perfmodel_history.c

@@ -189,7 +189,7 @@ size_t _starpu_job_get_data_size(struct starpu_perfmodel *model, struct starpu_p
 	struct starpu_task *task = j->task;
 	int comb = starpu_perfmodel_arch_comb_get(arch->ndevices, arch->devices);
 
-	if (model && model->state && model->state->per_arch && comb != -1 && model->state->per_arch[comb] && model->state->per_arch[comb][impl].size_base)
+	if (model && model->state->per_arch && comb != -1 && model->state->per_arch[comb] && model->state->per_arch[comb][impl].size_base)
 	{
 		return model->state->per_arch[comb][impl].size_base(task, arch, impl);
 	}
@@ -1546,8 +1546,8 @@ int starpu_perfmodel_list_combs(FILE *output, struct starpu_perfmodel *model)
 struct starpu_perfmodel_per_arch *starpu_perfmodel_get_model_per_arch(struct starpu_perfmodel *model, struct starpu_perfmodel_arch *arch, unsigned impl)
 {
 	int comb = starpu_perfmodel_arch_comb_get(arch->ndevices, arch->devices);
-	if(comb == -1 || !model->state || !model->state->per_arch[comb])
-		return NULL;
+	if(comb == -1) return NULL;
+	if(!model->state->per_arch[comb]) return NULL;
 
 	return &model->state->per_arch[comb][impl];
 }