Sfoglia il codice sorgente

Rename function starpu_helper_cublas_init to starpu_cublas_init
Rename function starpu_helper_cublas_shutdown to starpu_cublas_shutdown

Nathalie Furmento 12 anni fa
parent
commit
850c49fabc

+ 2 - 0
ChangeLog

@@ -142,6 +142,8 @@ Changes:
     starpu_DATATYPE_filter_FILTERTYPE. The script
     tools/dev/rename_filter.sh is provided to rename your existing
     applications using filters.
+  * Rename function starpu_helper_cublas_init to starpu_cublas_init
+  * Rename function starpu_helper_cublas_shutdown to starpu_cublas_shutdown
 
 Small changes:
   * STARPU_NCPU should now be used instead of STARPU_NCPUS. STARPU_NCPUS is

+ 3 - 3
doc/chapters/basic-api.texi

@@ -2533,15 +2533,15 @@ whether @code{devid} is among the @code{cuda_opengl_interoperability} field of
 the @code{starpu_conf} structure.
 @end deftypefun
 
-@deftypefun void starpu_helper_cublas_init (void)
+@deftypefun void starpu_cublas_init (void)
 This function initializes CUBLAS on every CUDA device.
 The CUBLAS library must be initialized prior to any CUBLAS call. Calling
-@code{starpu_helper_cublas_init} will initialize CUBLAS on every CUDA device
+@code{starpu_cublas_init} will initialize CUBLAS on every CUDA device
 controlled by StarPU. This call blocks until CUBLAS has been properly
 initialized on every device.
 @end deftypefun
 
-@deftypefun void starpu_helper_cublas_shutdown (void)
+@deftypefun void starpu_cublas_shutdown (void)
 This function synchronously deinitializes the CUBLAS library on every CUDA device.
 @end deftypefun
 

+ 2 - 2
doc/chapters/tips-tricks.texi

@@ -61,7 +61,7 @@ static void fft(void *descr[], void *_args)
 Another way to go which may be needed is to execute some code from the workers
 themselves thanks to @code{starpu_execute_on_each_worker}. This may be required
 by CUDA to behave properly due to threading issues. For instance, StarPU's
-@code{starpu_helper_cublas_init} looks like the following to call
+@code{starpu_cublas_init} looks like the following to call
 @code{cublasInit} from the workers themselves:
 
 @cartouche
@@ -71,7 +71,7 @@ static void init_cublas_func(void *args STARPU_ATTRIBUTE_UNUSED)
     cublasStatus cublasst = cublasInit();
     cublasSetKernelStream(starpu_cuda_get_local_stream());
 @}
-void starpu_helper_cublas_init(void)
+void starpu_cublas_init(void)
 @{
     starpu_execute_on_each_worker(init_cublas_func, NULL, STARPU_CUDA);
 @}

+ 2 - 2
examples/audio/starpu_audio_processing.c

@@ -412,7 +412,7 @@ int main(int argc, char **argv)
 		return 77;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 	starpu_vector_data_register(&A_handle, 0, (uintptr_t)A, niter*nsamples, sizeof(float));
 
@@ -462,7 +462,7 @@ int main(int argc, char **argv)
 	starpu_data_unpartition(A_handle, 0);
 	starpu_data_unregister(A_handle);
 
-	starpu_helper_cublas_shutdown();
+	starpu_cublas_shutdown();
 
 	/* we are done ! */
 	starpu_shutdown();

+ 1 - 1
examples/axpy/axpy.c

