Thibaud Lambert пре 11 година
родитељ
комит
bd6743cd59
2 измењених фајлова са 23 додато и 11 уклоњено
  1. 9 6
      examples/cholesky/cholesky_models.c
  2. 14 5
      src/core/perfmodel/perfmodel_history.c

+ 9 - 6
examples/cholesky/cholesky_models.c

@@ -36,7 +36,7 @@
 #define PERTURBATE(a)	(a)
 #endif
 
-static double cpu_chol_task_11_cost(struct starpu_task *task, enum starpu_perfmodel_archtype arch, unsigned nimpl)
+static double cpu_chol_task_11_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl)
 {
 	uint32_t n;
 
@@ -51,7 +51,7 @@ static double cpu_chol_task_11_cost(struct starpu_task *task, enum starpu_perfmo
 	return PERTURBATE(cost);
 }
 
-static double cuda_chol_task_11_cost(struct starpu_task *task, enum starpu_perfmodel_archtype arch, unsigned nimpl)
+static double cuda_chol_task_11_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl)
 {
 	uint32_t n;
 
@@ -66,7 +66,7 @@ static double cuda_chol_task_11_cost(struct starpu_task *task, enum starpu_perfm
 	return PERTURBATE(cost);
 }
 
-static double cpu_chol_task_21_cost(struct starpu_task *task, enum starpu_perfmodel_archtype arch, unsigned nimpl)
+static double cpu_chol_task_21_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl)
 {
 	uint32_t n;
 
@@ -81,7 +81,7 @@ static double cpu_chol_task_21_cost(struct starpu_task *task, enum starpu_perfmo
 	return PERTURBATE(cost);
 }
 
-static double cuda_chol_task_21_cost(struct starpu_task *task, enum starpu_perfmodel_archtype arch, unsigned nimpl)
+static double cuda_chol_task_21_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl)
 {
 	uint32_t n;
 
@@ -96,7 +96,7 @@ static double cuda_chol_task_21_cost(struct starpu_task *task, enum starpu_perfm
 	return PERTURBATE(cost);
 }
 
-static double cpu_chol_task_22_cost(struct starpu_task *task, enum starpu_perfmodel_archtype arch, unsigned nimpl)
+static double cpu_chol_task_22_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl)
 {
 	uint32_t n;
 
@@ -111,7 +111,7 @@ static double cpu_chol_task_22_cost(struct starpu_task *task, enum starpu_perfmo
 	return PERTURBATE(cost);
 }
 
-static double cuda_chol_task_22_cost(struct starpu_task *task, enum starpu_perfmodel_archtype arch, unsigned nimpl)
+static double cuda_chol_task_22_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl)
 {
 	uint32_t n;
 
@@ -126,6 +126,9 @@ static double cuda_chol_task_22_cost(struct starpu_task *task, enum starpu_perfm
 	return PERTURBATE(cost);
 }
 
+
+
+
 struct starpu_perfmodel chol_model_11 =
 {
 	.per_arch =

+ 14 - 5
src/core/perfmodel/perfmodel_history.c

@@ -600,13 +600,22 @@ static struct starpu_perfmodel_per_arch*** initialize_arch_model(int maxdevid, u
 void initialize_model(struct starpu_perfmodel *model)
 {
 	struct _starpu_machine_config *conf = _starpu_get_machine_config();
+	intialize_model_without_conf(model,1,&conf->topology.ncpus,
+			conf->topology.ncudagpus,NULL,
+			conf->topology.nopenclgpus,NULL,
+			conf->topology.nmicdevices,conf->topology.nmiccores,
+			conf->topology.nsccdevices,NULL); 
+}
+
+void intialize_model_without_conf(struct starpu_perfmodel* model, int dev_cpu, unsigned* core_cpu, int dev_cuda, unsigned* core_cuda, int dev_opencl, unsigned* core_opencl, int dev_mic, unsigned* core_mic, int dev_scc, unsigned* core_scc)
+{
 	model->per_arch = malloc(sizeof(*model->per_arch)*(STARPU_NARCH));
 
-	model->per_arch[STARPU_CPU_WORKER] = initialize_arch_model(1,&conf->topology.ncpus); 
-	model->per_arch[STARPU_CUDA_WORKER] = initialize_arch_model(conf->topology.ncudagpus,NULL); 
-	model->per_arch[STARPU_OPENCL_WORKER] = initialize_arch_model(conf->topology.nopenclgpus,NULL); 
-	model->per_arch[STARPU_MIC_WORKER] = initialize_arch_model(conf->topology.nmicdevices,conf->topology.nmiccores); 
-	model->per_arch[STARPU_SCC_WORKER] = initialize_arch_model(conf->topology.nsccdevices,NULL); 
+	model->per_arch[STARPU_CPU_WORKER] = initialize_arch_model(dev_cpu,core_cpu); 
+	model->per_arch[STARPU_CUDA_WORKER] = initialize_arch_model(dev_cuda,core_cuda); 
+	model->per_arch[STARPU_OPENCL_WORKER] = initialize_arch_model(dev_opencl,core_opencl); 
+	model->per_arch[STARPU_MIC_WORKER] = initialize_arch_model(dev_mic,core_mic); 
+	model->per_arch[STARPU_SCC_WORKER] = initialize_arch_model(dev_scc,core_scc); 
 }
 
 static void get_model_debug_path(struct starpu_perfmodel *model, const char *arch, char *path, size_t maxlen)