瀏覽代碼

Massive cleanup in the examples/cholesky/ directory. Remove traces of the "dw_"
prefix.

Cédric Augonnet 14 年之前
父節點
當前提交
0de9ecb7a8

+ 19 - 20
examples/Makefile.am

@@ -108,8 +108,7 @@ noinst_HEADERS = 				\
 	pi/SobolQRNG/sobol_gold.h		\
 	pi/SobolQRNG/sobol_gpu.h		\
 	pi/SobolQRNG/sobol_primitives.h		\
-	cholesky/dw_cholesky_models.h		\
-	cholesky/dw_cholesky.h			\
+	cholesky/cholesky.h			\
 	common/blas_model.h			\
 	common/blas.h				\
 	mult/simple.h				\
@@ -344,34 +343,34 @@ endif
 
 if !NO_BLAS_LIB
 
-examplebin_PROGRAMS += 			\
-	cholesky/dw_cholesky			\
-	cholesky/dw_cholesky_no_stride		\
-	cholesky/dw_cholesky_grain		\
+examplebin_PROGRAMS += 				\
+	cholesky/cholesky_tag			\
+	cholesky/cholesky_tile_tag		\
+	cholesky/cholesky_grain_tag		\
 	cholesky/cholesky_implicit
 
-cholesky_dw_cholesky_SOURCES =			\
-	cholesky/dw_cholesky.c			\
-	cholesky/dw_cholesky_models.c		\
-	cholesky/dw_cholesky_kernels.c		\
+cholesky_cholesky_tag_SOURCES =			\
+	cholesky/cholesky_tag.c			\
+	cholesky/cholesky_models.c		\
+	cholesky/cholesky_kernels.c		\
 	common/blas.c
 
-cholesky_dw_cholesky_no_stride_SOURCES =	\
-	cholesky/dw_cholesky_no_stride.c	\
-	cholesky/dw_cholesky_models.c		\
-	cholesky/dw_cholesky_kernels.c		\
+cholesky_cholesky_tile_tag_SOURCES =		\
+	cholesky/cholesky_tile_tag.c		\
+	cholesky/cholesky_models.c		\
+	cholesky/cholesky_kernels.c		\
 	common/blas.c
 
-cholesky_dw_cholesky_grain_SOURCES =		\
-	cholesky/dw_cholesky_grain.c		\
-	cholesky/dw_cholesky_models.c		\
-	cholesky/dw_cholesky_kernels.c		\
+cholesky_cholesky_grain_tag_SOURCES =		\
+	cholesky/cholesky_grain_tag.c		\
+	cholesky/cholesky_models.c		\
+	cholesky/cholesky_kernels.c		\
 	common/blas.c
 
 cholesky_cholesky_implicit_SOURCES =		\
 	cholesky/cholesky_implicit.c		\
-	cholesky/dw_cholesky_models.c		\
-	cholesky/dw_cholesky_kernels.c		\
+	cholesky/cholesky_models.c		\
+	cholesky/cholesky_kernels.c		\
 	common/blas.c
 
 endif

+ 1 - 18
examples/cholesky/dw_cholesky.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010  Université de Bordeaux 1
+ * Copyright (C) 2009, 2010, 2011  Université de Bordeaux 1
  * Copyright (C) 2010  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -18,7 +18,6 @@
 #ifndef __DW_CHOLESKY_H__
 #define __DW_CHOLESKY_H__
 
-#include <semaphore.h>
 #include <string.h>
 #include <math.h>
 #include <sys/time.h>
@@ -40,8 +39,6 @@
 					| ((unsigned long long)(i)<<16)	\
 					| (unsigned long long)(j))))
 