@@ -128,7 +128,7 @@ int main(int argc, char **argv)
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 #endif
 
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 	/* This is equivalent to
 		vec_a = malloc(N*sizeof(TYPE));

+ 2 - 2
examples/cg/cg.c

@@ -417,7 +417,7 @@ int main(int argc, char **argv)
 		return 77;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 	generate_random_problem();
 	register_data();
@@ -431,7 +431,7 @@ int main(int argc, char **argv)
 	starpu_task_wait_for_all();
 	unregister_data();
 	free_data();
-	starpu_helper_cublas_shutdown();
+	starpu_cublas_shutdown();
 	starpu_shutdown();
 
 	return ret;

+ 2 - 2
examples/cholesky/cholesky_grain_tag.c

@@ -292,7 +292,7 @@ static void initialize_system(float **A, unsigned dim, unsigned pinned)
 		exit(77);
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 #ifndef STARPU_SIMGRID
 	if (pinned)
@@ -338,7 +338,7 @@ static void shutdown_system(float **matA, unsigned pinned)
 	     free(*matA);
 	}
 
-	starpu_helper_cublas_shutdown();
+	starpu_cublas_shutdown();
 	starpu_shutdown();
 }
 

+ 2 - 2
examples/cholesky/cholesky_implicit.c

@@ -341,7 +341,7 @@ int main(int argc, char **argv)
                 return 77;
         STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 	if(with_ctxs)
 	{
@@ -357,7 +357,7 @@ int main(int argc, char **argv)
 	else
 		execute_cholesky(size, nblocks);
 
-	starpu_helper_cublas_shutdown();
+	starpu_cublas_shutdown();
 	starpu_shutdown();
 
 	return ret;

+ 2 - 2
examples/cholesky/cholesky_tag.c

@@ -258,7 +258,7 @@ static int initialize_system(float **A, unsigned dim, unsigned pinned)
 		return 77;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 #ifndef STARPU_SIMGRID
 	if (pinned)
@@ -313,7 +313,7 @@ static void shutdown_system(float **matA, unsigned pinned)
 		free(*matA);
 	}
 
-	starpu_helper_cublas_shutdown();
+	starpu_cublas_shutdown();
 	starpu_shutdown();
 }
 

+ 2 - 2
examples/cholesky/cholesky_tile_tag.c

@@ -257,7 +257,7 @@ int main(int argc, char **argv)
 	/* Disable sequential consistency */
 	starpu_data_set_default_sequential_consistency_flag(0);
 
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 #ifndef STARPU_SIMGRID
 	for (y = 0; y < nblocks; y++)
@@ -318,7 +318,7 @@ int main(int argc, char **argv)
 		}
 	}
 
-	starpu_helper_cublas_shutdown();
+	starpu_cublas_shutdown();
 
 	starpu_shutdown();
 	return ret;

+ 1 - 1
examples/heat/dw_factolu.c

@@ -701,7 +701,7 @@ void initialize_system(float **A, float **B, unsigned dim, unsigned pinned)
 		exit(77);
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 	if (pinned)
 	{

+ 1 - 1
examples/heat/dw_sparse_cg.c

@@ -431,7 +431,7 @@ void do_conjugate_gradient(float *nzvalA, float *vecb, float *vecx, uint32_t nnz
 		exit(77);
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 	conjugate_gradient(nzvalA, vecb, vecx, nnz, nrow, colind, rowptr);
 }

+ 1 - 1
examples/heat/heat.c

@@ -788,7 +788,7 @@ int main(int argc, char **argv)
 		if (check)
 			solve_system(DIM, newsize, result, RefArray, Bformer, A, B);
 
-		starpu_helper_cublas_shutdown();
+		starpu_cublas_shutdown();
 		starpu_shutdown();
 		free_system(A, B, newsize, pinned);
 	}

+ 2 - 2
examples/lu/lu_example.c

@@ -310,7 +310,7 @@ int main(int argc, char **argv)
 		return 77;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 	init_matrix();
 
@@ -414,7 +414,7 @@ int main(int argc, char **argv)
 	starpu_free(A);
 
 	FPRINTF(stderr, "Shutting down\n");
-	starpu_helper_cublas_shutdown();
+	starpu_cublas_shutdown();
 
 	starpu_shutdown();
 

+ 2 - 2
examples/mult/xgemm.c

@@ -296,7 +296,7 @@ int main(int argc, char **argv)
 		return 77;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 	init_problem_data();
 	partition_mult_data();
@@ -356,7 +356,7 @@ enodev:
 	starpu_free(B);
 	starpu_free(C);
 
-	starpu_helper_cublas_shutdown();
+	starpu_cublas_shutdown();
 	starpu_shutdown();
 
 	return ret;

+ 1 - 1
examples/pipeline/pipeline.c

@@ -175,7 +175,7 @@ int main(void)
 		exit(77);
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 	/* Initialize the K temporary buffers. No need to allocate it ourselves
 	 * Since it's the X and Y kernels which will fill the initial values. */

+ 2 - 2
examples/reductions/dot_product.c

@@ -333,7 +333,7 @@ int main(int argc, char **argv)
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 #endif
 
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 	unsigned long nelems = nblocks*entries_per_block;
 	size_t size = nelems*sizeof(float);
