Nathalie Furmento hace 10 años
padre
commit
992aac301e

+ 15 - 20
examples/callback/prologue.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010, 2013-2014  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2015  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -73,6 +73,7 @@ int main(int argc, char **argv)
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	starpu_variable_data_register(&handle, STARPU_MAIN_RAM, (uintptr_t)&v, sizeof(int));
+	double *x = (double*)malloc(sizeof(double));
 
 	struct starpu_task *task = starpu_task_create();
 	task->cl = &cl;
@@ -88,29 +89,23 @@ int main(int argc, char **argv)
 	if (ret == -ENODEV) goto enodev;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
 
-	double *x = (double*)malloc(sizeof(double));
 	*x = -999.0;
-	int ret2 = starpu_task_insert(&cl,
-				      STARPU_RW, handle,
-				      STARPU_PROLOGUE_CALLBACK, prologue_callback_func,
-				      STARPU_PROLOGUE_CALLBACK_ARG, x,
-				      STARPU_PROLOGUE_CALLBACK_POP, pop_prologue_callback_func,
-				      STARPU_PROLOGUE_CALLBACK_POP_ARG, 5,
-				      0);
-
+	ret = starpu_task_insert(&cl,
+				 STARPU_RW, handle,
+				 STARPU_PROLOGUE_CALLBACK, prologue_callback_func,
+				 STARPU_PROLOGUE_CALLBACK_ARG, x,
+				 STARPU_PROLOGUE_CALLBACK_POP, pop_prologue_callback_func,
+				 STARPU_PROLOGUE_CALLBACK_POP_ARG, 5,
+				 0);
+	if (ret == -ENODEV) goto enodev;
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_insert");
 
 	starpu_task_wait_for_all();
-	starpu_data_unregister(handle);
-
-	FPRINTF(stderr, "v -> %d\n", v);
-
-	free(x);
-
-	starpu_shutdown();
-
-	return 0;
 
 enodev:
+	starpu_data_unregister(handle);
+	free(x);
+	FPRINTF(stderr, "v -> %d\n", v);
 	starpu_shutdown();
-	return 77;
+	return (ret == -ENODEV) ? 77 : 0;
 }

+ 1 - 1
src/core/sched_ctx.c

@@ -999,7 +999,7 @@ void _starpu_fetch_task_from_waiting_list(struct _starpu_sched_ctx *sched_ctx)
 	if(_starpu_can_push_task(sched_ctx, old_task))
 	{
 		old_task = starpu_task_list_pop_back(&sched_ctx->waiting_tasks);
-		int ret =  _starpu_push_task_to_workers(old_task);
+		_starpu_push_task_to_workers(old_task);
 	}
 	return;
 }

+ 2 - 1
src/drivers/opencl/driver_opencl_utils.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010, 2011, 2012, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2014, 2015  Centre National de la Recherche Scientifique
  * Copyright (C) 2010-2014  Université de Bordeaux
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -349,6 +349,7 @@ void starpu_opencl_load_program_source(const char *source_file_name, char *locat
 		_STARPU_ERROR("Failed to load compute program from file <%s>!\n", located_file_name);
 
 	sprintf(opencl_program_source, "%s", source);
+	free(source);
 }
 
 static

+ 1 - 1
tests/datawizard/data_invalidation.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010, 2012, 2014  Université de Bordeaux
- * Copyright (C) 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2012, 2013, 2015  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by

+ 8 - 2
tests/datawizard/gpu_register.c

@@ -144,7 +144,10 @@ test_cuda(void)
 	if (STARPU_UNLIKELY(cures))
 		STARPU_CUDA_REPORT_ERROR(cures);
 
-	return check_result(foo, size);
+	ret = check_result(foo, size);
+	starpu_free(foo_gpu);
+	free(foo);
+	return ret;
 }
 #endif
 #endif
@@ -249,7 +252,10 @@ test_opencl(void)
 	if (STARPU_UNLIKELY(err != CL_SUCCESS))
 		STARPU_OPENCL_REPORT_ERROR(err);
 	clFinish(queue);
-	return check_result(foo, size);
+	ret = check_result(foo, size);
+	starpu_free(foo_gpu);
+	free(foo);
+	return ret;
 }
 #endif /* !STARPU_USE_OPENCL */
 

+ 3 - 1
tests/datawizard/interfaces/bcsr/bcsr_cuda.cu

@@ -65,7 +65,9 @@ extern "C" void test_bcsr_cuda_func(void *buffers[], void *args)
 			   ret,
 			   sizeof(int),
 			   cudaMemcpyDeviceToHost);
-	
+	if (error != cudaSuccess)
+		STARPU_CUDA_REPORT_ERROR(error);
+
 	cudaFree(ret);
 	cudaStreamSynchronize(starpu_cuda_get_local_stream());
 }

+ 3 - 1
tests/datawizard/interfaces/coo/coo_cuda.cu

@@ -62,7 +62,9 @@ extern "C" void test_coo_cuda_func(void *buffers[], void *args)
 			   ret,
 			   sizeof(int),
 			   cudaMemcpyDeviceToHost);
