소스 검색

Fix c++-isms

Samuel Thibault 14 년 전
부모
커밋
87a4f18af0

+ 4 - 4
examples/stencil/stencil-kernels.c

@@ -256,9 +256,9 @@ fprintf(stderr,"!!! DO update_func_cuda z %d CUDA%d !!!\n", block->bz, workerid)
 
 		/* And perform actual computation */
 #ifdef LIFE
-		cuda_life_update_host(block->bz, old, new, oldb->nx, oldb->ny, oldb->nz, oldb->ldy, oldb->ldz, i);
+		cuda_life_update_host(block->bz, old, newer, oldb->nx, oldb->ny, oldb->nz, oldb->ldy, oldb->ldz, i);
 #else
-		cudaMemcpyAsync(new, old, oldb->nx * oldb->ny * oldb->nz * sizeof(*newer), cudaMemcpyDeviceToDevice, starpu_cuda_get_local_stream());
+		cudaMemcpyAsync(newer, old, oldb->nx * oldb->ny * oldb->nz * sizeof(*newer), cudaMemcpyDeviceToDevice, starpu_cuda_get_local_stream());
 #endif /* LIFE */
 	}
 
@@ -349,9 +349,9 @@ fprintf(stderr,"!!! DO update_func_opencl z %d OPENCL%d !!!\n", block->bz, worke
 
 		/* And perform actual computation */
 #ifdef LIFE
-		opencl_life_update_host(block->bz, old, new, oldb->nx, oldb->ny, oldb->nz, oldb->ldy, oldb->ldz, i);
+		opencl_life_update_host(block->bz, old, newer, oldb->nx, oldb->ny, oldb->nz, oldb->ldy, oldb->ldz, i);
 #else
-                clEnqueueCopyBuffer(cq, old, new, 0, 0, oldb->nx * oldb->ny * oldb->nz * sizeof(*newer), 0, NULL, NULL);
+                clEnqueueCopyBuffer(cq, old, newer, 0, 0, oldb->nx * oldb->ny * oldb->nz * sizeof(*newer), 0, NULL, NULL);
 #endif /* LIFE */
 	}
 

+ 1 - 1
examples/stencil/stencil.c

@@ -134,7 +134,7 @@ static void init_problem(int argc, char **argv, int rank, int world_size)
 	who_runs_what_len = 2*niter;
 	who_runs_what = (int *) calloc(nbz * who_runs_what_len, sizeof(*who_runs_what));
 	who_runs_what_index = (int *) calloc(nbz, sizeof(*who_runs_what_index));
-	last_tick = (timeval *) calloc(nbz, sizeof(*last_tick));
+	last_tick = (struct timeval *) calloc(nbz, sizeof(*last_tick));
 }
 
 /*

+ 1 - 1
src/core/combined_workers.c

@@ -99,7 +99,7 @@ int starpu_combined_worker_assign_workerid(int nworkers, int workerid_array[])
 		&config->combined_workers[combined_worker_id];
 
 	combined_worker->worker_size = nworkers;
-	combined_worker->perf_arch = (starpu_perf_archtype) (STARPU_CPU_DEFAULT + nworkers - 1);
+	combined_worker->perf_arch = (enum starpu_perf_archtype) (STARPU_CPU_DEFAULT + nworkers - 1);
 	combined_worker->worker_mask = STARPU_CPU;
 
 	/* We assume that the memory node should either be that of the first

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

@@ -254,7 +254,7 @@ static void dump_model_file(FILE *f, struct starpu_perfmodel_t *model)
 	for (arch = 0; arch < STARPU_NARCH_VARIATIONS; arch++)
 	{
 		char archname[32];
-		starpu_perfmodel_get_arch_name((starpu_perf_archtype) arch, archname, 32);
+		starpu_perfmodel_get_arch_name((enum starpu_perf_archtype) arch, archname, 32);
 		fprintf(f, "# Model for %s\n", archname);
 		dump_per_arch_model_file(f, model, arch);
 		fprintf(f, "\n##################\n");

+ 2 - 1
tests/core/declare_deps_in_callback.c

@@ -1,3 +1,4 @@
+
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
@@ -28,7 +29,7 @@ static void callback(void *arg)
 	struct starpu_task *taskA, *taskB;
 
 	taskA = starpu_get_current_task();
-	taskB = (starpu_task *) arg;
+	taskB = (struct starpu_task *) arg;
 
 	starpu_task_declare_deps_array(taskB, 1, &taskA);
 	starpu_task_submit(taskB);

+ 5 - 5
tools/starpu_perfmodel_display.c

@@ -245,7 +245,7 @@ static void display_all_perf_models(struct starpu_perfmodel_t *model)
 		unsigned archid;
 		for (archid = 0; archid < STARPU_NARCH_VARIATIONS; archid++)
 		{
-			display_perf_model(model, (starpu_perf_archtype) archid);
+			display_perf_model(model, (enum starpu_perf_archtype) archid);
 		}
 	}
 	else {
@@ -264,7 +264,7 @@ static void display_all_perf_models(struct starpu_perfmodel_t *model)
 				exit(-1);
 			}
 
-			display_perf_model(model, (starpu_perf_archtype) (STARPU_CPU_DEFAULT + k - 1));
+			display_perf_model(model, (enum starpu_perf_archtype) (STARPU_CPU_DEFAULT + k - 1));
 			return;
 		}
 
@@ -273,9 +273,9 @@ static void display_all_perf_models(struct starpu_perfmodel_t *model)
 			for (archid = STARPU_CUDA_DEFAULT; archid < STARPU_CUDA_DEFAULT + STARPU_MAXCUDADEVS; archid++)
 			{
 				char archname[32];
-				starpu_perfmodel_get_arch_name((starpu_perf_archtype) archid, archname, 32);
+				starpu_perfmodel_get_arch_name((enum starpu_perf_archtype) archid, archname, 32);
 				fprintf(stderr, "performance model for %s\n", archname);
-				display_perf_model(model, (starpu_perf_archtype) archid);
+				display_perf_model(model, (enum starpu_perf_archtype) archid);
 			}
 			return;
 		}
@@ -287,7 +287,7 @@ static void display_all_perf_models(struct starpu_perfmodel_t *model)
 		if (nmatched == 1)
 		{
 			unsigned archid = STARPU_CUDA_DEFAULT+ gpuid;
-			display_perf_model(model, (starpu_perf_archtype) archid);
+			display_perf_model(model, (enum starpu_perf_archtype) archid);
 			return;
 		}
 

+ 7 - 7
tools/starpu_perfmodel_plot.c

@@ -205,7 +205,7 @@ static void display_history_based_perf_models(FILE *gnuplot_file, struct starpu_
 	col = 2;
 	for (arch = arch1; arch < arch2; arch++) {
 		struct starpu_per_arch_perfmodel_t *arch_model = &model->per_arch[arch];
-		starpu_perfmodel_get_arch_name((starpu_perf_archtype) arch, archname, 32);
+		starpu_perfmodel_get_arch_name((enum starpu_perf_archtype) arch, archname, 32);
 
 		ptrs[arch-arch1] = ptr[arch-arch1] = arch_model->list;
 
@@ -261,7 +261,7 @@ static void display_perf_models(FILE *gnuplot_file, struct starpu_perfmodel_t *m
 {
 	unsigned arch;
 	for (arch = arch1; arch < arch2; arch++)
-		display_perf_model(gnuplot_file, model, (starpu_perf_archtype) arch, first);
+		display_perf_model(gnuplot_file, model, (enum starpu_perf_archtype) arch, first);
 	display_history_based_perf_models(gnuplot_file, model, arch1, arch2, first);
 }
 
@@ -313,7 +313,7 @@ static void display_selected_models(FILE *gnuplot_file, struct starpu_perfmodel_
 	if (arch == NULL)
 	{
 		/* display all architectures */