@@ -400,7 +400,7 @@ int main(int argc, char **argv)
 
 	FPRINTF(stderr, "Reference : %e vs. %e (Delta %e)\n", reference_dot, dot, reference_dot - dot);
 
-	starpu_helper_cublas_shutdown();
+	starpu_cublas_shutdown();
 
 #ifdef STARPU_USE_OPENCL
         ret = starpu_opencl_unload_opencl(&opencl_program);

+ 2 - 2
gcc-plugin/examples/cholesky/cholesky.c

@@ -111,7 +111,7 @@ int main(int argc, char **argv)
 //	conf.calibrate = 1;
 #pragma starpu initialize
 
-        starpu_helper_cublas_init();
+        starpu_cublas_init();
 
 	float bmat[nblocks][nblocks][BLOCKSIZE * BLOCKSIZE] __heap;
 
@@ -247,7 +247,7 @@ int main(int argc, char **argv)
 		}
         }
 
-        starpu_helper_cublas_shutdown();
+        starpu_cublas_shutdown();
 #pragma starpu shutdown
 
 	assert(correctness);

+ 2 - 2
include/starpu_cublas.h

@@ -23,8 +23,8 @@ extern "C"
 {
 #endif
 /* Some helper functions for application using CUBLAS kernels */
-void starpu_helper_cublas_init(void);
-void starpu_helper_cublas_shutdown(void);
+void starpu_cublas_init(void);
+void starpu_cublas_shutdown(void);
 
 #ifdef __cplusplus
 }

+ 2 - 2
mpi/examples/matrix_decomposition/mpi_cholesky.c

@@ -41,7 +41,7 @@ int main(int argc, char **argv)
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_mpi_init");
 	MPI_Comm_rank(MPI_COMM_WORLD, &rank);
 	MPI_Comm_size(MPI_COMM_WORLD, &nodes);
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 	parse_args(argc, argv, nodes);
 
@@ -57,7 +57,7 @@ int main(int argc, char **argv)
 	dw_cholesky_check_computation(bmat, rank, nodes, &correctness, &flops);
 
 	matrix_free(&bmat, rank, nodes, 1);
-	starpu_helper_cublas_shutdown();
+	starpu_cublas_shutdown();
 	starpu_shutdown();
 
 	assert(correctness);

+ 2 - 2
mpi/examples/matrix_decomposition/mpi_cholesky_distributed.c

@@ -40,7 +40,7 @@ int main(int argc, char **argv)
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_mpi_init");
 	MPI_Comm_rank(MPI_COMM_WORLD, &rank);
 	MPI_Comm_size(MPI_COMM_WORLD, &nodes);
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 	parse_args(argc, argv, nodes);
 
@@ -51,7 +51,7 @@ int main(int argc, char **argv)
 	starpu_mpi_shutdown();
 
 	matrix_free(&bmat, rank, nodes, 0);
-	starpu_helper_cublas_shutdown();
+	starpu_cublas_shutdown();
 	starpu_shutdown();
 
 	if (rank == 0)

+ 2 - 2
mpi/examples/mpi_lu/plu_example.c

@@ -432,7 +432,7 @@ int main(int argc, char **argv)
 
 	STARPU_ASSERT(p*q == world_size);
 
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 	int barrier_ret = MPI_Barrier(MPI_COMM_WORLD);
 	STARPU_ASSERT(barrier_ret == MPI_SUCCESS);
@@ -563,7 +563,7 @@ int main(int argc, char **argv)
 	barrier_ret = MPI_Barrier(MPI_COMM_WORLD);
 	STARPU_ASSERT(barrier_ret == MPI_SUCCESS);
 
-	starpu_helper_cublas_shutdown();
+	starpu_cublas_shutdown();
 	starpu_mpi_shutdown();
 	starpu_shutdown();
 

+ 2 - 2
sched_ctx_hypervisor/examples/cholesky/cholesky_grain_tag.c

@@ -276,7 +276,7 @@ static void initialize_system(float **A, unsigned dim, unsigned pinned)
 		exit(77);
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 	if (pinned)
 	{
@@ -319,7 +319,7 @@ static void shutdown_system(float **matA, unsigned pinned)
 	     free(*matA);
 	}
 
-	starpu_helper_cublas_shutdown();
+	starpu_cublas_shutdown();
 	starpu_shutdown();
 }
 

+ 2 - 2
sched_ctx_hypervisor/examples/cholesky/cholesky_implicit.c