-
-
 #define TAG11_AUX(k, prefix)	((starpu_tag_t)( (((unsigned long long)(prefix))<<60)  |  (1ULL<<56) | (unsigned long long)(k)))
 #define TAG21_AUX(k,j, prefix)	((starpu_tag_t)( (((unsigned long long)(prefix))<<60)  			\
 					|  ((3ULL<<56) | (((unsigned long long)(k))<<32)	\
@@ -53,20 +50,9 @@
 
 #define BLOCKSIZE	(size/nblocks)
 
-
 #define BLAS3_FLOP(n1,n2,n3)    \
         (2*((uint64_t)n1)*((uint64_t)n2)*((uint64_t)n3))
 
-typedef struct {
-	starpu_data_handle dataA;
-	unsigned i;
-	unsigned j;
-	unsigned k;
-	unsigned nblocks;
-	unsigned *remaining;
-	sem_t *sem;
-} cl_args;
-
 static unsigned size = 4*1024;
 static unsigned nblocks = 16;
 static unsigned nbigblocks = 8;
@@ -83,9 +69,6 @@ void chol_cublas_codelet_update_u21(void *descr[], void *_args);
 void chol_cublas_codelet_update_u22(void *descr[], void *_args);
 #endif
 
-void initialize_system(float **A, unsigned dim, unsigned pinned);
-void dw_cholesky(float *matA, unsigned size, unsigned ld, unsigned nblocks);
-
 extern struct starpu_perfmodel_t chol_model_11;
 extern struct starpu_perfmodel_t chol_model_21;
 extern struct starpu_perfmodel_t chol_model_22;

+ 8 - 9
examples/cholesky/dw_cholesky_grain.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010  Université de Bordeaux 1
+ * Copyright (C) 2009, 2010, 2011  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
  * Copyright (C) 2010  Centre National de la Recherche Scientifique
  *
@@ -16,8 +16,7 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#include "dw_cholesky.h"
-#include "dw_cholesky_models.h"
+#include "cholesky.h"
 
 /*
  *	Some useful functions
@@ -158,7 +157,7 @@ static void create_task_22(starpu_data_handle dataA, unsigned k, unsigned i, uns
  *	and construct the DAG
  */
 
-static void _dw_cholesky_grain(float *matA, unsigned size, unsigned ld, unsigned nblocks, unsigned nbigblocks, unsigned reclevel)
+static void cholesky_grain_rec(float *matA, unsigned size, unsigned ld, unsigned nblocks, unsigned nbigblocks, unsigned reclevel)
 {
 	/* create a new codelet */
 	struct starpu_task *entry_task = NULL;
@@ -250,11 +249,11 @@ static void _dw_cholesky_grain(float *matA, unsigned size, unsigned ld, unsigned
 
 		float *newmatA = &matA[nbigblocks*(size/nblocks)*(ld+1)];
 
-		_dw_cholesky_grain(newmatA, size/nblocks*(nblocks - nbigblocks), ld, (nblocks - nbigblocks)*2, (nblocks - nbigblocks)*2, reclevel+1);
+		cholesky_grain_rec(newmatA, size/nblocks*(nblocks - nbigblocks), ld, (nblocks - nbigblocks)*2, (nblocks - nbigblocks)*2, reclevel+1);
 	}
 }
 
-void initialize_system(float **A, unsigned dim, unsigned pinned)
+static void initialize_system(float **A, unsigned dim, unsigned pinned)
 {
 	starpu_init(NULL);
 
@@ -269,14 +268,14 @@ void initialize_system(float **A, unsigned dim, unsigned pinned)
 	}
 }
 
-void dw_cholesky_grain(float *matA, unsigned size, unsigned ld, unsigned nblocks, unsigned nbigblocks)
+void cholesky_grain(float *matA, unsigned size, unsigned ld, unsigned nblocks, unsigned nbigblocks)
 {
 	struct timeval start;
 	struct timeval end;
 
 	gettimeofday(&start, NULL);
 
-	_dw_cholesky_grain(matA, size, ld, nblocks, nbigblocks, 0);
+	cholesky_grain_rec(matA, size, ld, nblocks, nbigblocks, 0);
 
 	gettimeofday(&end, NULL);
 
@@ -336,7 +335,7 @@ int main(int argc, char **argv)
 #endif
 
 
-	dw_cholesky_grain(mat, size, size, nblocks, nbigblocks);
+	cholesky_grain(mat, size, size, nblocks, nbigblocks);
 
 #ifdef CHECK_OUTPUT
 	printf("Results :\n");

+ 7 - 8
examples/cholesky/cholesky_implicit.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010  Université de Bordeaux 1
+ * Copyright (C) 2009, 2010, 2011  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
  * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
@@ -16,8 +16,7 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#include "dw_cholesky.h"
-#include "dw_cholesky_models.h"
+#include "cholesky.h"
 
 /*
  *	Create the codelets
@@ -61,7 +60,7 @@ static starpu_codelet cl22 =
  *	and construct the DAG
  */
 
-static void _dw_cholesky(starpu_data_handle dataA, unsigned nblocks)
+static void _cholesky(starpu_data_handle dataA, unsigned nblocks)
 {
 	struct timeval start;
 	struct timeval end;
@@ -130,7 +129,7 @@ static void _dw_cholesky(starpu_data_handle dataA, unsigned nblocks)
 	fprintf(stderr, "Synthetic GFlops : %2.2f\n", (flop/timing/1000.0f));
 }
 
-void initialize_system(float **A, unsigned dim, unsigned pinned)
+static void initialize_system(float **A, unsigned dim, unsigned pinned)
 {
 	starpu_init(NULL);
 
@@ -145,7 +144,7 @@ void initialize_system(float **A, unsigned dim, unsigned pinned)
 	}
 }
 
-void dw_cholesky(float *matA, unsigned size, unsigned ld, unsigned nblocks)
+static void cholesky(float *matA, unsigned size, unsigned ld, unsigned nblocks)
 {
 	starpu_data_handle dataA;
 
@@ -167,7 +166,7 @@ void dw_cholesky(float *matA, unsigned size, unsigned ld, unsigned nblocks)
 
 	starpu_data_map_filters(dataA, 2, &f, &f2);
 
-	_dw_cholesky(dataA, nblocks);
+	_cholesky(dataA, nblocks);
 
 	starpu_helper_cublas_shutdown();
 
@@ -218,7 +217,7 @@ int main(int argc, char **argv)
 	}
 #endif
 