-	
+	if (error != cudaSuccess)
+		STARPU_CUDA_REPORT_ERROR(error);
+
 	cudaFree(ret);
 	cudaStreamSynchronize(starpu_cuda_get_local_stream());
 }

+ 3 - 1
tests/datawizard/interfaces/csr/csr_cuda.cu

@@ -61,7 +61,9 @@ extern "C" void test_csr_cuda_func(void *buffers[], void *args)
 			   ret,
 			   sizeof(int),
 			   cudaMemcpyDeviceToHost);
-	
+	if (error != cudaSuccess)
+		STARPU_CUDA_REPORT_ERROR(error);
+
 	cudaFree(ret);
 	cudaStreamSynchronize(starpu_cuda_get_local_stream());
 }

+ 3 - 1
tests/datawizard/interfaces/matrix/matrix_cuda.cu

@@ -64,7 +64,9 @@ extern "C" void test_matrix_cuda_func(void *buffers[], void *args)
 			   ret,
 			   sizeof(int),
 			   cudaMemcpyDeviceToHost);
-	
+	if (error != cudaSuccess)
+		STARPU_CUDA_REPORT_ERROR(error);
+
 	cudaFree(ret);
 	cudaStreamSynchronize(starpu_cuda_get_local_stream());
 }

+ 3 - 1
tests/datawizard/interfaces/multiformat/multiformat_cuda.cu

@@ -70,7 +70,9 @@ extern "C" void test_multiformat_cuda_func(void *buffers[], void *args)
 			   ret,
 			   sizeof(int),
 			   cudaMemcpyDeviceToHost);
-	
+	if (error != cudaSuccess)
+		STARPU_CUDA_REPORT_ERROR(error);
+
 	cudaFree(ret);
 	cudaStreamSynchronize(starpu_cuda_get_local_stream());
 }

+ 4 - 4
tests/datawizard/specific_node.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010, 2014  Université de Bordeaux
- * Copyright (C) 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2012, 2013, 2015  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -82,7 +82,7 @@ int main(STARPU_ATTRIBUTE_UNUSED int argc, STARPU_ATTRIBUTE_UNUSED char **argv)
 	unsigned ntasks = 1000;
 #endif
 
-	int ret;
+	int ret, ret2;
 
 	ret = starpu_init(NULL);
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;
@@ -119,8 +119,8 @@ int main(STARPU_ATTRIBUTE_UNUSED int argc, STARPU_ATTRIBUTE_UNUSED char **argv)
 	ret = (data == ntasks) ? EXIT_SUCCESS : EXIT_FAILURE;
 
 #ifdef STARPU_USE_OPENCL
-        ret = starpu_opencl_unload_opencl(&opencl_program);
-        STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_unload_opencl");
+        ret2 = starpu_opencl_unload_opencl(&opencl_program);
+        STARPU_CHECK_RETURN_VALUE(ret2, "starpu_opencl_unload_opencl");
 #endif
 
 	starpu_shutdown();

+ 1 - 1
tests/disk/disk_compute.c

@@ -150,7 +150,7 @@ int dotest(struct starpu_disk_ops *ops, char *base)
 	if (f == NULL)
 		goto enoent2;
 	/* take datas */
-	int size = fread(C, sizeof(int), NX, f);
+	fread(C, sizeof(int), NX, f);
 
 	/* close the file */
 	fclose(f);

+ 1 - 1
tests/disk/disk_pack.c

@@ -183,7 +183,7 @@ int dotest(struct starpu_disk_ops *ops, char *base)
 	if (f == NULL)
 		goto enoent2;
 	/* take datas */
-	int size = fread(C, sizeof(int), NX, f);
+	fread(C, sizeof(int), NX, f);
 
 	/* close the file */
 	fclose(f);

+ 0 - 2
tests/disk/mem_reclaim.c

@@ -125,8 +125,6 @@ int dotest(struct starpu_disk_ops *ops, char *base, void (*vector_data_register)
 	/* can't write on /tmp/ */
 	if (new_dd == -ENOENT) goto enoent;
 
-	unsigned dd = (unsigned) new_dd;
-
 	unsigned int i;
 
 	/* Initialize twice as much data as available memory */

+ 1 - 2
tests/microbenchs/tasks_overhead.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2011, 2013-2014  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2015  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -113,7 +113,6 @@ int main(int argc, char **argv)
 	/* submit tasks (but don't execute them yet !) */
 	tasks = (struct starpu_task *) calloc(1, ntasks*sizeof(struct starpu_task));
 
-	start_submit = starpu_timing_now();
 	for (i = 0; i < ntasks; i++)
 	{
 		starpu_task_init(&tasks[i]);

+ 2 - 1
tests/parallel_tasks/explicit_combined_worker.c

@@ -60,9 +60,10 @@ int main(int argc, char **argv)
 	starpu_data_handle_t v_handle;
 	unsigned *v;
 	int ret;
-
 	struct starpu_conf conf;
+
 	ret = starpu_conf_init(&conf);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_conf_init");
 	conf.sched_policy_name = "pheft";
 	conf.calibrate = 1;