@@ -342,7 +342,7 @@ int main(int argc, char **argv)
 
 	starpu_init(NULL);
 
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 	if(with_ctxs)
 	{
@@ -358,7 +358,7 @@ int main(int argc, char **argv)
 	else
 		execute_cholesky(size, nblocks);
 
-	starpu_helper_cublas_shutdown();
+	starpu_cublas_shutdown();
 	starpu_shutdown();
 
 	if(with_ctxs)

+ 2 - 2
sched_ctx_hypervisor/examples/cholesky/cholesky_tag.c

@@ -249,7 +249,7 @@ static int initialize_system(float **A, unsigned dim, unsigned pinned)
 		return 77;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 	if (pinned)
 	{
@@ -302,7 +302,7 @@ static void shutdown_system(float **matA, unsigned pinned)
 		free(*matA);
 	}
 
-	starpu_helper_cublas_shutdown();
+	starpu_cublas_shutdown();
 	starpu_shutdown();
 }
 

+ 2 - 2
sched_ctx_hypervisor/examples/cholesky/cholesky_tile_tag.c

@@ -242,7 +242,7 @@ int main(int argc, char **argv)
 	/* Disable sequential consistency */
 	starpu_data_set_default_sequential_consistency_flag(0);
 
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 	for (y = 0; y < nblocks; y++)
 	for (x = 0; x < nblocks; x++)
@@ -300,7 +300,7 @@ int main(int argc, char **argv)
 		}
 	}
 
-	starpu_helper_cublas_shutdown();
+	starpu_cublas_shutdown();
 
 	starpu_shutdown();
 	return 0;

+ 2 - 2
src/drivers/cuda/starpu_cublas.c

@@ -35,14 +35,14 @@ static void shutdown_cublas_func(void *args STARPU_ATTRIBUTE_UNUSED)
 }
 #endif
 
-void starpu_helper_cublas_init(void)
+void starpu_cublas_init(void)
 {
 #ifdef STARPU_USE_CUDA
 	starpu_execute_on_each_worker(init_cublas_func, NULL, STARPU_CUDA);
 #endif
 }
 
-void starpu_helper_cublas_shutdown(void)
+void starpu_cublas_shutdown(void)
 {
 #ifdef STARPU_USE_CUDA
 	starpu_execute_on_each_worker(shutdown_cublas_func, NULL, STARPU_CUDA);

+ 2 - 2
tests/helper/cublas_init.c

@@ -42,12 +42,12 @@ int main(int argc, char **argv)
 	double shutdown_timing;
 
 	gettimeofday(&start, NULL);
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 	gettimeofday(&end, NULL);
 	init_timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
 
 	gettimeofday(&start, NULL);
-	starpu_helper_cublas_shutdown();
+	starpu_cublas_shutdown();
 	gettimeofday(&end, NULL);
 	shutdown_timing = (double)((end.tv_sec - start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec));
 

+ 2 - 2
tests/microbenchs/matrix_as_vector.c

@@ -201,7 +201,7 @@ int main(int argc, char **argv)
 	ret = starpu_init(NULL);
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
-	starpu_helper_cublas_init();
+	starpu_cublas_init();
 
 	devices = starpu_cpu_worker_get_count();
 	if (devices)
@@ -224,7 +224,7 @@ int main(int argc, char **argv)
 
 error:
 	if (ret == -ENODEV) ret=STARPU_TEST_SKIPPED;
-	starpu_helper_cublas_shutdown();
+	starpu_cublas_shutdown();
 	starpu_shutdown();
 	STARPU_RETURN(ret);
 }

+ 6 - 1
tools/dev/rename.sed

@@ -1,7 +1,7 @@
 # StarPU --- Runtime system for heterogeneous multicore architectures.
 #
 # Copyright (C) 2010  Université de Bordeaux 1
-# Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+# Copyright (C) 2010, 2011, 2012, 2013  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
@@ -151,3 +151,8 @@ s/\bstarpu_get_current_task\b/starpu_task_get_current/g
 s/\bstarpu_pack_cl_args\b/starpu_codelet_pack_args/g
 s/\bstarpu_unpack_cl_args\b/starpu_codelet_unpack_args/g
 s/\bstarpu_task_deinit\b/starpu_task_clean/g
+
+
+s/\bstarpu_helper_cublas_init\b/starpu_cublas_init/g
+s/\bstarpu_helper_cublas_shutdown\b/starpu_cublas_shutdown/g
+