-	dw_cholesky(mat, size, size, nblocks);
+	cholesky(mat, size, size, nblocks);
 
 #ifdef PRINT_OUTPUT
 	printf("Results :\n");

+ 2 - 2
examples/cholesky/dw_cholesky_kernels.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010  Université de Bordeaux 1
+ * Copyright (C) 2009, 2010, 2011  Université de Bordeaux 1
  * Copyright (C) 2010  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -16,7 +16,7 @@
  */
 
 #include <starpu_config.h>
-#include "dw_cholesky.h"
+#include "cholesky.h"
 #include "../common/blas.h"
 #ifdef STARPU_USE_CUDA
 #include <cuda.h>

+ 2 - 3
examples/cholesky/dw_cholesky_models.c

@@ -15,8 +15,6 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#include "dw_cholesky_models.h"
-
 /*
  * As a convention, in that file, descr[0] is represented by A,
  * 				  descr[1] is B ...
@@ -26,8 +24,9 @@
  *	Number of flops of Gemm 
  */
 
-//#define USE_PERTURBATION	1
+#include <starpu.h>
 
+//#define USE_PERTURBATION	1
 
 #ifdef USE_PERTURBATION
 #define PERTURBATE(a)	((starpu_drand48()*2.0f*(AMPL) + 1.0f - (AMPL))*(a))

+ 7 - 8
examples/cholesky/dw_cholesky.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010  Université de Bordeaux 1
+ * Copyright (C) 2009, 2010, 2011  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
  * Copyright (C) 2010  Centre National de la Recherche Scientifique
  *
@@ -16,8 +16,7 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#include "dw_cholesky.h"
-#include "dw_cholesky_models.h"
+#include "cholesky.h"
 
 /*
  *	Some useful functions
@@ -168,7 +167,7 @@ static void create_task_22(starpu_data_handle dataA, unsigned k, unsigned i, uns
  *	and construct the DAG
  */
 
-static void _dw_cholesky(starpu_data_handle dataA, unsigned nblocks)
+static void _cholesky(starpu_data_handle dataA, unsigned nblocks)
 {
 	struct timeval start;
 	struct timeval end;
@@ -234,7 +233,7 @@ static void _dw_cholesky(starpu_data_handle dataA, unsigned nblocks)
 	fprintf(stderr, "Synthetic GFlops : %2.2f\n", (flop/timing/1000.0f));
 }
 
-void initialize_system(float **A, unsigned dim, unsigned pinned)
+static void initialize_system(float **A, unsigned dim, unsigned pinned)
 {
 	starpu_init(NULL);
 	
@@ -249,7 +248,7 @@ void initialize_system(float **A, unsigned dim, unsigned pinned)
 	}
 }
 
-void dw_cholesky(float *matA, unsigned size, unsigned ld, unsigned nblocks)
+static void cholesky(float *matA, unsigned size, unsigned ld, unsigned nblocks)
 {
 	starpu_data_handle dataA;
 
@@ -273,7 +272,7 @@ void dw_cholesky(float *matA, unsigned size, unsigned ld, unsigned nblocks)
 
 	starpu_data_map_filters(dataA, 2, &f, &f2);
 
-	_dw_cholesky(dataA, nblocks);
+	_cholesky(dataA, nblocks);
 
 	starpu_helper_cublas_shutdown();
 
@@ -324,7 +323,7 @@ int main(int argc, char **argv)
 #endif
 
 
-	dw_cholesky(mat, size, size, nblocks);
+	cholesky(mat, size, size, nblocks);
 
 #ifdef CHECK_OUTPUT
 	printf("Results :\n");

+ 4 - 5
examples/cholesky/dw_cholesky_no_stride.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009, 2010  Université de Bordeaux 1
+ * Copyright (C) 2009, 2010, 2011  Université de Bordeaux 1
  * Copyright (C) 2010  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -15,8 +15,7 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
 
-#include "dw_cholesky.h"
-#include "dw_cholesky_models.h"
+#include "cholesky.h"
 
 /* A [ y ] [ x ] */
 float *A[NMAXBLOCKS][NMAXBLOCKS];
@@ -182,7 +181,7 @@ static void create_task_22(unsigned k, unsigned i, unsigned j)
  *	and construct the DAG
  */
 
-static void dw_cholesky_no_stride(void)
+static void cholesky_no_stride(void)
 {
 	struct timeval start;
 	struct timeval end;
@@ -302,7 +301,7 @@ int main(int argc, char **argv)
 		}
 	}
 
-	dw_cholesky_no_stride();
+	cholesky_no_stride();
 
 	starpu_helper_cublas_shutdown();
 

+ 0 - 23
examples/cholesky/dw_cholesky_models.h

@@ -1,23 +0,0 @@
-/* StarPU --- Runtime system for heterogeneous multicore architectures.
- *
- * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  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
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * StarPU is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * See the GNU Lesser General Public License in COPYING.LGPL for more details.
- */
-
-#ifndef __DW_CHOLESKY_MODELS_H__
-#define __DW_CHOLESKY_MODELS_H__
-
-#include <starpu.h>
-
-#endif // __DW_CHOLESKY_MODELS_H__