Просмотр исходного кода

mic (perfmodel): Correction initialisation cholesky_models.c and lu_kernels_model.c

Thibaud Lambert лет назад: 11
Родитель
Сommit
68c999847c
2 измененных файлов с 4 добавлено и 75 удалено
  1. 2 1
      examples/cholesky/cholesky_models.c
  2. 2 74
      examples/heat/lu_kernels_model.c

+ 2 - 1
examples/cholesky/cholesky_models.c

@@ -135,6 +135,7 @@ void initialize_chol_model(struct starpu_perfmodel* model, char * symbol,
 	model->type = STARPU_HISTORY_BASED;
 	model->symbol = symbol;
 	model->per_arch[STARPU_CPU_WORKER][0][0][0].cost_function = cpu_cost_function;
-	model->per_arch[STARPU_CUDA_WORKER][0][0][0].cost_function = cuda_cost_function;
+	if(starpu_worker_get_count_by_type(STARPU_CUDA_WORKER) != 0)
+		model->per_arch[STARPU_CUDA_WORKER][0][0][0].cost_function = cuda_cost_function;
 }
 

+ 2 - 74
examples/heat/lu_kernels_model.c

@@ -224,79 +224,7 @@ void initialize_lu_kernels_model(struct starpu_perfmodel* model, char * symbol,
 	model->symbol = symbol;
 	model->cost_function = cost_function;
 	model->per_arch[STARPU_CPU_WORKER][0][0][0].cost_function = cpu_cost_function;
-	model->per_arch[STARPU_CUDA_WORKER][0][0][0].cost_function = cuda_cost_function;
+	if(starpu_worker_get_count_by_type(STARPU_CUDA_WORKER) != 0)
+		model->per_arch[STARPU_CUDA_WORKER][0][0][0].cost_function = cuda_cost_function;
 }
 
-/*
-struct starpu_perfmodel model_11 =
-{
-	.cost_function = task_11_cost,
-	.per_arch =
-	{
-		[STARPU_CPU_DEFAULT][0] = { .cost_function = task_11_cost_cpu },
-		[STARPU_CUDA_DEFAULT][0] = { .cost_function = task_11_cost_cuda }
-	},
-	.type = STARPU_HISTORY_BASED,
-#ifdef STARPU_ATLAS
-	.symbol = "lu_model_11_atlas"
-#elif defined(STARPU_GOTO)
-		.symbol = "lu_model_11_goto"
-#else
-		.symbol = "lu_model_11"
-#endif
-};
-
-struct starpu_perfmodel model_12 =
-{
-	.cost_function = task_12_cost,
-	.per_arch =
-	{
-		[STARPU_CPU_DEFAULT][0] = { .cost_function = task_12_cost_cpu },
-		[STARPU_CUDA_DEFAULT][0] = { .cost_function = task_12_cost_cuda }
-	},
-	.type = STARPU_HISTORY_BASED,
-#ifdef STARPU_ATLAS
-	.symbol = "lu_model_12_atlas"
-#elif defined(STARPU_GOTO)
-		.symbol = "lu_model_12_goto"
-#else
-		.symbol = "lu_model_12"
-#endif
-};
-
-struct starpu_perfmodel model_21 =
-{
-	.cost_function = task_21_cost,
-	.per_arch =
-	{
-		[STARPU_CPU_DEFAULT][0] = { .cost_function = task_21_cost_cpu },
-		[STARPU_CUDA_DEFAULT][0] = { .cost_function = task_21_cost_cuda }
-	},
-	.type = STARPU_HISTORY_BASED,
-#ifdef STARPU_ATLAS
-	.symbol = "lu_model_21_atlas"
-#elif defined(STARPU_GOTO)
-		.symbol = "lu_model_21_goto"
-#else
-		.symbol = "lu_model_21"
-#endif
-};
-
-struct starpu_perfmodel model_22 =
-{
-	.cost_function = task_22_cost,
-	.per_arch =
-	{
-		[STARPU_CPU_DEFAULT][0] = { .cost_function = task_22_cost_cpu },
-		[STARPU_CUDA_DEFAULT][0] = { .cost_function = task_22_cost_cuda }
-	},
-	.type = STARPU_HISTORY_BASED,
-#ifdef STARPU_ATLAS
-	.symbol = "lu_model_22_atlas"
-#elif defined(STARPU_GOTO)
-		.symbol = "lu_model_22_goto"
-#else
-		.symbol = "lu_model_22"
-#endif
-};
-*/