-		display_perf_models(gnuplot_file, model, (starpu_perf_archtype) 0, (starpu_perf_archtype) STARPU_NARCH_VARIATIONS, &first);
+		display_perf_models(gnuplot_file, model, (enum starpu_perf_archtype) 0, (enum starpu_perf_archtype) STARPU_NARCH_VARIATIONS, &first);
 	}
 	else {
 		if (strcmp(arch, "cpu") == 0) {
@@ -331,12 +331,12 @@ static void display_selected_models(FILE *gnuplot_file, struct starpu_perfmodel_
 				exit(-1);
 			}
 
-			display_perf_models(gnuplot_file, model, (starpu_perf_archtype) (STARPU_CPU_DEFAULT + k - 1), (starpu_perf_archtype) (STARPU_CPU_DEFAULT + k), &first);
+			display_perf_models(gnuplot_file, model, (enum starpu_perf_archtype) (STARPU_CPU_DEFAULT + k - 1), (enum starpu_perf_archtype) (STARPU_CPU_DEFAULT + k), &first);
 			return;
 		}
 
 		if (strcmp(arch, "cuda") == 0) {
-			display_perf_models(gnuplot_file, model, STARPU_CUDA_DEFAULT, (starpu_perf_archtype) (STARPU_CUDA_DEFAULT + STARPU_MAXCUDADEVS), &first);
+			display_perf_models(gnuplot_file, model, STARPU_CUDA_DEFAULT, (enum starpu_perf_archtype) (STARPU_CUDA_DEFAULT + STARPU_MAXCUDADEVS), &first);
 			return;
 		}
 
@@ -347,12 +347,12 @@ static void display_selected_models(FILE *gnuplot_file, struct starpu_perfmodel_
 		if (nmatched == 1)
 		{
 			unsigned archid = STARPU_CUDA_DEFAULT+ gpuid;
-			display_perf_models(gnuplot_file, model, (starpu_perf_archtype) archid, (starpu_perf_archtype) (archid + 1), &first);
+			display_perf_models(gnuplot_file, model, (enum starpu_perf_archtype) archid, (enum starpu_perf_archtype) (archid + 1), &first);
 			return;
 		}
 
 		if (strcmp(arch, "gordon") == 0) {
-			display_perf_models(gnuplot_file, model, STARPU_GORDON_DEFAULT, (starpu_perf_archtype) (STARPU_GORDON_DEFAULT + 1), &first);
+			display_perf_models(gnuplot_file, model, STARPU_GORDON_DEFAULT, (enum starpu_perf_archtype) (STARPU_GORDON_DEFAULT + 1), &first);
 			return;
 		}