Browse Source

compil issues

Andra Hugo 11 years ago
parent
commit
10fe309eac

+ 8 - 0
examples/cholesky/cholesky_models.c

@@ -133,6 +133,7 @@ void initialize_chol_model(struct starpu_perfmodel* model, char * symbol,
 {
 	model->symbol = symbol;
 	model->type = STARPU_HISTORY_BASED;
+
 	starpu_perfmodel_init(NULL, model);
 
 	struct starpu_perfmodel_arch arch_cpu;
@@ -154,6 +155,13 @@ void initialize_chol_model(struct starpu_perfmodel* model, char * symbol,
 
 	if(starpu_worker_get_count_by_type(STARPU_CUDA_WORKER) != 0)
 	{
+		struct starpu_perfmodel_arch arch_cuda;
+		arch_cuda.ndevices = 1;
+		arch_cuda.devices = (struct starpu_perfmodel_device*)malloc(sizeof(struct starpu_perfmodel_device));
+		arch_cuda.devices[0].type = STARPU_CUDA_WORKER;
+		arch_cuda.devices[0].devid = 0;
+		arch_cuda.devices[0].ncores = 1;
+
 		int comb_cuda = starpu_get_arch_comb(arch_cuda.ndevices, arch_cuda.devices);
 		if(comb_cuda == -1)
 			comb_cuda = starpu_add_arch_comb(arch_cuda.ndevices, arch_cuda.devices);

+ 42 - 4
examples/heat/lu_kernels_model.c

@@ -221,9 +221,47 @@ void initialize_lu_kernels_model(struct starpu_perfmodel* model, char * symbol,
 {
 	model->symbol = symbol;
 	model->type = STARPU_HISTORY_BASED;
-	starpu_perfmodel_init(model);
-	model->cost_function = cost_function;
-	model->per_arch[STARPU_CPU_WORKER][0][0][0].cost_function = cpu_cost_function;
+	starpu_perfmodel_init(NULL, model);
+
+	struct starpu_perfmodel_arch arch_cpu;
+	arch_cpu.ndevices = 1;
+	arch_cpu.devices = (struct starpu_perfmodel_device*)malloc(sizeof(struct starpu_perfmodel_device));
+	arch_cpu.devices[0].type = STARPU_CPU_WORKER;
+	arch_cpu.devices[0].devid = 0;
+	arch_cpu.devices[0].ncores = 1;
+
+	int comb_cpu = starpu_get_arch_comb(arch_cpu.ndevices, arch_cpu.devices);
+	if(comb_cpu == -1)
+		comb_cpu = starpu_add_arch_comb(arch_cpu.ndevices, arch_cpu.devices);
+
+
+	model->per_arch[comb_cpu] = (struct starpu_perfmodel_per_arch*)malloc(sizeof(struct starpu_perfmodel_per_arch));
+	memset(&model->per_arch[comb_cpu][0], 0, sizeof(struct starpu_perfmodel_per_arch));
+	model->nimpls[comb_cpu] = 1;
+	model->per_arch[comb_cpu][0].cost_function = cpu_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_arch arch_cuda;
+		arch_cuda.ndevices = 1;
+		arch_cuda.devices = (struct starpu_perfmodel_device*)malloc(sizeof(struct starpu_perfmodel_device));
+		arch_cuda.devices[0].type = STARPU_CUDA_WORKER;
+		arch_cuda.devices[0].devid = 0;
+		arch_cuda.devices[0].ncores = 1;
+
+		int comb_cuda = starpu_get_arch_comb(arch_cuda.ndevices, arch_cuda.devices);
+		if(comb_cuda == -1)
+			comb_cuda = starpu_add_arch_comb(arch_cuda.ndevices, arch_cuda.devices);
+
+		model->per_arch[comb_cuda] = (struct starpu_perfmodel_per_arch*)malloc(sizeof(struct starpu_perfmodel_per_arch));
+		memset(&model->per_arch[comb_cuda][0], 0, sizeof(struct starpu_perfmodel_per_arch));
+		model->nimpls[comb_cuda] = 1;
+		model->per_arch[comb_cuda][0].cost_function = cuda_cost_function;
+
+	}
+
+/* 	model->cost_function = cost_function; */
+/* 	model->per_arch[STARPU_CPU_WORKER][0][0][0].cost_function = cpu_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; */
 }

+ 40 - 3
sc_hypervisor/examples/cholesky/cholesky_models.c

@@ -132,7 +132,44 @@ void initialize_chol_model(struct starpu_perfmodel* model, char * symbol,
 {
 	model->symbol = symbol;
 	model->type = STARPU_HISTORY_BASED;
-	starpu_perfmodel_init(model);
-	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;
+	struct starpu_perfmodel_arch arch_cpu;
+	arch_cpu.ndevices = 1;
+	arch_cpu.devices = (struct starpu_perfmodel_device*)malloc(sizeof(struct starpu_perfmodel_device));
+	arch_cpu.devices[0].type = STARPU_CPU_WORKER;
+        arch_cpu.devices[0].devid = 0;
+        arch_cpu.devices[0].ncores = 1;
+
+	int comb_cpu = starpu_get_arch_comb(arch_cpu.ndevices, arch_cpu.devices);
+        if(comb_cpu == -1)
+                comb_cpu = starpu_add_arch_comb(arch_cpu.ndevices, arch_cpu.devices);
+
+
+	model->per_arch[comb_cpu] = (struct starpu_perfmodel_per_arch*)malloc(sizeof(struct starpu_perfmodel_per_arch));
+	memset(&model->per_arch[comb_cpu][0], 0, sizeof(struct starpu_perfmodel_per_arch));
+	model->nimpls[comb_cpu] = 1;
+	model->per_arch[comb_cpu][0].cost_function = cpu_cost_function;
+
+        if(starpu_worker_get_count_by_type(STARPU_CUDA_WORKER) != 0)
+        {
+		struct starpu_perfmodel_arch arch_cuda;
+		arch_cuda.ndevices = 1;
+                arch_cuda.devices = (struct starpu_perfmodel_device*)malloc(sizeof(struct starpu_perfmodel_device));
+                arch_cuda.devices[0].type = STARPU_CUDA_WORKER;
+                arch_cuda.devices[0].devid = 0;
+		arch_cuda.devices[0].ncores = 1;
+
+		int comb_cuda = starpu_get_arch_comb(arch_cuda.ndevices, arch_cuda.devices);
+		if(comb_cuda == -1)
+			comb_cuda = starpu_add_arch_comb(arch_cuda.ndevices, arch_cuda.devices);
+
+                model->per_arch[comb_cuda] = (struct starpu_perfmodel_per_arch*)malloc(sizeof(struct starpu_perfmodel_per_arch));
+                memset(&model->per_arch[comb_cuda][0], 0, sizeof(struct starpu_perfmodel_per_arch));
+		model->nimpls[comb_cuda] = 1;
+		model->per_arch[comb_cuda][0].cost_function = cuda_cost_function;
+
+        }
+
+/* 	starpu_perfmodel_init(model); */
+/* 	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; */
 }