Przeglądaj źródła

Add real dataset files

hmar 5 lat temu
rodzic
commit
2b716b1a74
100 zmienionych plików z 8812 dodań i 0 usunięć
  1. 1174 0
      real-life-dataset/config.txt
  2. 5 0
      real-life-dataset/polybench/CPU/datamining/correlation/Makefile
  3. 180 0
      real-life-dataset/polybench/CPU/datamining/correlation/correlation.c
  4. 180 0
      real-life-dataset/polybench/CPU/datamining/correlation/correlation.c_backup
  5. BIN
      real-life-dataset/polybench/CPU/datamining/correlation/correlation.exe
  6. 73 0
      real-life-dataset/polybench/CPU/datamining/correlation/correlation.h
  7. 5 0
      real-life-dataset/polybench/CPU/datamining/covariance/Makefile
  8. 153 0
      real-life-dataset/polybench/CPU/datamining/covariance/covariance.c
  9. 153 0
      real-life-dataset/polybench/CPU/datamining/covariance/covariance.c_backup
  10. BIN
      real-life-dataset/polybench/CPU/datamining/covariance/covariance.exe
  11. 69 0
      real-life-dataset/polybench/CPU/datamining/covariance/covariance.h
  12. 188 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/2mm/2mm.c
  13. 188 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/2mm/2mm.c_backup
  14. BIN
      real-life-dataset/polybench/CPU/linear-algebra/kernels/2mm/2mm.exe
  15. 73 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/2mm/2mm.h
  16. 5 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/2mm/Makefile
  17. 203 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/3mm/3mm.c
  18. 203 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/3mm/3mm.c_backup
  19. BIN
      real-life-dataset/polybench/CPU/linear-algebra/kernels/3mm/3mm.exe
  20. 79 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/3mm/3mm.h
  21. 5 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/3mm/Makefile
  22. 5 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/atax/Makefile
  23. 139 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/atax/atax.c
  24. 139 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/atax/atax.c_backup
  25. BIN
      real-life-dataset/polybench/CPU/linear-algebra/kernels/atax/atax.exe
  26. 61 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/atax/atax.h
  27. 5 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/bicg/Makefile
  28. 154 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/bicg/bicg.c
  29. 154 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/bicg/bicg.c_backup
  30. BIN
      real-life-dataset/polybench/CPU/linear-algebra/kernels/bicg/bicg.exe
  31. 61 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/bicg/bicg.h
  32. 5 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/doitgen/Makefile
  33. 158 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/doitgen/doitgen.c
  34. 158 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/doitgen/doitgen.c_backup
  35. BIN
      real-life-dataset/polybench/CPU/linear-algebra/kernels/doitgen/doitgen.exe
  36. 66 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/doitgen/doitgen.h
  37. 5 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/gemm/Makefile
  38. 157 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/gemm/gemm.c
  39. 157 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/gemm/gemm.c_backup
  40. BIN
      real-life-dataset/polybench/CPU/linear-algebra/kernels/gemm/gemm.exe
  41. 67 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/gemm/gemm.h
  42. 5 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/gemver/Makefile
  43. 199 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/gemver/gemver.c
  44. 199 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/gemver/gemver.c_backup
  45. BIN
      real-life-dataset/polybench/CPU/linear-algebra/kernels/gemver/gemver.exe
  46. 63 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/gemver/gemver.h
  47. 5 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/gesummv/Makefile
  48. 148 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/gesummv/gesummv.c
  49. 148 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/gesummv/gesummv.c_backup
  50. BIN
      real-life-dataset/polybench/CPU/linear-algebra/kernels/gesummv/gesummv.exe
  51. 55 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/gesummv/gesummv.h
  52. 5 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/mvt/Makefile
  53. 144 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/mvt/mvt.c
  54. 144 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/mvt/mvt.c_backup
  55. BIN
      real-life-dataset/polybench/CPU/linear-algebra/kernels/mvt/mvt.exe
  56. 55 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/mvt/mvt.h
  57. 5 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/syr2k/Makefile
  58. 159 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/syr2k/syr2k.c
  59. 159 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/syr2k/syr2k.c_backup
  60. BIN
      real-life-dataset/polybench/CPU/linear-algebra/kernels/syr2k/syr2k.exe
  61. 61 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/syr2k/syr2k.h
  62. 5 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/syrk/Makefile
  63. 150 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/syrk/syrk.c
  64. 150 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/syrk/syrk.c_backup
  65. BIN
      real-life-dataset/polybench/CPU/linear-algebra/kernels/syrk/syrk.exe
  66. 61 0
      real-life-dataset/polybench/CPU/linear-algebra/kernels/syrk/syrk.h
  67. 5 0
      real-life-dataset/polybench/CPU/linear-algebra/solvers/gramschmidt/Makefile
  68. 159 0
      real-life-dataset/polybench/CPU/linear-algebra/solvers/gramschmidt/gramschmidt.c
  69. 159 0
      real-life-dataset/polybench/CPU/linear-algebra/solvers/gramschmidt/gramschmidt.c_backup
  70. BIN
      real-life-dataset/polybench/CPU/linear-algebra/solvers/gramschmidt/gramschmidt.exe
  71. 60 0
      real-life-dataset/polybench/CPU/linear-algebra/solvers/gramschmidt/gramschmidt.h
  72. 5 0
      real-life-dataset/polybench/CPU/linear-algebra/solvers/lu/Makefile
  73. 216 0
      real-life-dataset/polybench/CPU/linear-algebra/solvers/lu/lu.cu
  74. 59 0
      real-life-dataset/polybench/CPU/linear-algebra/solvers/lu/lu.cuh
  75. 5 0
      real-life-dataset/polybench/CPU/stencils/adi/Makefile
  76. 169 0
      real-life-dataset/polybench/CPU/stencils/adi/adi.c
  77. 169 0
      real-life-dataset/polybench/CPU/stencils/adi/adi.c_backup
  78. BIN
      real-life-dataset/polybench/CPU/stencils/adi/adi.exe
  79. 61 0
      real-life-dataset/polybench/CPU/stencils/adi/adi.h
  80. 134 0
      real-life-dataset/polybench/CPU/stencils/convolution-2d/2DConvolution.c
  81. 134 0
      real-life-dataset/polybench/CPU/stencils/convolution-2d/2DConvolution.c_backup
  82. BIN
      real-life-dataset/polybench/CPU/stencils/convolution-2d/2DConvolution.exe
  83. 61 0
      real-life-dataset/polybench/CPU/stencils/convolution-2d/2DConvolution.h
  84. 5 0
      real-life-dataset/polybench/CPU/stencils/convolution-2d/Makefile
  85. 143 0
      real-life-dataset/polybench/CPU/stencils/convolution-3d/3DConvolution.c
  86. 143 0
      real-life-dataset/polybench/CPU/stencils/convolution-3d/3DConvolution.c_backup
  87. BIN
      real-life-dataset/polybench/CPU/stencils/convolution-3d/3DConvolution.exe
  88. 67 0
      real-life-dataset/polybench/CPU/stencils/convolution-3d/3DConvolution.h
  89. 5 0
      real-life-dataset/polybench/CPU/stencils/convolution-3d/Makefile
  90. 5 0
      real-life-dataset/polybench/CPU/stencils/fdtd-2d/Makefile
  91. 160 0
      real-life-dataset/polybench/CPU/stencils/fdtd-2d/fdtd2d.c
  92. 160 0
      real-life-dataset/polybench/CPU/stencils/fdtd-2d/fdtd2d.c_backup
  93. BIN
      real-life-dataset/polybench/CPU/stencils/fdtd-2d/fdtd2d.exe
  94. 67 0
      real-life-dataset/polybench/CPU/stencils/fdtd-2d/fdtd2d.h
  95. 5 0
      real-life-dataset/polybench/CPU/stencils/jacobi-1d-imper/Makefile
  96. 124 0
      real-life-dataset/polybench/CPU/stencils/jacobi-1d-imper/jacobi1D.c
  97. 124 0
      real-life-dataset/polybench/CPU/stencils/jacobi-1d-imper/jacobi1D.c_backup
  98. BIN
      real-life-dataset/polybench/CPU/stencils/jacobi-1d-imper/jacobi1D.exe
  99. 61 0
      real-life-dataset/polybench/CPU/stencils/jacobi-1d-imper/jacobi1D.h
  100. 0 0
      real-life-dataset/polybench/CPU/stencils/jacobi-2d-imper/Makefile

Plik diff jest za duży
+ 1174 - 0
real-life-dataset/config.txt


+ 5 - 0
real-life-dataset/polybench/CPU/datamining/correlation/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := correlation.exe -lm
+CUFILES := correlation.c
+PATH_TO_UTILS := ../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 180 - 0
real-life-dataset/polybench/CPU/datamining/correlation/correlation.c

@@ -0,0 +1,180 @@
+/**
+ * correlation.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <sys/time.h>
+
+#define POLYBENCH_TIME 1
+
+#include "correlation.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 1.05
+
+#define GPU_DEVICE 0
+
+#define sqrt_of_array_cell(x,j) sqrt(x[j])
+
+#define FLOAT_N 3214212.01f
+#define EPS 0.005f
+
+#define RUN_ON_CPU
+
+
+void init_arrays(int m, int n, DATA_TYPE POLYBENCH_2D(data, M, N, m, n))
+{
+	int i, j;
+	
+	for (i=0; i < m; i++) 
+	{
+    		for (j=0; j < n; j++) 
+		{
+       		data[i][j] = ((DATA_TYPE) i*j)/ M;	
+       	}
+    	}
+}
+
+
+void correlation(int m, int n, DATA_TYPE POLYBENCH_2D(data, M, N, m, n), DATA_TYPE POLYBENCH_1D(mean, M, m), DATA_TYPE POLYBENCH_1D(stddev, M, m),
+		DATA_TYPE POLYBENCH_2D(symmat, M, N, m, n))
+{
+	int i, j, j1, j2;	
+	
+	// Determine mean of column vectors of input data matrix 
+  	for (j = 0; j < _PB_M; j++)
+   	{
+  		mean[j] = 0.0;
+
+   		for (i = 0; i < _PB_N; i++)
+		{
+			mean[j] += data[i][j];
+   		}
+		
+		mean[j] /= (DATA_TYPE)FLOAT_N;
+   	}
+
+	// Determine standard deviations of column vectors of data matrix. 
+  	for (j = 0; j < _PB_M; j++)
+   	{
+   		stddev[j] = 0.0;
+      
+		for (i = 0; i < _PB_N; i++)
+		{
+			stddev[j] += (data[i][j] - mean[j]) * (data[i][j] - mean[j]);
+		}
+		
+		stddev[j] /= FLOAT_N;
+		stddev[j] = sqrt_of_array_cell(stddev, j);
+		stddev[j] = stddev[j] <= EPS ? 1.0 : stddev[j];
+	}
+
+ 	// Center and reduce the column vectors. 
+  	for (i = 0; i < _PB_N; i++)
+	{
+		for (j = 0; j < _PB_M; j++)
+		{
+			data[i][j] -= mean[j];
+			data[i][j] /= (sqrt(FLOAT_N)*stddev[j]) ;
+		}
+	}
+
+	// Calculate the m * m correlation matrix. 
+  	for (j1 = 0; j1 < _PB_M-1; j1++)
+	{	
+		symmat[j1][j1] = 1.0;
+    
+		for (j2 = j1+1; j2 < _PB_M; j2++)
+		{
+	  		symmat[j1][j2] = 0.0;
+
+	  		for (i = 0; i < _PB_N; i++)
+			{
+	   			symmat[j1][j2] += (data[i][j1] * data[i][j2]);
+			}
+
+	  		symmat[j2][j1] = symmat[j1][j2];
+		}
+	}
+ 
+	symmat[M-1][M-1] = 1.0;
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int m,
+		 DATA_TYPE POLYBENCH_2D(symmat,M,M,m,m))
+
+{
+  int i, j;
+
+  for (i = 0; i < m; i++)
+    for (j = 0; j < m; j++) {
+      fprintf (stderr, DATA_PRINTF_MODIFIER, symmat[i][j]);
+      if ((i * m + j) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char** argv)
+{
+	int m = M;
+	int n = N;
+
+	POLYBENCH_2D_ARRAY_DECL(data,DATA_TYPE,M,N,m,n);
+  	POLYBENCH_1D_ARRAY_DECL(mean,DATA_TYPE,M,m);
+  	POLYBENCH_1D_ARRAY_DECL(stddev,DATA_TYPE,M,m);
+	POLYBENCH_2D_ARRAY_DECL(symmat,DATA_TYPE,M,N,m,n);
+  	POLYBENCH_2D_ARRAY_DECL(symmat_outputFromGpu,DATA_TYPE,M,N,m,n);
+  	
+	init_arrays(m, n, POLYBENCH_ARRAY(data));
+    
+	//GPU_argv_init();
+
+	//correlationCuda(m, n, POLYBENCH_ARRAY(data), POLYBENCH_ARRAY(mean), POLYBENCH_ARRAY(stddev), POLYBENCH_ARRAY(symmat), 
+	//	POLYBENCH_ARRAY(symmat_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		correlation(m, n, POLYBENCH_ARRAY(data), POLYBENCH_ARRAY(mean), POLYBENCH_ARRAY(stddev), POLYBENCH_ARRAY(symmat));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+    
+		//compareResults(m, n, POLYBENCH_ARRAY(symmat), POLYBENCH_ARRAY(symmat_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(m, POLYBENCH_ARRAY(symmat_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(data);
+	POLYBENCH_FREE_ARRAY(mean);
+	POLYBENCH_FREE_ARRAY(stddev);
+	POLYBENCH_FREE_ARRAY(symmat);
+	POLYBENCH_FREE_ARRAY(symmat_outputFromGpu);
+
+  	return 0;
+}
+
+#include <polybench.c>

+ 180 - 0
real-life-dataset/polybench/CPU/datamining/correlation/correlation.c_backup

@@ -0,0 +1,180 @@
+/**
+ * correlation.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <sys/time.h>
+
+#define POLYBENCH_TIME 1
+
+#include "correlation.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 1.05
+
+#define GPU_DEVICE 0
+
+#define sqrt_of_array_cell(x,j) sqrt(x[j])
+
+#define FLOAT_N 3214212.01f
+#define EPS 0.005f
+
+#define RUN_ON_CPU
+
+
+void init_arrays(int m, int n, DATA_TYPE POLYBENCH_2D(data, M, N, m, n))
+{
+	int i, j;
+	
+	for (i=0; i < m; i++) 
+	{
+    		for (j=0; j < n; j++) 
+		{
+       		data[i][j] = ((DATA_TYPE) i*j)/ M;	
+       	}
+    	}
+}
+
+
+void correlation(int m, int n, DATA_TYPE POLYBENCH_2D(data, M, N, m, n), DATA_TYPE POLYBENCH_1D(mean, M, m), DATA_TYPE POLYBENCH_1D(stddev, M, m),
+		DATA_TYPE POLYBENCH_2D(symmat, M, N, m, n))
+{
+	int i, j, j1, j2;	
+	
+	// Determine mean of column vectors of input data matrix 
+  	for (j = 0; j < _PB_M; j++)
+   	{
+  		mean[j] = 0.0;
+
+   		for (i = 0; i < _PB_N; i++)
+		{
+			mean[j] += data[i][j];
+   		}
+		
+		mean[j] /= (DATA_TYPE)FLOAT_N;
+   	}
+
+	// Determine standard deviations of column vectors of data matrix. 
+  	for (j = 0; j < _PB_M; j++)
+   	{
+   		stddev[j] = 0.0;
+      
+		for (i = 0; i < _PB_N; i++)
+		{
+			stddev[j] += (data[i][j] - mean[j]) * (data[i][j] - mean[j]);
+		}
+		
+		stddev[j] /= FLOAT_N;
+		stddev[j] = sqrt_of_array_cell(stddev, j);
+		stddev[j] = stddev[j] <= EPS ? 1.0 : stddev[j];
+	}
+
+ 	// Center and reduce the column vectors. 
+  	for (i = 0; i < _PB_N; i++)
+	{
+		for (j = 0; j < _PB_M; j++)
+		{
+			data[i][j] -= mean[j];
+			data[i][j] /= (sqrt(FLOAT_N)*stddev[j]) ;
+		}
+	}
+
+	// Calculate the m * m correlation matrix. 
+  	for (j1 = 0; j1 < _PB_M-1; j1++)
+	{	
+		symmat[j1][j1] = 1.0;
+    
+		for (j2 = j1+1; j2 < _PB_M; j2++)
+		{
+	  		symmat[j1][j2] = 0.0;
+
+	  		for (i = 0; i < _PB_N; i++)
+			{
+	   			symmat[j1][j2] += (data[i][j1] * data[i][j2]);
+			}
+
+	  		symmat[j2][j1] = symmat[j1][j2];
+		}
+	}
+ 
+	symmat[M-1][M-1] = 1.0;
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int m,
+		 DATA_TYPE POLYBENCH_2D(symmat,M,M,m,m))
+
+{
+  int i, j;
+
+  for (i = 0; i < m; i++)
+    for (j = 0; j < m; j++) {
+      fprintf (stderr, DATA_PRINTF_MODIFIER, symmat[i][j]);
+      if ((i * m + j) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char** argv)
+{
+	int m = M;
+	int n = N;
+
+	POLYBENCH_2D_ARRAY_DECL(data,DATA_TYPE,M,N,m,n);
+  	POLYBENCH_1D_ARRAY_DECL(mean,DATA_TYPE,M,m);
+  	POLYBENCH_1D_ARRAY_DECL(stddev,DATA_TYPE,M,m);
+	POLYBENCH_2D_ARRAY_DECL(symmat,DATA_TYPE,M,N,m,n);
+  	POLYBENCH_2D_ARRAY_DECL(symmat_outputFromGpu,DATA_TYPE,M,N,m,n);
+  	
+	init_arrays(m, n, POLYBENCH_ARRAY(data));
+    
+	//GPU_argv_init();
+
+	//correlationCuda(m, n, POLYBENCH_ARRAY(data), POLYBENCH_ARRAY(mean), POLYBENCH_ARRAY(stddev), POLYBENCH_ARRAY(symmat), 
+	//	POLYBENCH_ARRAY(symmat_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		correlation(m, n, POLYBENCH_ARRAY(data), POLYBENCH_ARRAY(mean), POLYBENCH_ARRAY(stddev), POLYBENCH_ARRAY(symmat));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+    
+		//compareResults(m, n, POLYBENCH_ARRAY(symmat), POLYBENCH_ARRAY(symmat_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(m, POLYBENCH_ARRAY(symmat_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(data);
+	POLYBENCH_FREE_ARRAY(mean);
+	POLYBENCH_FREE_ARRAY(stddev);
+	POLYBENCH_FREE_ARRAY(symmat);
+	POLYBENCH_FREE_ARRAY(symmat_outputFromGpu);
+
+  	return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/datamining/correlation/correlation.exe


+ 73 - 0
real-life-dataset/polybench/CPU/datamining/correlation/correlation.h

@@ -0,0 +1,73 @@
+/**
+ * correlation.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef CORRELATION_CUH
+# define CORRELATION_CUH
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(M) && !defined(N)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+#define M 512
+#define N 512
+#  endif
+
+#  ifdef SMALL_DATASET
+#define M 1024
+#define N 1024
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+#define M 2048
+#define N 2048
+#  endif
+
+#  ifdef LARGE_DATASET
+#define M 4096
+#define N 4096
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+#define M 8192
+#define N 8192
+#  endif
+# endif /* !N */
+
+# define _PB_M POLYBENCH_LOOP_BOUND(M,m)
+# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions for kernel 1*/
+#define DIM_THREAD_BLOCK_KERNEL_1_X 256
+#define DIM_THREAD_BLOCK_KERNEL_1_Y 1
+
+/* Thread block dimensions for kernel 2*/
+#define DIM_THREAD_BLOCK_KERNEL_2_X 256
+#define DIM_THREAD_BLOCK_KERNEL_2_Y 1
+
+/* Thread block dimensions for kernel 3*/
+#define DIM_THREAD_BLOCK_KERNEL_3_X 32
+#define DIM_THREAD_BLOCK_KERNEL_3_Y 8
+
+/* Thread block dimensions for kernel 4*/
+#define DIM_THREAD_BLOCK_KERNEL_4_X 256
+#define DIM_THREAD_BLOCK_KERNEL_4_Y 1
+
+
+#endif /* !CORRELATION*/

+ 5 - 0
real-life-dataset/polybench/CPU/datamining/covariance/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := covariance.exe
+CUFILES := covariance.c
+PATH_TO_UTILS := ../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 153 - 0
real-life-dataset/polybench/CPU/datamining/covariance/covariance.c

@@ -0,0 +1,153 @@
+/**
+ * covariance.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/time.h>
+
+#define POLYBENCH_TIME 1
+
+#include "covariance.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 1.05
+
+#define GPU_DEVICE 0
+
+#define sqrt_of_array_cell(x,j) sqrt(x[j])
+
+#define FLOAT_N 3214212.01
+#define EPS 0.005
+
+#define RUN_ON_CPU
+
+
+void init_arrays(int m, int n, DATA_TYPE POLYBENCH_2D(data,M,N,m,n))
+{
+	int i, j;
+
+	for (i = 0; i < m; i++)
+	{
+		for (j = 0; j < n; j++)
+		{
+			data[i][j] = ((DATA_TYPE) i*j) / M;
+		}
+	}
+}
+
+
+void covariance(int m, int n, DATA_TYPE POLYBENCH_2D(data,M,N,m,n), DATA_TYPE POLYBENCH_2D(symmat,M,M,m,m), DATA_TYPE POLYBENCH_1D(mean,M,m))
+{
+	int i, j, j1,j2;
+
+  	/* Determine mean of column vectors of input data matrix */
+	for (j = 0; j < _PB_M; j++)
+	{
+		mean[j] = 0.0;
+		for (i = 0; i < _PB_N; i++)
+		{
+        		mean[j] += data[i][j];
+		}
+		mean[j] /= FLOAT_N;
+	}
+
+  	/* Center the column vectors. */
+	for (i = 0; i < _PB_N; i++)
+	{
+		for (j = 0; j < _PB_M; j++)
+		{
+			data[i][j] -= mean[j];
+		}
+	}
+
+  	/* Calculate the m * m covariance matrix. */
+	for (j1 = 0; j1 < _PB_M; j1++)
+	{
+		for (j2 = j1; j2 < _PB_M; j2++)
+     		{
+       		symmat[j1][j2] = 0.0;
+			for (i = 0; i < _PB_N; i++)
+			{
+				symmat[j1][j2] += data[i][j1] * data[i][j2];
+			}
+        		symmat[j2][j1] = symmat[j1][j2];
+      		}
+	}
+
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int m, DATA_TYPE POLYBENCH_2D(symmat,M,M,m,m))
+{
+  int i, j;
+
+  for (i = 0; i < m; i++)
+    for (j = 0; j < m; j++) {
+      fprintf (stderr, DATA_PRINTF_MODIFIER, symmat[i][j]);
+      if ((i * m + j) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char** argv)
+{
+	int m = M;
+	int n = N;
+
+	POLYBENCH_2D_ARRAY_DECL(data,DATA_TYPE,M,N,m,n);
+	POLYBENCH_2D_ARRAY_DECL(symmat,DATA_TYPE,M,M,m,m);
+	POLYBENCH_1D_ARRAY_DECL(mean,DATA_TYPE,M,m);
+	POLYBENCH_2D_ARRAY_DECL(symmat_outputFromGpu,DATA_TYPE,M,M,m,m);	
+
+	init_arrays(m, n, POLYBENCH_ARRAY(data));
+    
+	//GPU_argv_init();
+
+	//covarianceCuda(m, n, POLYBENCH_ARRAY(data), POLYBENCH_ARRAY(symmat), POLYBENCH_ARRAY(mean), POLYBENCH_ARRAY(symmat_outputFromGpu));
+	
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		covariance(m, n, POLYBENCH_ARRAY(data), POLYBENCH_ARRAY(symmat), POLYBENCH_ARRAY(mean));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+
+		//compareResults(m, n, POLYBENCH_ARRAY(symmat), POLYBENCH_ARRAY(symmat_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(m, POLYBENCH_ARRAY(symmat_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(data);
+	POLYBENCH_FREE_ARRAY(symmat);
+	POLYBENCH_FREE_ARRAY(mean);
+	POLYBENCH_FREE_ARRAY(symmat_outputFromGpu);	
+
+  	return 0;
+}
+
+#include <polybench.c>

+ 153 - 0
real-life-dataset/polybench/CPU/datamining/covariance/covariance.c_backup

@@ -0,0 +1,153 @@
+/**
+ * covariance.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/time.h>
+
+#define POLYBENCH_TIME 1
+
+#include "covariance.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 1.05
+
+#define GPU_DEVICE 0
+
+#define sqrt_of_array_cell(x,j) sqrt(x[j])
+
+#define FLOAT_N 3214212.01
+#define EPS 0.005
+
+#define RUN_ON_CPU
+
+
+void init_arrays(int m, int n, DATA_TYPE POLYBENCH_2D(data,M,N,m,n))
+{
+	int i, j;
+
+	for (i = 0; i < m; i++)
+	{
+		for (j = 0; j < n; j++)
+		{
+			data[i][j] = ((DATA_TYPE) i*j) / M;
+		}
+	}
+}
+
+
+void covariance(int m, int n, DATA_TYPE POLYBENCH_2D(data,M,N,m,n), DATA_TYPE POLYBENCH_2D(symmat,M,M,m,m), DATA_TYPE POLYBENCH_1D(mean,M,m))
+{
+	int i, j, j1,j2;
+
+  	/* Determine mean of column vectors of input data matrix */
+	for (j = 0; j < _PB_M; j++)
+	{
+		mean[j] = 0.0;
+		for (i = 0; i < _PB_N; i++)
+		{
+        		mean[j] += data[i][j];
+		}
+		mean[j] /= FLOAT_N;
+	}
+
+  	/* Center the column vectors. */
+	for (i = 0; i < _PB_N; i++)
+	{
+		for (j = 0; j < _PB_M; j++)
+		{
+			data[i][j] -= mean[j];
+		}
+	}
+
+  	/* Calculate the m * m covariance matrix. */
+	for (j1 = 0; j1 < _PB_M; j1++)
+	{
+		for (j2 = j1; j2 < _PB_M; j2++)
+     		{
+       		symmat[j1][j2] = 0.0;
+			for (i = 0; i < _PB_N; i++)
+			{
+				symmat[j1][j2] += data[i][j1] * data[i][j2];
+			}
+        		symmat[j2][j1] = symmat[j1][j2];
+      		}
+	}
+
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int m, DATA_TYPE POLYBENCH_2D(symmat,M,M,m,m))
+{
+  int i, j;
+
+  for (i = 0; i < m; i++)
+    for (j = 0; j < m; j++) {
+      fprintf (stderr, DATA_PRINTF_MODIFIER, symmat[i][j]);
+      if ((i * m + j) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char** argv)
+{
+	int m = M;
+	int n = N;
+
+	POLYBENCH_2D_ARRAY_DECL(data,DATA_TYPE,M,N,m,n);
+	POLYBENCH_2D_ARRAY_DECL(symmat,DATA_TYPE,M,M,m,m);
+	POLYBENCH_1D_ARRAY_DECL(mean,DATA_TYPE,M,m);
+	POLYBENCH_2D_ARRAY_DECL(symmat_outputFromGpu,DATA_TYPE,M,M,m,m);	
+
+	init_arrays(m, n, POLYBENCH_ARRAY(data));
+    
+	//GPU_argv_init();
+
+	//covarianceCuda(m, n, POLYBENCH_ARRAY(data), POLYBENCH_ARRAY(symmat), POLYBENCH_ARRAY(mean), POLYBENCH_ARRAY(symmat_outputFromGpu));
+	
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		covariance(m, n, POLYBENCH_ARRAY(data), POLYBENCH_ARRAY(symmat), POLYBENCH_ARRAY(mean));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+
+		//compareResults(m, n, POLYBENCH_ARRAY(symmat), POLYBENCH_ARRAY(symmat_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(m, POLYBENCH_ARRAY(symmat_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(data);
+	POLYBENCH_FREE_ARRAY(symmat);
+	POLYBENCH_FREE_ARRAY(mean);
+	POLYBENCH_FREE_ARRAY(symmat_outputFromGpu);	
+
+  	return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/datamining/covariance/covariance.exe


+ 69 - 0
real-life-dataset/polybench/CPU/datamining/covariance/covariance.h

@@ -0,0 +1,69 @@
+/**
+ * covariance.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef COVARIANCE_CUH
+# define COVARIANCE_CUH
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(M) && !defined(N)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+#define M 512
+#define N 512
+#  endif
+
+#  ifdef SMALL_DATASET
+#define M 1024
+#define N 1024
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+#define M 2048
+#define N 2048
+#  endif
+
+#  ifdef LARGE_DATASET
+#define M 4096
+#define N 4096
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+#define M 8192
+#define N 8192
+#  endif
+# endif /* !N */
+
+# define _PB_M POLYBENCH_LOOP_BOUND(M,m)
+# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions for kernel 1*/
+#define DIM_THREAD_BLOCK_KERNEL_1_X 256
+#define DIM_THREAD_BLOCK_KERNEL_1_Y 1
+
+/* Thread block dimensions for kernel 2*/
+#define DIM_THREAD_BLOCK_KERNEL_2_X 32
+#define DIM_THREAD_BLOCK_KERNEL_2_Y 8
+
+/* Thread block dimensions for kernel 3*/
+#define DIM_THREAD_BLOCK_KERNEL_3_X 256
+#define DIM_THREAD_BLOCK_KERNEL_3_Y 1
+
+
+#endif /* !COVARIANCE*/

+ 188 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/2mm/2mm.c

@@ -0,0 +1,188 @@
+#include <time.h>
+/**
+ * 2mm.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/time.h>
+//#include <cuda.h>
+
+#define POLYBENCH_TIME 1
+
+#include "2mm.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void init_array(int ni, int nj, int nk, int nl, DATA_TYPE *alpha, DATA_TYPE *beta, DATA_TYPE POLYBENCH_2D(A, NI, NK, ni, nk), 
+		DATA_TYPE POLYBENCH_2D(B, NK, NJ, nk, nj), DATA_TYPE POLYBENCH_2D(C, NL, NJ, nl, nj), 
+		DATA_TYPE POLYBENCH_2D(D, NI, NL, ni, nl))
+{
+	int i, j;
+
+	*alpha = 32412;
+	*beta = 2123;
+
+	for (i = 0; i < ni; i++)
+	{
+		for (j = 0; j < nk; j++)
+		{
+			A[i][j] = ((DATA_TYPE) i*j) / NI;
+		}
+	}
+
+	for (i = 0; i < nk; i++)
+	{
+		for (j = 0; j < nj; j++)
+		{
+			B[i][j] = ((DATA_TYPE) i*(j+1)) / NJ;
+		}
+	}
+
+	for (i = 0; i < nl; i++)
+	{
+		for (j = 0; j < nj; j++)
+		{
+			C[i][j] = ((DATA_TYPE) i*(j+3)) / NL;
+		}
+	}
+
+	for (i = 0; i < ni; i++)
+	{
+		for (j = 0; j < nl; j++)
+		{
+			D[i][j] = ((DATA_TYPE) i*(j+2)) / NK;	
+		}
+	}
+}
+
+void mm2_cpu(int ni, int nj, int nk, int nl,
+		DATA_TYPE alpha,
+		DATA_TYPE beta,
+		DATA_TYPE POLYBENCH_2D(tmp,NI,NJ,ni,nj),
+		DATA_TYPE POLYBENCH_2D(A,NI,NK,ni,nk),
+		DATA_TYPE POLYBENCH_2D(B,NK,NJ,nk,nj),
+		DATA_TYPE POLYBENCH_2D(C,NL,NJ,nl,nj),
+		DATA_TYPE POLYBENCH_2D(D,NI,NL,ni,nl))
+{
+	int i, j, k;
+	/* D := alpha*A*B*C + beta*D */
+
+	for (i = 0; i < _PB_NI; i++)
+	{
+		for (j = 0; j < _PB_NJ; j++)
+		{
+			tmp[i][j] = 0;
+			for (k = 0; k < _PB_NK; ++k)
+			{
+				tmp[i][j] += alpha * A[i][k] * B[k][j];
+			}
+		}
+	}
+		
+	for (i = 0; i < _PB_NI; i++)
+	{
+		for (j = 0; j < _PB_NL; j++)
+		{
+			D[i][j] *= beta;
+			for (k = 0; k < _PB_NJ; ++k)
+			{
+				D[i][j] += tmp[i][k] * C[k][j];
+			}
+		}
+	}
+	
+}
+
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int ni, int nl,
+		 DATA_TYPE POLYBENCH_2D(D,NI,NL,ni,nl))
+{
+  int i, j;
+
+  for (i = 0; i < ni; i++)
+    for (j = 0; j < nl; j++) {
+	fprintf (stderr, DATA_PRINTF_MODIFIER, D[i][j]);
+	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+
+
+
+
+int main(int argc, char** argv)
+{
+	/* Retrieve problem size. */
+	int ni = NI;
+	int nj = NJ;
+	int nk = NK;
+	int nl = NL;
+
+	/* Variable declaration/allocation. */
+	DATA_TYPE alpha;
+	DATA_TYPE beta;
+	POLYBENCH_2D_ARRAY_DECL(tmp,DATA_TYPE,NI,NJ,ni,nj);
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NI,NK,ni,nk);
+	POLYBENCH_2D_ARRAY_DECL(B,DATA_TYPE,NK,NJ,nk,nj);
+	POLYBENCH_2D_ARRAY_DECL(C,DATA_TYPE,NL,NJ,nl,nj);
+	POLYBENCH_2D_ARRAY_DECL(D,DATA_TYPE,NI,NL,ni,nl);
+	POLYBENCH_2D_ARRAY_DECL(D_outputFromGpu,DATA_TYPE,NI,NL,ni,nl);
+	
+	/* Initialize array(s). */
+  	init_array(ni, nj, nk, nl, &alpha, &beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(D));
+	//GPU_argv_init();
+
+	//mm2Cuda(ni, nj, nk, nl, alpha, beta, POLYBENCH_ARRAY(tmp), POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C), 
+	//	POLYBENCH_ARRAY(D), POLYBENCH_ARRAY(D_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		mm2_cpu(ni, nj, nk, nl, alpha, beta, POLYBENCH_ARRAY(tmp), POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(D));
+
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+
+		//compareResults(ni, nl, POLYBENCH_ARRAY(D), POLYBENCH_ARRAY(D_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(ni, nl, POLYBENCH_ARRAY(D_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+	POLYBENCH_FREE_ARRAY(tmp);
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(B);
+	POLYBENCH_FREE_ARRAY(C);
+	POLYBENCH_FREE_ARRAY(D);
+	POLYBENCH_FREE_ARRAY(D_outputFromGpu);
+
+  	return 0;
+}
+
+#include <polybench.c>

+ 188 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/2mm/2mm.c_backup

@@ -0,0 +1,188 @@
+#include <time.h>
+/**
+ * 2mm.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/time.h>
+//#include <cuda.h>
+
+#define POLYBENCH_TIME 1
+
+#include "2mm.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void init_array(int ni, int nj, int nk, int nl, DATA_TYPE *alpha, DATA_TYPE *beta, DATA_TYPE POLYBENCH_2D(A, NI, NK, ni, nk), 
+		DATA_TYPE POLYBENCH_2D(B, NK, NJ, nk, nj), DATA_TYPE POLYBENCH_2D(C, NL, NJ, nl, nj), 
+		DATA_TYPE POLYBENCH_2D(D, NI, NL, ni, nl))
+{
+	int i, j;
+
+	*alpha = 32412;
+	*beta = 2123;
+
+	for (i = 0; i < ni; i++)
+	{
+		for (j = 0; j < nk; j++)
+		{
+			A[i][j] = ((DATA_TYPE) i*j) / NI;
+		}
+	}
+
+	for (i = 0; i < nk; i++)
+	{
+		for (j = 0; j < nj; j++)
+		{
+			B[i][j] = ((DATA_TYPE) i*(j+1)) / NJ;
+		}
+	}
+
+	for (i = 0; i < nl; i++)
+	{
+		for (j = 0; j < nj; j++)
+		{
+			C[i][j] = ((DATA_TYPE) i*(j+3)) / NL;
+		}
+	}
+
+	for (i = 0; i < ni; i++)
+	{
+		for (j = 0; j < nl; j++)
+		{
+			D[i][j] = ((DATA_TYPE) i*(j+2)) / NK;	
+		}
+	}
+}
+
+void mm2_cpu(int ni, int nj, int nk, int nl,
+		DATA_TYPE alpha,
+		DATA_TYPE beta,
+		DATA_TYPE POLYBENCH_2D(tmp,NI,NJ,ni,nj),
+		DATA_TYPE POLYBENCH_2D(A,NI,NK,ni,nk),
+		DATA_TYPE POLYBENCH_2D(B,NK,NJ,nk,nj),
+		DATA_TYPE POLYBENCH_2D(C,NL,NJ,nl,nj),
+		DATA_TYPE POLYBENCH_2D(D,NI,NL,ni,nl))
+{
+	int i, j, k;
+	/* D := alpha*A*B*C + beta*D */
+
+	for (i = 0; i < _PB_NI; i++)
+	{
+		for (j = 0; j < _PB_NJ; j++)
+		{
+			tmp[i][j] = 0;
+			for (k = 0; k < _PB_NK; ++k)
+			{
+				tmp[i][j] += alpha * A[i][k] * B[k][j];
+			}
+		}
+	}
+		
+	for (i = 0; i < _PB_NI; i++)
+	{
+		for (j = 0; j < _PB_NL; j++)
+		{
+			D[i][j] *= beta;
+			for (k = 0; k < _PB_NJ; ++k)
+			{
+				D[i][j] += tmp[i][k] * C[k][j];
+			}
+		}
+	}
+	
+}
+
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int ni, int nl,
+		 DATA_TYPE POLYBENCH_2D(D,NI,NL,ni,nl))
+{
+  int i, j;
+
+  for (i = 0; i < ni; i++)
+    for (j = 0; j < nl; j++) {
+	fprintf (stderr, DATA_PRINTF_MODIFIER, D[i][j]);
+	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+
+
+
+
+int main(int argc, char** argv)
+{
+	/* Retrieve problem size. */
+	int ni = NI;
+	int nj = NJ;
+	int nk = NK;
+	int nl = NL;
+
+	/* Variable declaration/allocation. */
+	DATA_TYPE alpha;
+	DATA_TYPE beta;
+	POLYBENCH_2D_ARRAY_DECL(tmp,DATA_TYPE,NI,NJ,ni,nj);
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NI,NK,ni,nk);
+	POLYBENCH_2D_ARRAY_DECL(B,DATA_TYPE,NK,NJ,nk,nj);
+	POLYBENCH_2D_ARRAY_DECL(C,DATA_TYPE,NL,NJ,nl,nj);
+	POLYBENCH_2D_ARRAY_DECL(D,DATA_TYPE,NI,NL,ni,nl);
+	POLYBENCH_2D_ARRAY_DECL(D_outputFromGpu,DATA_TYPE,NI,NL,ni,nl);
+	
+	/* Initialize array(s). */
+  	init_array(ni, nj, nk, nl, &alpha, &beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(D));
+	//GPU_argv_init();
+
+	//mm2Cuda(ni, nj, nk, nl, alpha, beta, POLYBENCH_ARRAY(tmp), POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C), 
+	//	POLYBENCH_ARRAY(D), POLYBENCH_ARRAY(D_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		mm2_cpu(ni, nj, nk, nl, alpha, beta, POLYBENCH_ARRAY(tmp), POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(D));
+
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+
+		//compareResults(ni, nl, POLYBENCH_ARRAY(D), POLYBENCH_ARRAY(D_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(ni, nl, POLYBENCH_ARRAY(D_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+	POLYBENCH_FREE_ARRAY(tmp);
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(B);
+	POLYBENCH_FREE_ARRAY(C);
+	POLYBENCH_FREE_ARRAY(D);
+	POLYBENCH_FREE_ARRAY(D_outputFromGpu);
+
+  	return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/linear-algebra/kernels/2mm/2mm.exe


+ 73 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/2mm/2mm.h

@@ -0,0 +1,73 @@
+/**
+ * 2mm.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef TWOMM_H
+# define TWOMM_H
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(NI) && !defined(NJ) && !defined(NK) && !defined(NL)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+# define NI 256
+# define NJ 256
+# define NK 256
+# define NL 256
+#  endif
+
+#  ifdef SMALL_DATASET
+# define NI 512
+# define NJ 512
+# define NK 512
+# define NL 512
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+# define NI 1024
+# define NJ 1024
+# define NK 1024
+# define NL 1024
+#  endif
+
+#  ifdef LARGE_DATASET
+# define NI 2048
+# define NJ 2048
+# define NK 2048
+# define NL 2048
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+# define NI 4096
+# define NJ 4096
+# define NK 4096
+# define NL 4096
+#  endif
+# endif /* !N */
+
+# define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni)
+# define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj)
+# define _PB_NK POLYBENCH_LOOP_BOUND(NK,nk)
+# define _PB_NL POLYBENCH_LOOP_BOUND(NL,nl)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions */
+#define DIM_THREAD_BLOCK_X 32
+#define DIM_THREAD_BLOCK_Y 8
+
+
+#endif /* !TWOMM*/

+ 5 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/2mm/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := 2mm.exe
+CUFILES := 2mm.c
+PATH_TO_UTILS := ../../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 203 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/3mm/3mm.c

@@ -0,0 +1,203 @@
+/**
+ * 3mm.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/time.h>
+
+#define POLYBENCH_TIME 1
+
+#include "3mm.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+#define GPU_DEVICE 0
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define RUN_ON_CPU
+
+
+void init_array(int ni, int nj, int nk, int nl, int nm, DATA_TYPE POLYBENCH_2D(A, NI, NK, ni, nk), DATA_TYPE POLYBENCH_2D(B, NK, NJ, nk, nj), 
+		DATA_TYPE POLYBENCH_2D(C, NJ, NM, nj, nm), DATA_TYPE POLYBENCH_2D(D, NM, NL, nm, nl))
+{
+	int i, j;
+
+	for (i = 0; i < ni; i++)
+	{
+		for (j = 0; j < nk; j++)
+		{
+			A[i][j] = ((DATA_TYPE) i*j) / ni;
+		}
+	}
+  
+	for (i = 0; i < nk; i++)
+	{
+		for (j = 0; j < nj; j++)
+		{
+			B[i][j] = ((DATA_TYPE) i*(j+1)) / nj;
+		}
+	}
+  
+	for (i = 0; i < nj; i++)
+	{
+		for (j = 0; j < nm; j++)
+		{
+			C[i][j] = ((DATA_TYPE) i*(j+3)) / nl;
+		}
+	}
+  
+	for (i = 0; i < nm; i++)
+	{
+		for (j = 0; j < nl; j++)
+		{
+			D[i][j] = ((DATA_TYPE) i*(j+2)) / nk;
+		}
+	}
+}
+
+/* Main computational kernel on CPU */
+void mm3_cpu(int ni, int nj, int nk, int nl, int nm,
+		DATA_TYPE POLYBENCH_2D(E,NI,NJ,ni,nj),
+		DATA_TYPE POLYBENCH_2D(A,NI,NK,ni,nk),
+		DATA_TYPE POLYBENCH_2D(B,NK,NJ,nk,nj),
+		DATA_TYPE POLYBENCH_2D(F,NJ,NL,nj,nl),
+		DATA_TYPE POLYBENCH_2D(C,NJ,NM,nj,nm),
+		DATA_TYPE POLYBENCH_2D(D,NM,NL,nm,nl),
+		DATA_TYPE POLYBENCH_2D(G,NI,NL,ni,nl))
+{
+	int i, j, k;
+
+	/* E := A*B */
+
+
+	for (i = 0; i < _PB_NI; i++)
+	{
+		for (j = 0; j < _PB_NJ; j++)
+		{
+			E[i][j] = 0;
+			for (k = 0; k < _PB_NK; ++k)
+			{
+				E[i][j] += A[i][k] * B[k][j];
+			}
+		}
+	}
+
+
+	/* F := C*D */
+	for (i = 0; i < _PB_NJ; i++)
+	{
+		for (j = 0; j < _PB_NL; j++)
+		{
+			F[i][j] = 0;
+			for (k = 0; k < _PB_NM; ++k)
+			{
+				F[i][j] += C[i][k] * D[k][j];
+			}
+		}
+	}
+
+	
+	/* G := E*F */
+	for (i = 0; i < _PB_NI; i++)
+	{
+		for (j = 0; j < _PB_NL; j++)
+		{
+			G[i][j] = 0;
+			for (k = 0; k < _PB_NJ; ++k)
+			{
+				G[i][j] += E[i][k] * F[k][j];
+			}
+		}
+	}
+	
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int ni, int nl,
+		 DATA_TYPE POLYBENCH_2D(G,NI,NL,ni,nl))
+{
+  int i, j;
+
+  for (i = 0; i < ni; i++)
+    for (j = 0; j < nl; j++) {
+	fprintf (stderr, DATA_PRINTF_MODIFIER, G[i][j]);
+	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char** argv)
+{
+	int ni = NI;
+	int nj = NJ;
+	int nk = NK;
+	int nl = NL;
+	int nm = NM;
+
+	/* Variable declaration/allocation. */
+	POLYBENCH_2D_ARRAY_DECL(E, DATA_TYPE, NI, NJ, ni, nj);
+	POLYBENCH_2D_ARRAY_DECL(A, DATA_TYPE, NI, NK, ni, nk);
+	POLYBENCH_2D_ARRAY_DECL(B, DATA_TYPE, NK, NJ, nk, nj);
+	POLYBENCH_2D_ARRAY_DECL(F, DATA_TYPE, NJ, NL, nj, nl);
+	POLYBENCH_2D_ARRAY_DECL(C, DATA_TYPE, NJ, NM, nj, nm);
+	POLYBENCH_2D_ARRAY_DECL(D, DATA_TYPE, NM, NL, nm, nl);
+	POLYBENCH_2D_ARRAY_DECL(G, DATA_TYPE, NI, NL, ni, nl);
+	POLYBENCH_2D_ARRAY_DECL(G_outputFromGpu, DATA_TYPE, NI, NL, ni, nl);
+
+	init_array(ni, nj, nk, nl, nm, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(D));
+
+	//GPU_argv_init();
+
+	//mm3Cuda(ni, nj, nk, nl, nm, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(D), POLYBENCH_ARRAY(E), 
+	//	POLYBENCH_ARRAY(F), POLYBENCH_ARRAY(G), POLYBENCH_ARRAY(G_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		mm3_cpu(ni, nj, nk, nl, nm, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(D), POLYBENCH_ARRAY(E), 
+			POLYBENCH_ARRAY(F), POLYBENCH_ARRAY(G));
+	
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+
+		//compareResults(ni, nl, POLYBENCH_ARRAY(G), POLYBENCH_ARRAY(G_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(ni, nl, POLYBENCH_ARRAY(G_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(B);
+	POLYBENCH_FREE_ARRAY(C);
+	POLYBENCH_FREE_ARRAY(D);
+	POLYBENCH_FREE_ARRAY(E);
+	POLYBENCH_FREE_ARRAY(F);
+	POLYBENCH_FREE_ARRAY(G);
+	POLYBENCH_FREE_ARRAY(G_outputFromGpu);
+
+	return 0;
+}
+
+#include <polybench.c>

+ 203 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/3mm/3mm.c_backup

@@ -0,0 +1,203 @@
+/**
+ * 3mm.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/time.h>
+
+#define POLYBENCH_TIME 1
+
+#include "3mm.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+#define GPU_DEVICE 0
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define RUN_ON_CPU
+
+
+void init_array(int ni, int nj, int nk, int nl, int nm, DATA_TYPE POLYBENCH_2D(A, NI, NK, ni, nk), DATA_TYPE POLYBENCH_2D(B, NK, NJ, nk, nj), 
+		DATA_TYPE POLYBENCH_2D(C, NJ, NM, nj, nm), DATA_TYPE POLYBENCH_2D(D, NM, NL, nm, nl))
+{
+	int i, j;
+
+	for (i = 0; i < ni; i++)
+	{
+		for (j = 0; j < nk; j++)
+		{
+			A[i][j] = ((DATA_TYPE) i*j) / ni;
+		}
+	}
+  
+	for (i = 0; i < nk; i++)
+	{
+		for (j = 0; j < nj; j++)
+		{
+			B[i][j] = ((DATA_TYPE) i*(j+1)) / nj;
+		}
+	}
+  
+	for (i = 0; i < nj; i++)
+	{
+		for (j = 0; j < nm; j++)
+		{
+			C[i][j] = ((DATA_TYPE) i*(j+3)) / nl;
+		}
+	}
+  
+	for (i = 0; i < nm; i++)
+	{
+		for (j = 0; j < nl; j++)
+		{
+			D[i][j] = ((DATA_TYPE) i*(j+2)) / nk;
+		}
+	}
+}
+
+/* Main computational kernel on CPU */
+void mm3_cpu(int ni, int nj, int nk, int nl, int nm,
+		DATA_TYPE POLYBENCH_2D(E,NI,NJ,ni,nj),
+		DATA_TYPE POLYBENCH_2D(A,NI,NK,ni,nk),
+		DATA_TYPE POLYBENCH_2D(B,NK,NJ,nk,nj),
+		DATA_TYPE POLYBENCH_2D(F,NJ,NL,nj,nl),
+		DATA_TYPE POLYBENCH_2D(C,NJ,NM,nj,nm),
+		DATA_TYPE POLYBENCH_2D(D,NM,NL,nm,nl),
+		DATA_TYPE POLYBENCH_2D(G,NI,NL,ni,nl))
+{
+	int i, j, k;
+
+	/* E := A*B */
+
+
+	for (i = 0; i < _PB_NI; i++)
+	{
+		for (j = 0; j < _PB_NJ; j++)
+		{
+			E[i][j] = 0;
+			for (k = 0; k < _PB_NK; ++k)
+			{
+				E[i][j] += A[i][k] * B[k][j];
+			}
+		}
+	}
+
+
+	/* F := C*D */
+	for (i = 0; i < _PB_NJ; i++)
+	{
+		for (j = 0; j < _PB_NL; j++)
+		{
+			F[i][j] = 0;
+			for (k = 0; k < _PB_NM; ++k)
+			{
+				F[i][j] += C[i][k] * D[k][j];
+			}
+		}
+	}
+
+	
+	/* G := E*F */
+	for (i = 0; i < _PB_NI; i++)
+	{
+		for (j = 0; j < _PB_NL; j++)
+		{
+			G[i][j] = 0;
+			for (k = 0; k < _PB_NJ; ++k)
+			{
+				G[i][j] += E[i][k] * F[k][j];
+			}
+		}
+	}
+	
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int ni, int nl,
+		 DATA_TYPE POLYBENCH_2D(G,NI,NL,ni,nl))
+{
+  int i, j;
+
+  for (i = 0; i < ni; i++)
+    for (j = 0; j < nl; j++) {
+	fprintf (stderr, DATA_PRINTF_MODIFIER, G[i][j]);
+	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char** argv)
+{
+	int ni = NI;
+	int nj = NJ;
+	int nk = NK;
+	int nl = NL;
+	int nm = NM;
+
+	/* Variable declaration/allocation. */
+	POLYBENCH_2D_ARRAY_DECL(E, DATA_TYPE, NI, NJ, ni, nj);
+	POLYBENCH_2D_ARRAY_DECL(A, DATA_TYPE, NI, NK, ni, nk);
+	POLYBENCH_2D_ARRAY_DECL(B, DATA_TYPE, NK, NJ, nk, nj);
+	POLYBENCH_2D_ARRAY_DECL(F, DATA_TYPE, NJ, NL, nj, nl);
+	POLYBENCH_2D_ARRAY_DECL(C, DATA_TYPE, NJ, NM, nj, nm);
+	POLYBENCH_2D_ARRAY_DECL(D, DATA_TYPE, NM, NL, nm, nl);
+	POLYBENCH_2D_ARRAY_DECL(G, DATA_TYPE, NI, NL, ni, nl);
+	POLYBENCH_2D_ARRAY_DECL(G_outputFromGpu, DATA_TYPE, NI, NL, ni, nl);
+
+	init_array(ni, nj, nk, nl, nm, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(D));
+
+	//GPU_argv_init();
+
+	//mm3Cuda(ni, nj, nk, nl, nm, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(D), POLYBENCH_ARRAY(E), 
+	//	POLYBENCH_ARRAY(F), POLYBENCH_ARRAY(G), POLYBENCH_ARRAY(G_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		mm3_cpu(ni, nj, nk, nl, nm, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(D), POLYBENCH_ARRAY(E), 
+			POLYBENCH_ARRAY(F), POLYBENCH_ARRAY(G));
+	
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+
+		//compareResults(ni, nl, POLYBENCH_ARRAY(G), POLYBENCH_ARRAY(G_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(ni, nl, POLYBENCH_ARRAY(G_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(B);
+	POLYBENCH_FREE_ARRAY(C);
+	POLYBENCH_FREE_ARRAY(D);
+	POLYBENCH_FREE_ARRAY(E);
+	POLYBENCH_FREE_ARRAY(F);
+	POLYBENCH_FREE_ARRAY(G);
+	POLYBENCH_FREE_ARRAY(G_outputFromGpu);
+
+	return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/linear-algebra/kernels/3mm/3mm.exe


+ 79 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/3mm/3mm.h

@@ -0,0 +1,79 @@
+/**
+ * 3mm.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef THREEMM_H
+# define THREEMM_H
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(NI) && !defined(NJ) && !defined(NK) && !defined(NL) && !defined(NM)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+# define NI 128
+# define NJ 128
+# define NK 128
+# define NL 128
+# define NM 128
+#  endif
+
+#  ifdef SMALL_DATASET
+# define NI 256
+# define NJ 256
+# define NK 256
+# define NL 256
+# define NM 256
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+# define NI 512
+# define NJ 512
+# define NK 512
+# define NL 512
+# define NM 512
+#  endif
+
+#  ifdef LARGE_DATASET
+# define NI 1024
+# define NJ 1024
+# define NK 1024
+# define NL 1024
+# define NM 1024
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+# define NI 2048
+# define NJ 2048
+# define NK 2048
+# define NL 2048
+# define NM 2048
+#  endif
+# endif /* !N */
+
+# define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni)
+# define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj)
+# define _PB_NK POLYBENCH_LOOP_BOUND(NK,nk)
+# define _PB_NL POLYBENCH_LOOP_BOUND(NL,nl)
+# define _PB_NM POLYBENCH_LOOP_BOUND(NM,nm)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions */
+#define DIM_THREAD_BLOCK_X 32
+#define DIM_THREAD_BLOCK_Y 8
+
+
+#endif /* !THREEMM*/

+ 5 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/3mm/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := 3mm.exe
+CUFILES := 3mm.c
+PATH_TO_UTILS := ../../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 5 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/atax/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := atax.exe
+CUFILES := atax.c
+PATH_TO_UTILS := ../../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 139 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/atax/atax.c

@@ -0,0 +1,139 @@
+/**
+ * atax.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/time.h>
+
+#define POLYBENCH_TIME 1
+
+#include "atax.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.5
+
+#define GPU_DEVICE 0
+
+
+#ifndef M_PI
+#define M_PI 3.14159
+#endif
+
+#define RUN_ON_CPU
+
+
+void init_array(int nx, int ny, DATA_TYPE POLYBENCH_1D(x,NX,nx), DATA_TYPE POLYBENCH_2D(A,NX,NY,nx,ny))
+{
+	int i, j;
+
+	for (i = 0; i < nx; i++)
+	{
+		x[i] = i * M_PI;
+		for (j = 0; j < ny; j++)
+		{
+			A[i][j] = ((DATA_TYPE) i*j) / NX;
+		}
+	}
+}
+
+void atax_cpu(int nx, int ny, DATA_TYPE POLYBENCH_2D(A,NX,NY,nx,ny), DATA_TYPE POLYBENCH_1D(x,NY,ny), DATA_TYPE POLYBENCH_1D(y,NY,ny), 
+		DATA_TYPE POLYBENCH_1D(tmp,NX,nx))
+{
+	int i,j;
+	
+
+	for (i= 0; i < _PB_NY; i++)
+	{
+    		y[i] = 0;
+	}
+  
+	for (i = 0; i < _PB_NX; i++)
+ 	{
+      		tmp[i] = 0;
+      		for (j = 0; j < _PB_NY; j++)
+		{
+			tmp[i] = tmp[i] + A[i][j] * x[j];
+		}	
+      		for (j = 0; j < _PB_NY; j++)
+		{
+			y[j] = y[j] + A[i][j] * tmp[i];
+		}
+    }
+
+
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int nx, DATA_TYPE POLYBENCH_1D(y,NX,nx))
+{
+  int i;
+
+  for (i = 0; i < nx; i++) {
+    fprintf (stderr, DATA_PRINTF_MODIFIER, y[i]);
+    if (i % 20 == 0) fprintf (stderr, "\n");
+  }
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char** argv)
+{
+	int nx = NX;
+	int ny = NY;
+
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NX,NY,nx,ny);
+	POLYBENCH_1D_ARRAY_DECL(x,DATA_TYPE,NY,ny);
+	POLYBENCH_1D_ARRAY_DECL(y,DATA_TYPE,NY,ny);
+	POLYBENCH_1D_ARRAY_DECL(y_outputFromGpu,DATA_TYPE,NY,ny);
+	POLYBENCH_1D_ARRAY_DECL(tmp,DATA_TYPE,NX,nx);
+
+	init_array(nx, ny, POLYBENCH_ARRAY(x), POLYBENCH_ARRAY(A));
+
+	//GPU_argv_init();
+	//ataxGpu(nx, ny, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(x), POLYBENCH_ARRAY(y), POLYBENCH_ARRAY(tmp), 
+	//	POLYBENCH_ARRAY(y_outputFromGpu));
+	
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		atax_cpu(nx, ny, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(x), POLYBENCH_ARRAY(y), POLYBENCH_ARRAY(tmp));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+
+		//compareResults(ny, POLYBENCH_ARRAY(y), POLYBENCH_ARRAY(y_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(ny, POLYBENCH_ARRAY(y_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(x);
+	POLYBENCH_FREE_ARRAY(y);
+	POLYBENCH_FREE_ARRAY(y_outputFromGpu);
+	POLYBENCH_FREE_ARRAY(tmp);
+
+  	return 0;
+}
+
+#include <polybench.c>

+ 139 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/atax/atax.c_backup

@@ -0,0 +1,139 @@
+/**
+ * atax.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/time.h>
+
+#define POLYBENCH_TIME 1
+
+#include "atax.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.5
+
+#define GPU_DEVICE 0
+
+
+#ifndef M_PI
+#define M_PI 3.14159
+#endif
+
+#define RUN_ON_CPU
+
+
+void init_array(int nx, int ny, DATA_TYPE POLYBENCH_1D(x,NX,nx), DATA_TYPE POLYBENCH_2D(A,NX,NY,nx,ny))
+{
+	int i, j;
+
+	for (i = 0; i < nx; i++)
+	{
+		x[i] = i * M_PI;
+		for (j = 0; j < ny; j++)
+		{
+			A[i][j] = ((DATA_TYPE) i*j) / NX;
+		}
+	}
+}
+
+void atax_cpu(int nx, int ny, DATA_TYPE POLYBENCH_2D(A,NX,NY,nx,ny), DATA_TYPE POLYBENCH_1D(x,NY,ny), DATA_TYPE POLYBENCH_1D(y,NY,ny), 
+		DATA_TYPE POLYBENCH_1D(tmp,NX,nx))
+{
+	int i,j;
+	
+
+	for (i= 0; i < _PB_NY; i++)
+	{
+    		y[i] = 0;
+	}
+  
+	for (i = 0; i < _PB_NX; i++)
+ 	{
+      		tmp[i] = 0;
+      		for (j = 0; j < _PB_NY; j++)
+		{
+			tmp[i] = tmp[i] + A[i][j] * x[j];
+		}	
+      		for (j = 0; j < _PB_NY; j++)
+		{
+			y[j] = y[j] + A[i][j] * tmp[i];
+		}
+    }
+
+
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int nx, DATA_TYPE POLYBENCH_1D(y,NX,nx))
+{
+  int i;
+
+  for (i = 0; i < nx; i++) {
+    fprintf (stderr, DATA_PRINTF_MODIFIER, y[i]);
+    if (i % 20 == 0) fprintf (stderr, "\n");
+  }
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char** argv)
+{
+	int nx = NX;
+	int ny = NY;
+
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NX,NY,nx,ny);
+	POLYBENCH_1D_ARRAY_DECL(x,DATA_TYPE,NY,ny);
+	POLYBENCH_1D_ARRAY_DECL(y,DATA_TYPE,NY,ny);
+	POLYBENCH_1D_ARRAY_DECL(y_outputFromGpu,DATA_TYPE,NY,ny);
+	POLYBENCH_1D_ARRAY_DECL(tmp,DATA_TYPE,NX,nx);
+
+	init_array(nx, ny, POLYBENCH_ARRAY(x), POLYBENCH_ARRAY(A));
+
+	//GPU_argv_init();
+	//ataxGpu(nx, ny, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(x), POLYBENCH_ARRAY(y), POLYBENCH_ARRAY(tmp), 
+	//	POLYBENCH_ARRAY(y_outputFromGpu));
+	
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		atax_cpu(nx, ny, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(x), POLYBENCH_ARRAY(y), POLYBENCH_ARRAY(tmp));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+
+		//compareResults(ny, POLYBENCH_ARRAY(y), POLYBENCH_ARRAY(y_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(ny, POLYBENCH_ARRAY(y_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(x);
+	POLYBENCH_FREE_ARRAY(y);
+	POLYBENCH_FREE_ARRAY(y_outputFromGpu);
+	POLYBENCH_FREE_ARRAY(tmp);
+
+  	return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/linear-algebra/kernels/atax/atax.exe


+ 61 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/atax/atax.h

@@ -0,0 +1,61 @@
+/**
+ * atax.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef ATAX_CUH
+# define ATAX_CUH
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(NX) && !defined(NY)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+#define NX 1024
+#define NY 1024
+#  endif
+
+#  ifdef SMALL_DATASET
+#define NX 2048
+#define NY 2048
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+#define NX 4096
+#define NY 4096
+#  endif
+
+#  ifdef LARGE_DATASET
+#define NX 8192
+#define NY 8192
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+#define NX 16384
+#define NY 16384
+#  endif
+# endif /* !N */
+
+# define _PB_NX POLYBENCH_LOOP_BOUND(NX,nx)
+# define _PB_NY POLYBENCH_LOOP_BOUND(NY,ny)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions */
+#define DIM_THREAD_BLOCK_X 32
+#define DIM_THREAD_BLOCK_Y 8
+
+
+#endif /* !ATAX*/

+ 5 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/bicg/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := bicg.exe
+CUFILES := bicg.c
+PATH_TO_UTILS := ../../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 154 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/bicg/bicg.c

@@ -0,0 +1,154 @@
+/**
+ * bicg.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <sys/time.h>
+
+#define POLYBENCH_TIME 1
+
+#include "bicg.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//Error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.5
+
+#define GPU_DEVICE 0
+
+#ifndef M_PI
+#define M_PI 3.14159
+#endif
+
+#define RUN_ON_CPU
+
+
+void init_array(int nx, int ny, DATA_TYPE POLYBENCH_2D(A,NX,NY,nx,ny), DATA_TYPE POLYBENCH_1D(p,NY,ny), DATA_TYPE POLYBENCH_1D(r,NX,nx))
+{
+	int i, j;
+	
+	for (i = 0; i < ny; i++)
+	{
+    		p[i] = i * M_PI;
+	}
+
+	for (i = 0; i < nx; i++)
+	{
+    		r[i] = i * M_PI;
+
+    		for (j = 0; j < ny; j++)
+		{
+      			A[i][j] = ((DATA_TYPE) i*j) / NX;
+		}
+ 	}
+}
+
+void bicg_cpu(int nx, int ny, DATA_TYPE POLYBENCH_2D(A,NX,NY,nx,ny), DATA_TYPE POLYBENCH_1D(r,NX,nx), DATA_TYPE POLYBENCH_1D(s,NY,ny), 
+		DATA_TYPE POLYBENCH_1D(p,NY,ny), DATA_TYPE POLYBENCH_1D(q,NX,nx))
+{
+	int i,j;
+
+	
+  	for (i = 0; i < _PB_NY; i++)
+	{
+		s[i] = 0.0;
+	}
+
+	for (i = 0; i < _PB_NX; i++)
+	{
+		q[i] = 0.0;
+		for (j = 0; j < _PB_NY; j++)
+	  	{
+	    		s[j] = s[j] + r[i] * A[i][j];
+	    		q[i] = q[i] + A[i][j] * p[j];
+	  	}
+	}
+
+
+}
+
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int nx, int ny,
+		 DATA_TYPE POLYBENCH_1D(s,NY,ny),
+		 DATA_TYPE POLYBENCH_1D(q,NX,nx))
+
+{
+  int i;
+
+  for (i = 0; i < ny; i++) {
+    fprintf (stderr, DATA_PRINTF_MODIFIER, s[i]);
+    if (i % 20 == 0) fprintf (stderr, "\n");
+  }
+  for (i = 0; i < nx; i++) {
+    fprintf (stderr, DATA_PRINTF_MODIFIER, q[i]);
+    if (i % 20 == 0) fprintf (stderr, "\n");
+  }
+  fprintf (stderr, "\n");
+}
+
+int main(int argc, char** argv)
+{
+	int nx = NX;
+	int ny = NY;
+
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NX,NY,nx,ny);
+	POLYBENCH_1D_ARRAY_DECL(s,DATA_TYPE,NY,ny);
+	POLYBENCH_1D_ARRAY_DECL(q,DATA_TYPE,NX,nx);
+	POLYBENCH_1D_ARRAY_DECL(p,DATA_TYPE,NY,ny);
+	POLYBENCH_1D_ARRAY_DECL(r,DATA_TYPE,NX,nx);
+	POLYBENCH_1D_ARRAY_DECL(s_outputFromGpu,DATA_TYPE,NY,ny);
+	POLYBENCH_1D_ARRAY_DECL(q_outputFromGpu,DATA_TYPE,NX,nx);
+
+	init_array(nx, ny, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(p), POLYBENCH_ARRAY(r));
+
+	//GPU_argv_init();
+
+	//bicgCuda(nx, ny, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(r), POLYBENCH_ARRAY(s), POLYBENCH_ARRAY(p), POLYBENCH_ARRAY(q), 
+	//	POLYBENCH_ARRAY(s_outputFromGpu), POLYBENCH_ARRAY(q_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		bicg_cpu(nx, ny, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(r), POLYBENCH_ARRAY(s), POLYBENCH_ARRAY(p), POLYBENCH_ARRAY(q));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		//compareResults(nx, ny, POLYBENCH_ARRAY(s), POLYBENCH_ARRAY(s_outputFromGpu), POLYBENCH_ARRAY(q), 
+		//	POLYBENCH_ARRAY(q_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(nx, ny, POLYBENCH_ARRAY(s_outputFromGpu), POLYBENCH_ARRAY(q_outputFromGpu)));
+	
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(r);
+	POLYBENCH_FREE_ARRAY(s);
+	POLYBENCH_FREE_ARRAY(p);
+	POLYBENCH_FREE_ARRAY(q);
+	POLYBENCH_FREE_ARRAY(s_outputFromGpu);
+	POLYBENCH_FREE_ARRAY(q_outputFromGpu);
+
+  	return 0;
+}
+
+#include <polybench.c>

+ 154 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/bicg/bicg.c_backup

@@ -0,0 +1,154 @@
+/**
+ * bicg.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <sys/time.h>
+
+#define POLYBENCH_TIME 1
+
+#include "bicg.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//Error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.5
+
+#define GPU_DEVICE 0
+
+#ifndef M_PI
+#define M_PI 3.14159
+#endif
+
+#define RUN_ON_CPU
+
+
+void init_array(int nx, int ny, DATA_TYPE POLYBENCH_2D(A,NX,NY,nx,ny), DATA_TYPE POLYBENCH_1D(p,NY,ny), DATA_TYPE POLYBENCH_1D(r,NX,nx))
+{
+	int i, j;
+	
+	for (i = 0; i < ny; i++)
+	{
+    		p[i] = i * M_PI;
+	}
+
+	for (i = 0; i < nx; i++)
+	{
+    		r[i] = i * M_PI;
+
+    		for (j = 0; j < ny; j++)
+		{
+      			A[i][j] = ((DATA_TYPE) i*j) / NX;
+		}
+ 	}
+}
+
+void bicg_cpu(int nx, int ny, DATA_TYPE POLYBENCH_2D(A,NX,NY,nx,ny), DATA_TYPE POLYBENCH_1D(r,NX,nx), DATA_TYPE POLYBENCH_1D(s,NY,ny), 
+		DATA_TYPE POLYBENCH_1D(p,NY,ny), DATA_TYPE POLYBENCH_1D(q,NX,nx))
+{
+	int i,j;
+
+	
+  	for (i = 0; i < _PB_NY; i++)
+	{
+		s[i] = 0.0;
+	}
+
+	for (i = 0; i < _PB_NX; i++)
+	{
+		q[i] = 0.0;
+		for (j = 0; j < _PB_NY; j++)
+	  	{
+	    		s[j] = s[j] + r[i] * A[i][j];
+	    		q[i] = q[i] + A[i][j] * p[j];
+	  	}
+	}
+
+
+}
+
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int nx, int ny,
+		 DATA_TYPE POLYBENCH_1D(s,NY,ny),
+		 DATA_TYPE POLYBENCH_1D(q,NX,nx))
+
+{
+  int i;
+
+  for (i = 0; i < ny; i++) {
+    fprintf (stderr, DATA_PRINTF_MODIFIER, s[i]);
+    if (i % 20 == 0) fprintf (stderr, "\n");
+  }
+  for (i = 0; i < nx; i++) {
+    fprintf (stderr, DATA_PRINTF_MODIFIER, q[i]);
+    if (i % 20 == 0) fprintf (stderr, "\n");
+  }
+  fprintf (stderr, "\n");
+}
+
+int main(int argc, char** argv)
+{
+	int nx = NX;
+	int ny = NY;
+
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NX,NY,nx,ny);
+	POLYBENCH_1D_ARRAY_DECL(s,DATA_TYPE,NY,ny);
+	POLYBENCH_1D_ARRAY_DECL(q,DATA_TYPE,NX,nx);
+	POLYBENCH_1D_ARRAY_DECL(p,DATA_TYPE,NY,ny);
+	POLYBENCH_1D_ARRAY_DECL(r,DATA_TYPE,NX,nx);
+	POLYBENCH_1D_ARRAY_DECL(s_outputFromGpu,DATA_TYPE,NY,ny);
+	POLYBENCH_1D_ARRAY_DECL(q_outputFromGpu,DATA_TYPE,NX,nx);
+
+	init_array(nx, ny, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(p), POLYBENCH_ARRAY(r));
+
+	//GPU_argv_init();
+
+	//bicgCuda(nx, ny, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(r), POLYBENCH_ARRAY(s), POLYBENCH_ARRAY(p), POLYBENCH_ARRAY(q), 
+	//	POLYBENCH_ARRAY(s_outputFromGpu), POLYBENCH_ARRAY(q_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		bicg_cpu(nx, ny, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(r), POLYBENCH_ARRAY(s), POLYBENCH_ARRAY(p), POLYBENCH_ARRAY(q));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		//compareResults(nx, ny, POLYBENCH_ARRAY(s), POLYBENCH_ARRAY(s_outputFromGpu), POLYBENCH_ARRAY(q), 
+		//	POLYBENCH_ARRAY(q_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(nx, ny, POLYBENCH_ARRAY(s_outputFromGpu), POLYBENCH_ARRAY(q_outputFromGpu)));
+	
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(r);
+	POLYBENCH_FREE_ARRAY(s);
+	POLYBENCH_FREE_ARRAY(p);
+	POLYBENCH_FREE_ARRAY(q);
+	POLYBENCH_FREE_ARRAY(s_outputFromGpu);
+	POLYBENCH_FREE_ARRAY(q_outputFromGpu);
+
+  	return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/linear-algebra/kernels/bicg/bicg.exe


+ 61 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/bicg/bicg.h

@@ -0,0 +1,61 @@
+/**
+ * bicg.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef BICG_CUH
+# define BICG_CUH
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(NX) && !defined(NY)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+#define NX 1024
+#define NY 1024
+#  endif
+
+#  ifdef SMALL_DATASET
+#define NX 2048
+#define NY 2048
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+#define NX 4096
+#define NY 4096
+#  endif
+
+#  ifdef LARGE_DATASET
+#define NX 8192
+#define NY 8192
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+#define NX 16384
+#define NY 16384
+#  endif
+# endif /* !N */
+
+# define _PB_NX POLYBENCH_LOOP_BOUND(NX,nx)
+# define _PB_NY POLYBENCH_LOOP_BOUND(NY,ny)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions */
+#define DIM_THREAD_BLOCK_X 256
+#define DIM_THREAD_BLOCK_Y 1
+
+
+#endif /* !BICG*/

+ 5 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/doitgen/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := doitgen.exe
+CUFILES := doitgen.c
+PATH_TO_UTILS := ../../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 158 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/doitgen/doitgen.c

@@ -0,0 +1,158 @@
+/**
+ * doitgen.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define POLYBENCH_TIME 1
+
+#include "doitgen.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+/* Main computational kernel. The whole function will be timed,
+   including the call and return. */
+void kernel_doitgenCpu(int nr, int nq, int np,
+		    DATA_TYPE POLYBENCH_3D(A,NR,NQ,NP,nr,nq,np),
+		    DATA_TYPE POLYBENCH_2D(C4,NP,NP,np,np),
+		    DATA_TYPE POLYBENCH_3D(sum,NR,NQ,NP,nr,nq,np))
+{
+	int r, q, p, s;
+
+
+	for (r = 0; r < _PB_NR; r++)
+	{
+		for (q = 0; q < _PB_NQ; q++)  
+		{
+			for (p = 0; p < _PB_NP; p++)  
+			{
+				sum[r][q][p] = 0;
+				for (s = 0; s < _PB_NP; s++)
+					sum[r][q][p] = sum[r][q][p] + A[r][q][s] * C4[s][p];
+			}
+			for (p = 0; p < _PB_NR; p++)
+				A[r][q][p] = sum[r][q][p];
+		}
+	}
+
+
+}
+
+
+/* Array initialization. */
+void init_array(int nr, int nq, int np,
+		DATA_TYPE POLYBENCH_3D(A,NR,NQ,NP,nr,nq,np),
+		DATA_TYPE POLYBENCH_2D(C4,NP,NP,np,np))
+{
+	int i, j, k;
+
+	for (i = 0; i < nr; i++)
+		for (j = 0; j < nq; j++)
+			for (k = 0; k < np; k++)
+				A[i][j][k] = ((DATA_TYPE) i*j + k) / np;
+
+	for (i = 0; i < np; i++)
+		for (j = 0; j < np; j++)
+			C4[i][j] = ((DATA_TYPE) i*j) / np;
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int nr, int nq, int np,
+		 DATA_TYPE POLYBENCH_3D(A,NR,NQ,NP,nr,nq,np))
+{
+	int i, j, k;
+
+	for (i = 0; i < nr; i++)
+	{
+		for (j = 0; j < nq; j++)
+		{
+			for (k = 0; k < np; k++) 
+			{
+				fprintf (stderr, DATA_PRINTF_MODIFIER, A[i][j][k]);
+				if (i % 20 == 0) fprintf (stderr, "\n");
+			}
+		}
+	}
+	fprintf (stderr, "\n");
+}
+	
+
+int main(int argc, char *argv[])
+{
+	/* Retrieve problem size. */
+	int nr = NR;
+	int nq = NQ;
+	int np = NP;
+
+	/* Variable declaration/allocation. */
+	POLYBENCH_3D_ARRAY_DECL(A,DATA_TYPE,NR,NQ,NP,nr,nq,np);
+	POLYBENCH_3D_ARRAY_DECL(sum,DATA_TYPE,NR,NQ,NP,nr,nq,np);
+	POLYBENCH_3D_ARRAY_DECL(sum_outputFromGpu,DATA_TYPE,NR,NQ,NP,nr,nq,np);
+	POLYBENCH_2D_ARRAY_DECL(C4,DATA_TYPE,NP,NP,np,np);
+
+	/* Initialize array(s). */
+	init_array (nr, nq, np,
+	      POLYBENCH_ARRAY(A),
+	      POLYBENCH_ARRAY(C4));
+
+	//doitgenCuda(nr, nq, np,
+	//	POLYBENCH_ARRAY(A),
+	//	POLYBENCH_ARRAY(C4),
+	//	POLYBENCH_ARRAY(sum_outputFromGpu));
+
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		/* Run kernel on CPU */
+		kernel_doitgenCpu(nr, nq, np,
+		  POLYBENCH_ARRAY(A),
+		  POLYBENCH_ARRAY(C4),
+		  POLYBENCH_ARRAY(sum));	
+		
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+  		polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		//compareResults(nr, nq, np, POLYBENCH_ARRAY(sum), POLYBENCH_ARRAY(sum_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(nr, nq, np, POLYBENCH_ARRAY(sum_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+	/* Garbage collection */
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(sum);
+	POLYBENCH_FREE_ARRAY(sum_outputFromGpu);
+	POLYBENCH_FREE_ARRAY(C4);	
+    
+	return 0;
+}
+
+#include <polybench.c>

+ 158 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/doitgen/doitgen.c_backup

@@ -0,0 +1,158 @@
+/**
+ * doitgen.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define POLYBENCH_TIME 1
+
+#include "doitgen.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+/* Main computational kernel. The whole function will be timed,
+   including the call and return. */
+void kernel_doitgenCpu(int nr, int nq, int np,
+		    DATA_TYPE POLYBENCH_3D(A,NR,NQ,NP,nr,nq,np),
+		    DATA_TYPE POLYBENCH_2D(C4,NP,NP,np,np),
+		    DATA_TYPE POLYBENCH_3D(sum,NR,NQ,NP,nr,nq,np))
+{
+	int r, q, p, s;
+
+
+	for (r = 0; r < _PB_NR; r++)
+	{
+		for (q = 0; q < _PB_NQ; q++)  
+		{
+			for (p = 0; p < _PB_NP; p++)  
+			{
+				sum[r][q][p] = 0;
+				for (s = 0; s < _PB_NP; s++)
+					sum[r][q][p] = sum[r][q][p] + A[r][q][s] * C4[s][p];
+			}
+			for (p = 0; p < _PB_NR; p++)
+				A[r][q][p] = sum[r][q][p];
+		}
+	}
+
+
+}
+
+
+/* Array initialization. */
+void init_array(int nr, int nq, int np,
+		DATA_TYPE POLYBENCH_3D(A,NR,NQ,NP,nr,nq,np),
+		DATA_TYPE POLYBENCH_2D(C4,NP,NP,np,np))
+{
+	int i, j, k;
+
+	for (i = 0; i < nr; i++)
+		for (j = 0; j < nq; j++)
+			for (k = 0; k < np; k++)
+				A[i][j][k] = ((DATA_TYPE) i*j + k) / np;
+
+	for (i = 0; i < np; i++)
+		for (j = 0; j < np; j++)
+			C4[i][j] = ((DATA_TYPE) i*j) / np;
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int nr, int nq, int np,
+		 DATA_TYPE POLYBENCH_3D(A,NR,NQ,NP,nr,nq,np))
+{
+	int i, j, k;
+
+	for (i = 0; i < nr; i++)
+	{
+		for (j = 0; j < nq; j++)
+		{
+			for (k = 0; k < np; k++) 
+			{
+				fprintf (stderr, DATA_PRINTF_MODIFIER, A[i][j][k]);
+				if (i % 20 == 0) fprintf (stderr, "\n");
+			}
+		}
+	}
+	fprintf (stderr, "\n");
+}
+	
+
+int main(int argc, char *argv[])
+{
+	/* Retrieve problem size. */
+	int nr = NR;
+	int nq = NQ;
+	int np = NP;
+
+	/* Variable declaration/allocation. */
+	POLYBENCH_3D_ARRAY_DECL(A,DATA_TYPE,NR,NQ,NP,nr,nq,np);
+	POLYBENCH_3D_ARRAY_DECL(sum,DATA_TYPE,NR,NQ,NP,nr,nq,np);
+	POLYBENCH_3D_ARRAY_DECL(sum_outputFromGpu,DATA_TYPE,NR,NQ,NP,nr,nq,np);
+	POLYBENCH_2D_ARRAY_DECL(C4,DATA_TYPE,NP,NP,np,np);
+
+	/* Initialize array(s). */
+	init_array (nr, nq, np,
+	      POLYBENCH_ARRAY(A),
+	      POLYBENCH_ARRAY(C4));
+
+	//doitgenCuda(nr, nq, np,
+	//	POLYBENCH_ARRAY(A),
+	//	POLYBENCH_ARRAY(C4),
+	//	POLYBENCH_ARRAY(sum_outputFromGpu));
+
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		/* Run kernel on CPU */
+		kernel_doitgenCpu(nr, nq, np,
+		  POLYBENCH_ARRAY(A),
+		  POLYBENCH_ARRAY(C4),
+		  POLYBENCH_ARRAY(sum));	
+		
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+  		polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		//compareResults(nr, nq, np, POLYBENCH_ARRAY(sum), POLYBENCH_ARRAY(sum_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(nr, nq, np, POLYBENCH_ARRAY(sum_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+	/* Garbage collection */
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(sum);
+	POLYBENCH_FREE_ARRAY(sum_outputFromGpu);
+	POLYBENCH_FREE_ARRAY(C4);	
+    
+	return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/linear-algebra/kernels/doitgen/doitgen.exe


+ 66 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/doitgen/doitgen.h

@@ -0,0 +1,66 @@
+/**
+ * doitgen.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef DOITGEN_CUH
+# define DOITGEN_CUH
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(NQ) && !defined(NR) && !defined(NP)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+#   define NQ 32
+#   define NR 32
+#   define NP 32
+#  endif
+
+#  ifdef SMALL_DATASET
+#   define NQ 64
+#   define NR 64
+#   define NP 64
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+#   define NQ 128
+#   define NR 128
+#   define NP 128
+#  endif
+
+#  ifdef LARGE_DATASET
+#   define NQ 256
+#   define NR 256
+#   define NP 256
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+#   define NQ 512
+#   define NR 512
+#   define NP 512
+#  endif
+# endif /* !N */
+
+# define _PB_NQ POLYBENCH_LOOP_BOUND(NQ,nq)
+# define _PB_NR POLYBENCH_LOOP_BOUND(NR,nr)
+# define _PB_NP POLYBENCH_LOOP_BOUND(NP,np)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions */
+#define DIM_THREAD_BLOCK_X 32
+#define DIM_THREAD_BLOCK_Y 8
+
+#endif /* !DOITGEN */

+ 5 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/gemm/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := gemm.exe
+CUFILES := gemm.c
+PATH_TO_UTILS := ../../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 157 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/gemm/gemm.c

@@ -0,0 +1,157 @@
+/**
+ * gemm.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define POLYBENCH_TIME 1
+
+#include "gemm.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+#define GPU_DEVICE 0
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define RUN_ON_CPU
+
+
+void gemm(int ni, int nj, int nk, DATA_TYPE alpha, DATA_TYPE beta, DATA_TYPE POLYBENCH_2D(A,NI,NK,ni,nk), 
+	 DATA_TYPE POLYBENCH_2D(B,NK,NJ,nk,nj), DATA_TYPE POLYBENCH_2D(C,NI,NJ,ni,nj))
+{
+	int i,j,k;
+	
+
+	for (i = 0; i < _PB_NI; i++)
+	{
+    		for (j = 0; j < _PB_NJ; j++)
+    		{
+			C[i][j] *= beta;
+	
+			for (k = 0; k < _PB_NK; ++k)
+			{
+	  			C[i][j] += alpha * A[i][k] * B[k][j];
+			}
+      		}
+	}
+
+
+}
+
+
+void init(int ni, int nj, int nk, DATA_TYPE* alpha, DATA_TYPE* beta, DATA_TYPE POLYBENCH_2D(A,NI,NK,ni,nk), 
+	DATA_TYPE POLYBENCH_2D(B,NK,NJ,nk,nj), DATA_TYPE POLYBENCH_2D(C,NI,NJ,ni,nj))
+{
+	int i, j;
+
+	*alpha = 32412;
+	*beta = 2123;
+
+  	for (i = 0; i < ni; i++)
+	{
+    		for (j = 0; j < nk; j++)
+		{
+      			A[i][j] = ((DATA_TYPE) i*j) / NI;
+		}
+	}
+
+  	for (i = 0; i < nk; i++)
+	{
+    		for (j = 0; j < nj; j++)
+		{
+      			B[i][j] = ((DATA_TYPE) i*j) / NI;
+		}
+	}
+
+  	for (i = 0; i < ni; i++)
+	{
+    		for (j = 0; j < nj; j++)
+		{
+      			C[i][j] = ((DATA_TYPE) i*j) / NI;
+		}
+	}
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int ni, int nj,
+		 DATA_TYPE POLYBENCH_2D(C,NI,NJ,ni,nj))
+{
+  int i, j;
+
+  for (i = 0; i < ni; i++)
+    for (j = 0; j < nj; j++) {
+	fprintf (stderr, DATA_PRINTF_MODIFIER, C[i][j]);
+	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+	/* Retrieve problem size. */
+	int ni = NI;
+	int nj = NJ;
+	int nk = NK;
+
+	/* Variable declaration/allocation. */
+	DATA_TYPE alpha;
+	DATA_TYPE beta;
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NI,NK,ni,nk);
+	POLYBENCH_2D_ARRAY_DECL(B,DATA_TYPE,NK,NJ,nk,nj);
+	POLYBENCH_2D_ARRAY_DECL(C,DATA_TYPE,NI,NJ,ni,nj);
+	POLYBENCH_2D_ARRAY_DECL(C_outputFromGpu,DATA_TYPE,NI,NJ,ni,nj);
+
+	init(ni, nj, nk, &alpha, &beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C));
+	
+	//GPU_argv_init();
+	
+	//gemmCuda(ni, nj, nk, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(C_outputFromGpu));
+
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		gemm(ni, nj, nk, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C));
+		
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+  		polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		//compareResults(ni, nj, POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(C_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(ni, nj, POLYBENCH_ARRAY(C_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(B);  
+	POLYBENCH_FREE_ARRAY(C);  
+	POLYBENCH_FREE_ARRAY(C_outputFromGpu); 
+
+    	return 0;
+}
+
+#include <polybench.c>

+ 157 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/gemm/gemm.c_backup

@@ -0,0 +1,157 @@
+/**
+ * gemm.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define POLYBENCH_TIME 1
+
+#include "gemm.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+#define GPU_DEVICE 0
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define RUN_ON_CPU
+
+
+void gemm(int ni, int nj, int nk, DATA_TYPE alpha, DATA_TYPE beta, DATA_TYPE POLYBENCH_2D(A,NI,NK,ni,nk), 
+	 DATA_TYPE POLYBENCH_2D(B,NK,NJ,nk,nj), DATA_TYPE POLYBENCH_2D(C,NI,NJ,ni,nj))
+{
+	int i,j,k;
+	
+
+	for (i = 0; i < _PB_NI; i++)
+	{
+    		for (j = 0; j < _PB_NJ; j++)
+    		{
+			C[i][j] *= beta;
+	
+			for (k = 0; k < _PB_NK; ++k)
+			{
+	  			C[i][j] += alpha * A[i][k] * B[k][j];
+			}
+      		}
+	}
+
+
+}
+
+
+void init(int ni, int nj, int nk, DATA_TYPE* alpha, DATA_TYPE* beta, DATA_TYPE POLYBENCH_2D(A,NI,NK,ni,nk), 
+	DATA_TYPE POLYBENCH_2D(B,NK,NJ,nk,nj), DATA_TYPE POLYBENCH_2D(C,NI,NJ,ni,nj))
+{
+	int i, j;
+
+	*alpha = 32412;
+	*beta = 2123;
+
+  	for (i = 0; i < ni; i++)
+	{
+    		for (j = 0; j < nk; j++)
+		{
+      			A[i][j] = ((DATA_TYPE) i*j) / NI;
+		}
+	}
+
+  	for (i = 0; i < nk; i++)
+	{
+    		for (j = 0; j < nj; j++)
+		{
+      			B[i][j] = ((DATA_TYPE) i*j) / NI;
+		}
+	}
+
+  	for (i = 0; i < ni; i++)
+	{
+    		for (j = 0; j < nj; j++)
+		{
+      			C[i][j] = ((DATA_TYPE) i*j) / NI;
+		}
+	}
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int ni, int nj,
+		 DATA_TYPE POLYBENCH_2D(C,NI,NJ,ni,nj))
+{
+  int i, j;
+
+  for (i = 0; i < ni; i++)
+    for (j = 0; j < nj; j++) {
+	fprintf (stderr, DATA_PRINTF_MODIFIER, C[i][j]);
+	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+	/* Retrieve problem size. */
+	int ni = NI;
+	int nj = NJ;
+	int nk = NK;
+
+	/* Variable declaration/allocation. */
+	DATA_TYPE alpha;
+	DATA_TYPE beta;
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NI,NK,ni,nk);
+	POLYBENCH_2D_ARRAY_DECL(B,DATA_TYPE,NK,NJ,nk,nj);
+	POLYBENCH_2D_ARRAY_DECL(C,DATA_TYPE,NI,NJ,ni,nj);
+	POLYBENCH_2D_ARRAY_DECL(C_outputFromGpu,DATA_TYPE,NI,NJ,ni,nj);
+
+	init(ni, nj, nk, &alpha, &beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C));
+	
+	//GPU_argv_init();
+	
+	//gemmCuda(ni, nj, nk, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(C_outputFromGpu));
+
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		gemm(ni, nj, nk, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C));
+		
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+  		polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		//compareResults(ni, nj, POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(C_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(ni, nj, POLYBENCH_ARRAY(C_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(B);  
+	POLYBENCH_FREE_ARRAY(C);  
+	POLYBENCH_FREE_ARRAY(C_outputFromGpu); 
+
+    	return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/linear-algebra/kernels/gemm/gemm.exe


+ 67 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/gemm/gemm.h

@@ -0,0 +1,67 @@
+/**
+ * gemm.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef GEMM_CUH
+# define GEMM_CUH
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(NI) && !defined(NJ) && !defined(NK)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+#define NI 128
+#define NJ 128
+#define NK 128
+#  endif
+
+#  ifdef SMALL_DATASET
+#define NI 256
+#define NJ 256
+#define NK 256
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+#define NI 512
+#define NJ 512
+#define NK 512
+#  endif
+
+#  ifdef LARGE_DATASET
+#define NI 1024
+#define NJ 1024
+#define NK 1024
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+#define NI 2048
+#define NJ 2048
+#define NK 2048
+#  endif
+# endif /* !N */
+
+# define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni)
+# define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj)
+# define _PB_NK POLYBENCH_LOOP_BOUND(NK,nk)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions */
+#define DIM_THREAD_BLOCK_X 32
+#define DIM_THREAD_BLOCK_Y 8
+
+
+#endif /* !GEMM*/

+ 5 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/gemver/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := gemver.exe
+CUFILES := gemver.c
+PATH_TO_UTILS := ../../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 199 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/gemver/gemver.c

@@ -0,0 +1,199 @@
+/**
+ * gemver.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define POLYBENCH_TIME 1
+
+#include "gemver.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+
+void gemver(int n, DATA_TYPE alpha, DATA_TYPE beta, DATA_TYPE POLYBENCH_2D(A, N, N, n, n), DATA_TYPE POLYBENCH_1D(u1, N, n), DATA_TYPE POLYBENCH_1D(v1, N, n), 
+	DATA_TYPE POLYBENCH_1D(u2, N, n), DATA_TYPE POLYBENCH_1D(v2, N, n), DATA_TYPE POLYBENCH_1D(w, N, n), DATA_TYPE POLYBENCH_1D(x, N, n), DATA_TYPE POLYBENCH_1D(y, N, n), 
+	DATA_TYPE POLYBENCH_1D(z, N, n))
+{
+	int i,j;
+	
+
+  	for (i = 0; i < _PB_N; i++)
+	{
+    		for (j = 0; j < _PB_N; j++)
+		{
+      			A[i][j] = A[i][j] + u1[i] * v1[j] + u2[i] * v2[j];
+		}
+	}
+
+
+  	for (i = 0; i < _PB_N; i++)
+	{
+    		for (j = 0; j < _PB_N; j++)
+		{
+      			x[i] = x[i] + beta * A[j][i] * y[j];
+		}
+	}
+
+  	for (i = 0; i < _PB_N; i++)
+	{
+    		x[i] = x[i] + z[i];
+	}
+
+
+  	for (i = 0; i < _PB_N; i++)
+	{
+    		for (j = 0; j < _PB_N; j++)
+		{
+      			w[i] = w[i] +  alpha * A[i][j] * x[j];
+		}
+	}
+
+
+}
+
+
+void init(int n, DATA_TYPE *alpha,
+	DATA_TYPE *beta,
+	DATA_TYPE POLYBENCH_2D(A,N,N,n,n),
+	DATA_TYPE POLYBENCH_1D(u1,N,n),
+	DATA_TYPE POLYBENCH_1D(v1,N,n),
+	DATA_TYPE POLYBENCH_1D(u2,N,n),
+	DATA_TYPE POLYBENCH_1D(v2,N,n),
+	DATA_TYPE POLYBENCH_1D(w,N,n),
+	DATA_TYPE POLYBENCH_1D(x,N,n),
+	DATA_TYPE POLYBENCH_1D(y,N,n),
+	DATA_TYPE POLYBENCH_1D(z,N,n))
+{
+	int i, j;
+
+	*alpha = 43532;
+	*beta = 12313;
+
+  	for (i = 0; i < N; i++)
+	{
+	    	u1[i] = i;
+	    	u2[i] = (i+1)/N/2.0;
+	    	v1[i] = (i+1)/N/4.0;
+	    	v2[i] = (i+1)/N/6.0;
+	    	y[i] = (i+1)/N/8.0;
+	    	z[i] = (i+1)/N/9.0;
+	    	x[i] = 0.0;
+	    	w[i] = 0.0;
+
+    		for (j = 0; j < N; j++)
+		{
+			A[i][j] = ((DATA_TYPE) i*j) / N;
+		}
+	}
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int n,
+		 DATA_TYPE POLYBENCH_1D(w,N,n))
+{
+  int i;
+
+  for (i = 0; i < n; i++) {
+    fprintf (stderr, DATA_PRINTF_MODIFIER, w[i]);
+    if (i % 20 == 0) fprintf (stderr, "\n");
+  }
+}
+	
+
+int main(int argc, char *argv[])
+{
+	/* Retrieve problem size. */
+	int n = N;
+
+	/* Variable declaration/allocation. */
+	DATA_TYPE alpha;
+	DATA_TYPE beta;
+
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,N,N,n,n);
+	POLYBENCH_1D_ARRAY_DECL(u1,DATA_TYPE,N,n);
+  	POLYBENCH_1D_ARRAY_DECL(v1,DATA_TYPE,N,n);
+  	POLYBENCH_1D_ARRAY_DECL(u2,DATA_TYPE,N,n);
+  	POLYBENCH_1D_ARRAY_DECL(v2,DATA_TYPE,N,n);
+  	POLYBENCH_1D_ARRAY_DECL(w,DATA_TYPE,N,n);
+  	POLYBENCH_1D_ARRAY_DECL(w_outputFromGpu,DATA_TYPE,N,n);
+  	POLYBENCH_1D_ARRAY_DECL(x,DATA_TYPE,N,n);
+  	POLYBENCH_1D_ARRAY_DECL(y,DATA_TYPE,N,n);
+  	POLYBENCH_1D_ARRAY_DECL(z,DATA_TYPE,N,n);
+  	
+	
+	init(n, &alpha, &beta,
+	      POLYBENCH_ARRAY(A),
+	      POLYBENCH_ARRAY(u1),
+	      POLYBENCH_ARRAY(v1),
+	      POLYBENCH_ARRAY(u2),
+	      POLYBENCH_ARRAY(v2),
+	      POLYBENCH_ARRAY(w),
+	      POLYBENCH_ARRAY(x),
+	      POLYBENCH_ARRAY(y),
+	      POLYBENCH_ARRAY(z));
+	
+	//GPU_argv_init();
+
+	//gemverCuda(n, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(u1), POLYBENCH_ARRAY(v1), POLYBENCH_ARRAY(u2), POLYBENCH_ARRAY(v2), 
+	//	POLYBENCH_ARRAY(w), POLYBENCH_ARRAY(w_outputFromGpu), POLYBENCH_ARRAY(x), POLYBENCH_ARRAY(y), POLYBENCH_ARRAY(z));
+
+	#ifdef RUN_ON_CPU
+
+	 	/* Start timer. */
+	  	polybench_start_instruments;
+	
+		gemver(n, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(u1), POLYBENCH_ARRAY(v1), POLYBENCH_ARRAY(u2), POLYBENCH_ARRAY(v2), 
+			POLYBENCH_ARRAY(w), POLYBENCH_ARRAY(x), POLYBENCH_ARRAY(y), POLYBENCH_ARRAY(z));
+
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+  		polybench_stop_instruments;
+ 		polybench_print_instruments;
+		
+		//compareResults(n, POLYBENCH_ARRAY(w), POLYBENCH_ARRAY(w_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(w_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(w);  
+	POLYBENCH_FREE_ARRAY(w_outputFromGpu);  
+	POLYBENCH_FREE_ARRAY(x);  
+	POLYBENCH_FREE_ARRAY(y);
+	POLYBENCH_FREE_ARRAY(z);
+	POLYBENCH_FREE_ARRAY(u1);
+	POLYBENCH_FREE_ARRAY(u2);
+	POLYBENCH_FREE_ARRAY(v1);
+	POLYBENCH_FREE_ARRAY(v2);
+
+ 	return 0;
+}
+
+#include <polybench.c>

+ 199 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/gemver/gemver.c_backup

@@ -0,0 +1,199 @@
+/**
+ * gemver.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define POLYBENCH_TIME 1
+
+#include "gemver.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+
+void gemver(int n, DATA_TYPE alpha, DATA_TYPE beta, DATA_TYPE POLYBENCH_2D(A, N, N, n, n), DATA_TYPE POLYBENCH_1D(u1, N, n), DATA_TYPE POLYBENCH_1D(v1, N, n), 
+	DATA_TYPE POLYBENCH_1D(u2, N, n), DATA_TYPE POLYBENCH_1D(v2, N, n), DATA_TYPE POLYBENCH_1D(w, N, n), DATA_TYPE POLYBENCH_1D(x, N, n), DATA_TYPE POLYBENCH_1D(y, N, n), 
+	DATA_TYPE POLYBENCH_1D(z, N, n))
+{
+	int i,j;
+	
+
+  	for (i = 0; i < _PB_N; i++)
+	{
+    		for (j = 0; j < _PB_N; j++)
+		{
+      			A[i][j] = A[i][j] + u1[i] * v1[j] + u2[i] * v2[j];
+		}
+	}
+
+
+  	for (i = 0; i < _PB_N; i++)
+	{
+    		for (j = 0; j < _PB_N; j++)
+		{
+      			x[i] = x[i] + beta * A[j][i] * y[j];
+		}
+	}
+
+  	for (i = 0; i < _PB_N; i++)
+	{
+    		x[i] = x[i] + z[i];
+	}
+
+
+  	for (i = 0; i < _PB_N; i++)
+	{
+    		for (j = 0; j < _PB_N; j++)
+		{
+      			w[i] = w[i] +  alpha * A[i][j] * x[j];
+		}
+	}
+
+
+}
+
+
+void init(int n, DATA_TYPE *alpha,
+	DATA_TYPE *beta,
+	DATA_TYPE POLYBENCH_2D(A,N,N,n,n),
+	DATA_TYPE POLYBENCH_1D(u1,N,n),
+	DATA_TYPE POLYBENCH_1D(v1,N,n),
+	DATA_TYPE POLYBENCH_1D(u2,N,n),
+	DATA_TYPE POLYBENCH_1D(v2,N,n),
+	DATA_TYPE POLYBENCH_1D(w,N,n),
+	DATA_TYPE POLYBENCH_1D(x,N,n),
+	DATA_TYPE POLYBENCH_1D(y,N,n),
+	DATA_TYPE POLYBENCH_1D(z,N,n))
+{
+	int i, j;
+
+	*alpha = 43532;
+	*beta = 12313;
+
+  	for (i = 0; i < N; i++)
+	{
+	    	u1[i] = i;
+	    	u2[i] = (i+1)/N/2.0;
+	    	v1[i] = (i+1)/N/4.0;
+	    	v2[i] = (i+1)/N/6.0;
+	    	y[i] = (i+1)/N/8.0;
+	    	z[i] = (i+1)/N/9.0;
+	    	x[i] = 0.0;
+	    	w[i] = 0.0;
+
+    		for (j = 0; j < N; j++)
+		{
+			A[i][j] = ((DATA_TYPE) i*j) / N;
+		}
+	}
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int n,
+		 DATA_TYPE POLYBENCH_1D(w,N,n))
+{
+  int i;
+
+  for (i = 0; i < n; i++) {
+    fprintf (stderr, DATA_PRINTF_MODIFIER, w[i]);
+    if (i % 20 == 0) fprintf (stderr, "\n");
+  }
+}
+	
+
+int main(int argc, char *argv[])
+{
+	/* Retrieve problem size. */
+	int n = N;
+
+	/* Variable declaration/allocation. */
+	DATA_TYPE alpha;
+	DATA_TYPE beta;
+
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,N,N,n,n);
+	POLYBENCH_1D_ARRAY_DECL(u1,DATA_TYPE,N,n);
+  	POLYBENCH_1D_ARRAY_DECL(v1,DATA_TYPE,N,n);
+  	POLYBENCH_1D_ARRAY_DECL(u2,DATA_TYPE,N,n);
+  	POLYBENCH_1D_ARRAY_DECL(v2,DATA_TYPE,N,n);
+  	POLYBENCH_1D_ARRAY_DECL(w,DATA_TYPE,N,n);
+  	POLYBENCH_1D_ARRAY_DECL(w_outputFromGpu,DATA_TYPE,N,n);
+  	POLYBENCH_1D_ARRAY_DECL(x,DATA_TYPE,N,n);
+  	POLYBENCH_1D_ARRAY_DECL(y,DATA_TYPE,N,n);
+  	POLYBENCH_1D_ARRAY_DECL(z,DATA_TYPE,N,n);
+  	
+	
+	init(n, &alpha, &beta,
+	      POLYBENCH_ARRAY(A),
+	      POLYBENCH_ARRAY(u1),
+	      POLYBENCH_ARRAY(v1),
+	      POLYBENCH_ARRAY(u2),
+	      POLYBENCH_ARRAY(v2),
+	      POLYBENCH_ARRAY(w),
+	      POLYBENCH_ARRAY(x),
+	      POLYBENCH_ARRAY(y),
+	      POLYBENCH_ARRAY(z));
+	
+	//GPU_argv_init();
+
+	//gemverCuda(n, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(u1), POLYBENCH_ARRAY(v1), POLYBENCH_ARRAY(u2), POLYBENCH_ARRAY(v2), 
+	//	POLYBENCH_ARRAY(w), POLYBENCH_ARRAY(w_outputFromGpu), POLYBENCH_ARRAY(x), POLYBENCH_ARRAY(y), POLYBENCH_ARRAY(z));
+
+	#ifdef RUN_ON_CPU
+
+	 	/* Start timer. */
+	  	polybench_start_instruments;
+	
+		gemver(n, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(u1), POLYBENCH_ARRAY(v1), POLYBENCH_ARRAY(u2), POLYBENCH_ARRAY(v2), 
+			POLYBENCH_ARRAY(w), POLYBENCH_ARRAY(x), POLYBENCH_ARRAY(y), POLYBENCH_ARRAY(z));
+
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+  		polybench_stop_instruments;
+ 		polybench_print_instruments;
+		
+		//compareResults(n, POLYBENCH_ARRAY(w), POLYBENCH_ARRAY(w_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(w_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(w);  
+	POLYBENCH_FREE_ARRAY(w_outputFromGpu);  
+	POLYBENCH_FREE_ARRAY(x);  
+	POLYBENCH_FREE_ARRAY(y);
+	POLYBENCH_FREE_ARRAY(z);
+	POLYBENCH_FREE_ARRAY(u1);
+	POLYBENCH_FREE_ARRAY(u2);
+	POLYBENCH_FREE_ARRAY(v1);
+	POLYBENCH_FREE_ARRAY(v2);
+
+ 	return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/linear-algebra/kernels/gemver/gemver.exe


+ 63 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/gemver/gemver.h

@@ -0,0 +1,63 @@
+/**
+ * gemver.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef GEMVER_CUH
+# define GEMVER_CUH
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(N)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+#define N 1024
+#  endif
+
+#  ifdef SMALL_DATASET
+#define N 2048
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+#define N 4096
+#  endif
+
+#  ifdef LARGE_DATASET
+#define N 8192
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+#define N 16384
+#  endif
+# endif /* !N */
+
+# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions for kernel 1*/
+#define DIM_THREAD_BLOCK_KERNEL_1_X 32
+#define DIM_THREAD_BLOCK_KERNEL_1_Y 8
+
+/* Thread block dimensions for kernel 2*/
+#define DIM_THREAD_BLOCK_KERNEL_2_X 256
+#define DIM_THREAD_BLOCK_KERNEL_2_Y 1
+
+/* Thread block dimensions for kernel 3*/
+#define DIM_THREAD_BLOCK_KERNEL_3_X 256
+#define DIM_THREAD_BLOCK_KERNEL_3_Y 1
+
+
+#endif /* !TWODCONV*/

+ 5 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/gesummv/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := gesummv.exe
+CUFILES := gesummv.c
+PATH_TO_UTILS := ../../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 148 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/gesummv/gesummv.c

@@ -0,0 +1,148 @@
+/**
+ * gesummv.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define POLYBENCH_TIME 1
+
+#include "gesummv.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+/* Declared constant values for ALPHA and BETA (same as values in PolyBench 2.0) */
+#define ALPHA 43532.0f
+#define BETA 12313.0f
+
+#define RUN_ON_CPU
+
+
+void gesummv(int n, DATA_TYPE alpha, DATA_TYPE beta, DATA_TYPE POLYBENCH_2D(A,N,N,n,n), DATA_TYPE POLYBENCH_2D(B,N,N,n,n), DATA_TYPE POLYBENCH_1D(tmp,N,n),
+		DATA_TYPE POLYBENCH_1D(x,N,n), DATA_TYPE POLYBENCH_1D(y,N,n))
+{
+	int i, j;
+	
+
+	for (i = 0; i < _PB_N; i++)
+	{
+		tmp[i] = 0;
+		y[i] = 0;
+		for (j = 0; j < _PB_N; j++)
+		{
+			tmp[i] = A[i][j] * x[j] + tmp[i];
+			y[i] = B[i][j] * x[j] + y[i];
+		}
+		
+		y[i] = alpha * tmp[i] + beta * y[i];
+	}
+
+
+}
+
+
+void init(int n, DATA_TYPE *alpha, DATA_TYPE *beta, DATA_TYPE POLYBENCH_2D(A,N,N,n,n), DATA_TYPE POLYBENCH_2D(B,N,N,n,n), 
+	DATA_TYPE POLYBENCH_1D(x,N,n))
+{
+  	int i, j;
+
+	*alpha = 43532;
+	*beta = 12313;
+
+ 	for (i = 0; i < n; i++)
+    	{
+    		x[i] = ((DATA_TYPE) i) / N;
+      	
+		for (j = 0; j < n; j++) 
+		{
+			A[i][j] = ((DATA_TYPE) i*j) / N;
+			B[i][j] = ((DATA_TYPE) i*j) / n;
+		}
+    }
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int n,
+		 DATA_TYPE POLYBENCH_1D(y,N,n))
+
+{
+  int i;
+
+  for (i = 0; i < n; i++) {
+    fprintf (stderr, DATA_PRINTF_MODIFIER, y[i]);
+    if (i % 20 == 0) fprintf (stderr, "\n");
+  }
+}
+
+
+int main(int argc, char *argv[])
+{
+	/* Retrieve problem size. */
+	int n = N;
+
+	/* Variable declaration/allocation. */
+	DATA_TYPE alpha;
+	DATA_TYPE beta;
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,N,N,n,n);
+	POLYBENCH_2D_ARRAY_DECL(B,DATA_TYPE,N,N,n,n);
+	POLYBENCH_1D_ARRAY_DECL(tmp,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(x,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(y,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(y_outputFromGpu,DATA_TYPE,N,n);
+
+	init(n, &alpha, &beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(x));
+	
+	//GPU_argv_init();
+	//gesummvCuda(n, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(tmp), POLYBENCH_ARRAY(x), POLYBENCH_ARRAY(y),  
+	//	POLYBENCH_ARRAY(y_outputFromGpu));
+	
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		gesummv(n, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(tmp), POLYBENCH_ARRAY(x), POLYBENCH_ARRAY(y));
+		
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+	//	compareResults(n, POLYBENCH_ARRAY(y), POLYBENCH_ARRAY(y_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(y_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(B);  
+	POLYBENCH_FREE_ARRAY(tmp);
+	POLYBENCH_FREE_ARRAY(x);  
+	POLYBENCH_FREE_ARRAY(y);
+	POLYBENCH_FREE_ARRAY(y_outputFromGpu);
+
+	return 0;
+}
+
+#include <polybench.c>

+ 148 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/gesummv/gesummv.c_backup

@@ -0,0 +1,148 @@
+/**
+ * gesummv.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define POLYBENCH_TIME 1
+
+#include "gesummv.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+/* Declared constant values for ALPHA and BETA (same as values in PolyBench 2.0) */
+#define ALPHA 43532.0f
+#define BETA 12313.0f
+
+#define RUN_ON_CPU
+
+
+void gesummv(int n, DATA_TYPE alpha, DATA_TYPE beta, DATA_TYPE POLYBENCH_2D(A,N,N,n,n), DATA_TYPE POLYBENCH_2D(B,N,N,n,n), DATA_TYPE POLYBENCH_1D(tmp,N,n),
+		DATA_TYPE POLYBENCH_1D(x,N,n), DATA_TYPE POLYBENCH_1D(y,N,n))
+{
+	int i, j;
+	
+
+	for (i = 0; i < _PB_N; i++)
+	{
+		tmp[i] = 0;
+		y[i] = 0;
+		for (j = 0; j < _PB_N; j++)
+		{
+			tmp[i] = A[i][j] * x[j] + tmp[i];
+			y[i] = B[i][j] * x[j] + y[i];
+		}
+		
+		y[i] = alpha * tmp[i] + beta * y[i];
+	}
+
+
+}
+
+
+void init(int n, DATA_TYPE *alpha, DATA_TYPE *beta, DATA_TYPE POLYBENCH_2D(A,N,N,n,n), DATA_TYPE POLYBENCH_2D(B,N,N,n,n), 
+	DATA_TYPE POLYBENCH_1D(x,N,n))
+{
+  	int i, j;
+
+	*alpha = 43532;
+	*beta = 12313;
+
+ 	for (i = 0; i < n; i++)
+    	{
+    		x[i] = ((DATA_TYPE) i) / N;
+      	
+		for (j = 0; j < n; j++) 
+		{
+			A[i][j] = ((DATA_TYPE) i*j) / N;
+			B[i][j] = ((DATA_TYPE) i*j) / n;
+		}
+    }
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int n,
+		 DATA_TYPE POLYBENCH_1D(y,N,n))
+
+{
+  int i;
+
+  for (i = 0; i < n; i++) {
+    fprintf (stderr, DATA_PRINTF_MODIFIER, y[i]);
+    if (i % 20 == 0) fprintf (stderr, "\n");
+  }
+}
+
+
+int main(int argc, char *argv[])
+{
+	/* Retrieve problem size. */
+	int n = N;
+
+	/* Variable declaration/allocation. */
+	DATA_TYPE alpha;
+	DATA_TYPE beta;
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,N,N,n,n);
+	POLYBENCH_2D_ARRAY_DECL(B,DATA_TYPE,N,N,n,n);
+	POLYBENCH_1D_ARRAY_DECL(tmp,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(x,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(y,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(y_outputFromGpu,DATA_TYPE,N,n);
+
+	init(n, &alpha, &beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(x));
+	
+	//GPU_argv_init();
+	//gesummvCuda(n, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(tmp), POLYBENCH_ARRAY(x), POLYBENCH_ARRAY(y),  
+	//	POLYBENCH_ARRAY(y_outputFromGpu));
+	
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		gesummv(n, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(tmp), POLYBENCH_ARRAY(x), POLYBENCH_ARRAY(y));
+		
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+	//	compareResults(n, POLYBENCH_ARRAY(y), POLYBENCH_ARRAY(y_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(y_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(B);  
+	POLYBENCH_FREE_ARRAY(tmp);
+	POLYBENCH_FREE_ARRAY(x);  
+	POLYBENCH_FREE_ARRAY(y);
+	POLYBENCH_FREE_ARRAY(y_outputFromGpu);
+
+	return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/linear-algebra/kernels/gesummv/gesummv.exe


+ 55 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/gesummv/gesummv.h

@@ -0,0 +1,55 @@
+/**
+ * gesummv.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef GESUMMV_CUH
+# define GESUMMV_CUH
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(N)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+#define N 1024
+#  endif
+
+#  ifdef SMALL_DATASET
+#define N 2048
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+#define N 4096
+#  endif
+
+#  ifdef LARGE_DATASET
+#define N 8192
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+#define N 16384
+#  endif
+# endif /* !N */
+
+# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions */
+#define DIM_THREAD_BLOCK_X 256
+#define DIM_THREAD_BLOCK_Y 1
+
+
+#endif /* !GESUMMV*/

+ 5 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/mvt/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := mvt.exe
+CUFILES := mvt.c
+PATH_TO_UTILS := ../../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 144 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/mvt/mvt.c

@@ -0,0 +1,144 @@
+/**
+ * mvt.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/time.h>
+
+#define POLYBENCH_TIME 1
+
+#include "mvt.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void init_array(int n, DATA_TYPE POLYBENCH_2D(A, N, N, n, n), DATA_TYPE POLYBENCH_1D(x1, N, n), DATA_TYPE POLYBENCH_1D(x2, N, n), DATA_TYPE POLYBENCH_1D(y1, N, n), DATA_TYPE POLYBENCH_1D(y2, N, n))
+{
+	int i, j;
+
+	for (i = 0; i < n; i++)
+	{
+		x1[i] = ((DATA_TYPE) i) / N;
+		x2[i] = ((DATA_TYPE) i + 1) / N;
+		y1[i] = ((DATA_TYPE) i + 3) / N;
+		y2[i] = ((DATA_TYPE) i + 4) / N;
+		for (j = 0; j < n; j++)
+		{
+			A[i][j] = ((DATA_TYPE) i*j) / N;
+		}
+	}
+}
+
+
+
+void runMvt(int n, DATA_TYPE POLYBENCH_2D(a, N, N, n, n), DATA_TYPE POLYBENCH_1D(x1, N, n), DATA_TYPE POLYBENCH_1D(x2, N, n), DATA_TYPE POLYBENCH_1D(y1, N, n), DATA_TYPE POLYBENCH_1D(y2, N, n))
+{
+	int i, j;
+	
+
+	for (i=0; i<_PB_N; i++) 
+	{
+		for (j=0; j<N; j++) 
+		{
+       		x1[i] = x1[i] + a[i][j] * y1[j];
+        	}
+    	}
+	
+
+	for (i=0; i<_PB_N; i++) 
+	{
+		for (j=0; j<_PB_N; j++) 
+		{
+ 		      	x2[i] = x2[i] + a[j][i] * y2[j];
+      		}
+    	}
+
+
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int n,
+		 DATA_TYPE POLYBENCH_1D(x1,N,n),
+		 DATA_TYPE POLYBENCH_1D(x2,N,n))
+
+{
+  int i;
+
+  for (i = 0; i < n; i++) {
+    fprintf (stderr, DATA_PRINTF_MODIFIER, x1[i]);
+    fprintf (stderr, DATA_PRINTF_MODIFIER, x2[i]);
+    if (i % 20 == 0) fprintf (stderr, "\n");
+  }
+}
+
+
+int main(int argc, char *argv[])
+{
+	int n = N;
+
+	POLYBENCH_2D_ARRAY_DECL(a,DATA_TYPE,N,N,n,n);
+	POLYBENCH_1D_ARRAY_DECL(x1,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(x2,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(x1_outputFromGpu,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(x2_outputFromGpu,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(y_1,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(y_2,DATA_TYPE,N,n);
+
+	init_array(n, POLYBENCH_ARRAY(a), POLYBENCH_ARRAY(x1), POLYBENCH_ARRAY(x2), POLYBENCH_ARRAY(y_1), POLYBENCH_ARRAY(y_2));
+	
+	//GPU_argv_init();
+
+	//mvtCuda(n, POLYBENCH_ARRAY(a), POLYBENCH_ARRAY(x1), POLYBENCH_ARRAY(x2), POLYBENCH_ARRAY(y_1), POLYBENCH_ARRAY(y_2), POLYBENCH_ARRAY(x1_outputFromGpu), POLYBENCH_ARRAY(x2_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+	
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		//run the algorithm on the CPU
+		runMvt(n, POLYBENCH_ARRAY(a), POLYBENCH_ARRAY(x1), POLYBENCH_ARRAY(x2), POLYBENCH_ARRAY(y_1), POLYBENCH_ARRAY(y_2));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		//compareResults(n, POLYBENCH_ARRAY(x1), POLYBENCH_ARRAY(x1_outputFromGpu), POLYBENCH_ARRAY(x2), POLYBENCH_ARRAY(x2_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(x1_outputFromGpu), POLYBENCH_ARRAY(x2_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+	POLYBENCH_FREE_ARRAY(a);
+	POLYBENCH_FREE_ARRAY(x1);
+	POLYBENCH_FREE_ARRAY(x2);
+	POLYBENCH_FREE_ARRAY(x1_outputFromGpu);
+	POLYBENCH_FREE_ARRAY(x2_outputFromGpu);
+	POLYBENCH_FREE_ARRAY(y_1);
+	POLYBENCH_FREE_ARRAY(y_2);
+
+  	return 0;
+}
+
+#include <polybench.c>

+ 144 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/mvt/mvt.c_backup

@@ -0,0 +1,144 @@
+/**
+ * mvt.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/time.h>
+
+#define POLYBENCH_TIME 1
+
+#include "mvt.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void init_array(int n, DATA_TYPE POLYBENCH_2D(A, N, N, n, n), DATA_TYPE POLYBENCH_1D(x1, N, n), DATA_TYPE POLYBENCH_1D(x2, N, n), DATA_TYPE POLYBENCH_1D(y1, N, n), DATA_TYPE POLYBENCH_1D(y2, N, n))
+{
+	int i, j;
+
+	for (i = 0; i < n; i++)
+	{
+		x1[i] = ((DATA_TYPE) i) / N;
+		x2[i] = ((DATA_TYPE) i + 1) / N;
+		y1[i] = ((DATA_TYPE) i + 3) / N;
+		y2[i] = ((DATA_TYPE) i + 4) / N;
+		for (j = 0; j < n; j++)
+		{
+			A[i][j] = ((DATA_TYPE) i*j) / N;
+		}
+	}
+}
+
+
+
+void runMvt(int n, DATA_TYPE POLYBENCH_2D(a, N, N, n, n), DATA_TYPE POLYBENCH_1D(x1, N, n), DATA_TYPE POLYBENCH_1D(x2, N, n), DATA_TYPE POLYBENCH_1D(y1, N, n), DATA_TYPE POLYBENCH_1D(y2, N, n))
+{
+	int i, j;
+	
+
+	for (i=0; i<_PB_N; i++) 
+	{
+		for (j=0; j<_PB_N; j++) 
+		{
+       		x1[i] = x1[i] + a[i][j] * y1[j];
+        	}
+    	}
+	
+
+	for (i=0; i<_PB_N; i++) 
+	{
+		for (j=0; j<_PB_N; j++) 
+		{
+ 		      	x2[i] = x2[i] + a[j][i] * y2[j];
+      		}
+    	}
+
+
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int n,
+		 DATA_TYPE POLYBENCH_1D(x1,N,n),
+		 DATA_TYPE POLYBENCH_1D(x2,N,n))
+
+{
+  int i;
+
+  for (i = 0; i < n; i++) {
+    fprintf (stderr, DATA_PRINTF_MODIFIER, x1[i]);
+    fprintf (stderr, DATA_PRINTF_MODIFIER, x2[i]);
+    if (i % 20 == 0) fprintf (stderr, "\n");
+  }
+}
+
+
+int main(int argc, char *argv[])
+{
+	int n = N;
+
+	POLYBENCH_2D_ARRAY_DECL(a,DATA_TYPE,N,N,n,n);
+	POLYBENCH_1D_ARRAY_DECL(x1,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(x2,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(x1_outputFromGpu,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(x2_outputFromGpu,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(y_1,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(y_2,DATA_TYPE,N,n);
+
+	init_array(n, POLYBENCH_ARRAY(a), POLYBENCH_ARRAY(x1), POLYBENCH_ARRAY(x2), POLYBENCH_ARRAY(y_1), POLYBENCH_ARRAY(y_2));
+	
+	//GPU_argv_init();
+
+	//mvtCuda(n, POLYBENCH_ARRAY(a), POLYBENCH_ARRAY(x1), POLYBENCH_ARRAY(x2), POLYBENCH_ARRAY(y_1), POLYBENCH_ARRAY(y_2), POLYBENCH_ARRAY(x1_outputFromGpu), POLYBENCH_ARRAY(x2_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+	
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		//run the algorithm on the CPU
+		runMvt(n, POLYBENCH_ARRAY(a), POLYBENCH_ARRAY(x1), POLYBENCH_ARRAY(x2), POLYBENCH_ARRAY(y_1), POLYBENCH_ARRAY(y_2));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		//compareResults(n, POLYBENCH_ARRAY(x1), POLYBENCH_ARRAY(x1_outputFromGpu), POLYBENCH_ARRAY(x2), POLYBENCH_ARRAY(x2_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(x1_outputFromGpu), POLYBENCH_ARRAY(x2_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+	POLYBENCH_FREE_ARRAY(a);
+	POLYBENCH_FREE_ARRAY(x1);
+	POLYBENCH_FREE_ARRAY(x2);
+	POLYBENCH_FREE_ARRAY(x1_outputFromGpu);
+	POLYBENCH_FREE_ARRAY(x2_outputFromGpu);
+	POLYBENCH_FREE_ARRAY(y_1);
+	POLYBENCH_FREE_ARRAY(y_2);
+
+  	return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/linear-algebra/kernels/mvt/mvt.exe


+ 55 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/mvt/mvt.h

@@ -0,0 +1,55 @@
+/**
+ * mvt.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef MVT_CUH
+# define MVT_CUH
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(N)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+#define N 1024
+#  endif
+
+#  ifdef SMALL_DATASET
+#define N 2048
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+#define N 4096
+#  endif
+
+#  ifdef LARGE_DATASET
+#define N 8192
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+#define N 16384
+#  endif
+# endif /* !N */
+
+# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions */
+#define DIM_THREAD_BLOCK_X 32
+#define DIM_THREAD_BLOCK_Y 8
+
+
+#endif /* !MVT*/

+ 5 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/syr2k/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := syr2k.exe
+CUFILES := syr2k.c
+PATH_TO_UTILS := ../../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 159 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/syr2k/syr2k.c

@@ -0,0 +1,159 @@
+/**
+ * syr2k.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/time.h>
+
+#define POLYBENCH_TIME 1
+
+#include "syr2k.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void init_arrays(int ni, int nj,
+		DATA_TYPE *alpha,
+		DATA_TYPE *beta,
+		DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj),
+		DATA_TYPE POLYBENCH_2D(B,NI,NJ,ni,nj),
+		DATA_TYPE POLYBENCH_2D(C,NI,NI,ni,ni))
+{
+	int i, j;
+
+	*alpha = 32412;
+	*beta = 2123;
+	for (i = 0; i < ni; i++)
+	{
+		for (j = 0; j < nj; j++) 
+		{
+			A[i][j] = ((DATA_TYPE) i*j) / ni;
+			B[i][j] = ((DATA_TYPE) i*j) / ni;
+		}
+	}
+	for (i = 0; i < ni; i++)
+	{
+		for (j = 0; j < ni; j++)
+		{
+			C[i][j] = ((DATA_TYPE) i*j) / ni;
+		}
+	}
+}
+
+
+void syr2kCpu(int ni, int nj,
+		  DATA_TYPE alpha,
+		  DATA_TYPE beta,
+		  DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj),
+		  DATA_TYPE POLYBENCH_2D(B,NI,NJ,ni,nj),
+		  DATA_TYPE POLYBENCH_2D(C,NI,NI,ni,ni))
+{
+	int i, j, k;
+
+
+	/*    C := alpha*A*B' + alpha*B*A' + beta*C */
+	for (i = 0; i < _PB_NI; i++)
+	{
+		for (j = 0; j < _PB_NI; j++)
+		{
+			C[i][j] *= beta;
+		}
+	}
+	
+	for (i = 0; i < _PB_NI; i++)
+	{
+		for (j = 0; j < _PB_NI; j++)
+		{
+			for (k = 0; k < _PB_NJ; k++)
+			{
+				C[i][j] += alpha * A[i][k] * B[j][k];
+				C[i][j] += alpha * B[i][k] * A[j][k];
+			}
+		}
+	}
+
+
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int ni, DATA_TYPE POLYBENCH_2D(C,NI,NI,ni,ni))
+{
+  int i, j;
+
+  for (i = 0; i < ni; i++)
+    for (j = 0; j < ni; j++) {
+	fprintf (stderr, DATA_PRINTF_MODIFIER, C[i][j]);
+	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+	/* Retrieve problem size. */
+	int ni = NI;
+	int nj = NJ;
+
+	/* Variable declaration/allocation. */
+	DATA_TYPE alpha;
+	DATA_TYPE beta;
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NI,NJ,ni,nj);
+	POLYBENCH_2D_ARRAY_DECL(B,DATA_TYPE,NI,NJ,ni,nj);
+	POLYBENCH_2D_ARRAY_DECL(C,DATA_TYPE,NI,NI,ni,ni);
+	POLYBENCH_2D_ARRAY_DECL(C_outputFromGpu,DATA_TYPE,NI,NI,ni,ni);
+
+	init_arrays(ni, nj, &alpha, &beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C));
+    
+	//GPU_argv_init();
+	
+	//syr2kCuda(ni, nj, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(C_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+
+		/* Start time for CPU */
+	  	polybench_start_instruments;
+
+		syr2kCpu(ni, nj, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		//compareResults(ni, POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(C_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(ni, POLYBENCH_ARRAY(C_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(B);
+	POLYBENCH_FREE_ARRAY(C);
+	POLYBENCH_FREE_ARRAY(C_outputFromGpu);
+
+  	return 0;
+}
+
+#include <polybench.c>

+ 159 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/syr2k/syr2k.c_backup

@@ -0,0 +1,159 @@
+/**
+ * syr2k.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/time.h>
+
+#define POLYBENCH_TIME 1
+
+#include "syr2k.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void init_arrays(int ni, int nj,
+		DATA_TYPE *alpha,
+		DATA_TYPE *beta,
+		DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj),
+		DATA_TYPE POLYBENCH_2D(B,NI,NJ,ni,nj),
+		DATA_TYPE POLYBENCH_2D(C,NI,NI,ni,ni))
+{
+	int i, j;
+
+	*alpha = 32412;
+	*beta = 2123;
+	for (i = 0; i < ni; i++)
+	{
+		for (j = 0; j < nj; j++) 
+		{
+			A[i][j] = ((DATA_TYPE) i*j) / ni;
+			B[i][j] = ((DATA_TYPE) i*j) / ni;
+		}
+	}
+	for (i = 0; i < ni; i++)
+	{
+		for (j = 0; j < ni; j++)
+		{
+			C[i][j] = ((DATA_TYPE) i*j) / ni;
+		}
+	}
+}
+
+
+void syr2kCpu(int ni, int nj,
+		  DATA_TYPE alpha,
+		  DATA_TYPE beta,
+		  DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj),
+		  DATA_TYPE POLYBENCH_2D(B,NI,NJ,ni,nj),
+		  DATA_TYPE POLYBENCH_2D(C,NI,NI,ni,ni))
+{
+	int i, j, k;
+
+
+	/*    C := alpha*A*B' + alpha*B*A' + beta*C */
+	for (i = 0; i < _PB_NI; i++)
+	{
+		for (j = 0; j < _PB_NI; j++)
+		{
+			C[i][j] *= beta;
+		}
+	}
+	
+	for (i = 0; i < _PB_NI; i++)
+	{
+		for (j = 0; j < _PB_NI; j++)
+		{
+			for (k = 0; k < _PB_NJ; k++)
+			{
+				C[i][j] += alpha * A[i][k] * B[j][k];
+				C[i][j] += alpha * B[i][k] * A[j][k];
+			}
+		}
+	}
+
+
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int ni, DATA_TYPE POLYBENCH_2D(C,NI,NI,ni,ni))
+{
+  int i, j;
+
+  for (i = 0; i < ni; i++)
+    for (j = 0; j < ni; j++) {
+	fprintf (stderr, DATA_PRINTF_MODIFIER, C[i][j]);
+	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+	/* Retrieve problem size. */
+	int ni = NI;
+	int nj = NJ;
+
+	/* Variable declaration/allocation. */
+	DATA_TYPE alpha;
+	DATA_TYPE beta;
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NI,NJ,ni,nj);
+	POLYBENCH_2D_ARRAY_DECL(B,DATA_TYPE,NI,NJ,ni,nj);
+	POLYBENCH_2D_ARRAY_DECL(C,DATA_TYPE,NI,NI,ni,ni);
+	POLYBENCH_2D_ARRAY_DECL(C_outputFromGpu,DATA_TYPE,NI,NI,ni,ni);
+
+	init_arrays(ni, nj, &alpha, &beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C));
+    
+	//GPU_argv_init();
+	
+	//syr2kCuda(ni, nj, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(C_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+
+		/* Start time for CPU */
+	  	polybench_start_instruments;
+
+		syr2kCpu(ni, nj, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(C));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		//compareResults(ni, POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(C_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(ni, POLYBENCH_ARRAY(C_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(B);
+	POLYBENCH_FREE_ARRAY(C);
+	POLYBENCH_FREE_ARRAY(C_outputFromGpu);
+
+  	return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/linear-algebra/kernels/syr2k/syr2k.exe


+ 61 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/syr2k/syr2k.h

@@ -0,0 +1,61 @@
+/**
+ * syr2k.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef SYR2K_H
+# define SYR2K_H
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(NI) && !defined(NJ)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+#define NI 256
+#define NJ 256
+#  endif
+
+#  ifdef SMALL_DATASET
+#define NI 512
+#define NJ 512
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+#define NI 1024
+#define NJ 1024
+#  endif
+
+#  ifdef LARGE_DATASET
+#define NI 2048
+#define NJ 2048
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+#define NI 4096
+#define NJ 4096
+#  endif
+# endif /* !N */
+
+# define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni)
+# define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions */
+#define DIM_THREAD_BLOCK_X 32
+#define DIM_THREAD_BLOCK_Y 8
+
+
+#endif /* !SYR2K*/

+ 5 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/syrk/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := syrk.exe
+CUFILES := syrk.c
+PATH_TO_UTILS := ../../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 150 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/syrk/syrk.c

@@ -0,0 +1,150 @@
+/**
+ * syrk.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/time.h>
+
+#define POLYBENCH_TIME 1
+
+#include "syrk.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void init_arrays(int ni, int nj,
+		DATA_TYPE *alpha,
+		DATA_TYPE *beta,
+		DATA_TYPE POLYBENCH_2D(C,NI,NI,ni,ni),
+		DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj))
+{
+	int i, j;
+
+	*alpha = 32412;
+	*beta = 2123;
+	for (i = 0; i < ni; i++)
+	{
+		for (j = 0; j < nj; j++)
+		{
+			A[i][j] = ((DATA_TYPE) i*j) / ni;
+		}
+	}
+
+	for (i = 0; i < ni; i++)
+	{
+		for (j = 0; j < ni; j++)
+		{
+			C[i][j] = ((DATA_TYPE) i*j) / ni;
+		}
+	}
+}
+
+
+void syrk(int ni, int nj, DATA_TYPE alpha, DATA_TYPE beta, DATA_TYPE POLYBENCH_2D(A, NI, NJ, ni, nj), DATA_TYPE POLYBENCH_2D(C, NI, NI, ni, ni))
+{
+	int i, j, k;
+	
+
+	/*  C := alpha*A*A' + beta*C */
+	for (i = 0; i < _PB_NI; i++)
+	{
+		for (j = 0; j < _PB_NI; j++)
+		{
+			C[i][j] *= beta;
+		}
+	}
+	for (i = 0; i < _PB_NI; i++)
+	{
+		for (j = 0; j < _PB_NI; j++)
+		{
+			for (k = 0; k < _PB_NJ; k++)
+			{
+				C[i][j] += alpha * A[i][k] * A[j][k];
+			}
+		}
+	}
+
+
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int ni, DATA_TYPE POLYBENCH_2D(C,NI,NI,ni,ni))
+{
+  int i, j;
+
+  for (i = 0; i < ni; i++)
+    for (j = 0; j < ni; j++) {
+	fprintf (stderr, DATA_PRINTF_MODIFIER, C[i][j]);
+	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+	/* Retrieve problem size. */
+	int ni = NI;
+	int nj = NJ;
+
+	/* Variable declaration/allocation. */
+	DATA_TYPE alpha;
+	DATA_TYPE beta;
+
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NI,NJ,ni,nj);
+  	POLYBENCH_2D_ARRAY_DECL(C,DATA_TYPE,NI,NI,ni,ni);
+  	POLYBENCH_2D_ARRAY_DECL(C_outputFromGpu,DATA_TYPE,NI,NI,ni,ni);
+
+	init_arrays(ni, nj, &alpha, &beta, POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(A));
+	
+	//GPU_argv_init();	
+	//syrkCuda(ni, nj, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(C_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		syrk(ni, nj, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(C));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+  		polybench_stop_instruments;
+ 		polybench_print_instruments;
+
+		//compareResults(ni, POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(C_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(ni, POLYBENCH_ARRAY(C_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(A);
+  	POLYBENCH_FREE_ARRAY(C);
+	POLYBENCH_FREE_ARRAY(C_outputFromGpu);
+
+	return 0;
+}
+
+#include <polybench.c>

+ 150 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/syrk/syrk.c_backup

@@ -0,0 +1,150 @@
+/**
+ * syrk.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/time.h>
+
+#define POLYBENCH_TIME 1
+
+#include "syrk.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void init_arrays(int ni, int nj,
+		DATA_TYPE *alpha,
+		DATA_TYPE *beta,
+		DATA_TYPE POLYBENCH_2D(C,NI,NI,ni,ni),
+		DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj))
+{
+	int i, j;
+
+	*alpha = 32412;
+	*beta = 2123;
+	for (i = 0; i < ni; i++)
+	{
+		for (j = 0; j < nj; j++)
+		{
+			A[i][j] = ((DATA_TYPE) i*j) / ni;
+		}
+	}
+
+	for (i = 0; i < ni; i++)
+	{
+		for (j = 0; j < ni; j++)
+		{
+			C[i][j] = ((DATA_TYPE) i*j) / ni;
+		}
+	}
+}
+
+
+void syrk(int ni, int nj, DATA_TYPE alpha, DATA_TYPE beta, DATA_TYPE POLYBENCH_2D(A, NI, NJ, ni, nj), DATA_TYPE POLYBENCH_2D(C, NI, NI, ni, ni))
+{
+	int i, j, k;
+	
+
+	/*  C := alpha*A*A' + beta*C */
+	for (i = 0; i < _PB_NI; i++)
+	{
+		for (j = 0; j < _PB_NI; j++)
+		{
+			C[i][j] *= beta;
+		}
+	}
+	for (i = 0; i < _PB_NI; i++)
+	{
+		for (j = 0; j < _PB_NI; j++)
+		{
+			for (k = 0; k < _PB_NJ; k++)
+			{
+				C[i][j] += alpha * A[i][k] * A[j][k];
+			}
+		}
+	}
+
+
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int ni, DATA_TYPE POLYBENCH_2D(C,NI,NI,ni,ni))
+{
+  int i, j;
+
+  for (i = 0; i < ni; i++)
+    for (j = 0; j < ni; j++) {
+	fprintf (stderr, DATA_PRINTF_MODIFIER, C[i][j]);
+	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+	/* Retrieve problem size. */
+	int ni = NI;
+	int nj = NJ;
+
+	/* Variable declaration/allocation. */
+	DATA_TYPE alpha;
+	DATA_TYPE beta;
+
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NI,NJ,ni,nj);
+  	POLYBENCH_2D_ARRAY_DECL(C,DATA_TYPE,NI,NI,ni,ni);
+  	POLYBENCH_2D_ARRAY_DECL(C_outputFromGpu,DATA_TYPE,NI,NI,ni,ni);
+
+	init_arrays(ni, nj, &alpha, &beta, POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(A));
+	
+	//GPU_argv_init();	
+	//syrkCuda(ni, nj, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(C_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		syrk(ni, nj, alpha, beta, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(C));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+  		polybench_stop_instruments;
+ 		polybench_print_instruments;
+
+		//compareResults(ni, POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(C_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(ni, POLYBENCH_ARRAY(C_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(A);
+  	POLYBENCH_FREE_ARRAY(C);
+	POLYBENCH_FREE_ARRAY(C_outputFromGpu);
+
+	return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/linear-algebra/kernels/syrk/syrk.exe


+ 61 - 0
real-life-dataset/polybench/CPU/linear-algebra/kernels/syrk/syrk.h

@@ -0,0 +1,61 @@
+/**
+ * syrk.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef SYRK_H
+# define SYRK_H
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(NI) && !defined(NJ)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+#define NI 256
+#define NJ 256
+#  endif
+
+#  ifdef SMALL_DATASET
+#define NI 512
+#define NJ 512
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+#define NI 1024
+#define NJ 1024
+#  endif
+
+#  ifdef LARGE_DATASET
+#define NI 2048
+#define NJ 2048
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+#define NI 4096
+#define NJ 4096
+#  endif
+# endif /* !N */
+
+# define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni)
+# define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions */
+#define DIM_THREAD_BLOCK_X 32
+#define DIM_THREAD_BLOCK_Y 8
+
+
+#endif /* !SYRK*/

+ 5 - 0
real-life-dataset/polybench/CPU/linear-algebra/solvers/gramschmidt/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := gramschmidt.exe -lm
+CUFILES := gramschmidt.c
+PATH_TO_UTILS := ../../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 159 - 0
real-life-dataset/polybench/CPU/linear-algebra/solvers/gramschmidt/gramschmidt.c

@@ -0,0 +1,159 @@
+/**
+ * gramschmidt.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <math.h>
+
+#define POLYBENCH_TIME 1
+
+#include "gramschmidt.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void gramschmidt(int ni, int nj, DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj), DATA_TYPE POLYBENCH_2D(R,NJ,NJ,nj,nj), DATA_TYPE POLYBENCH_2D(Q,NI,NJ,ni,nj))
+{
+	int i,j,k;
+	DATA_TYPE nrm;
+	for (k = 0; k < _PB_NJ; k++)
+	{
+
+
+		nrm = 0;
+		for (i = 0; i < _PB_NI; i++)
+		{
+			nrm += A[i][k] * A[i][k];
+		}
+		
+
+		R[k][k] = sqrt(nrm);
+		for (i = 0; i < _PB_NI; i++)
+		{
+			Q[i][k] = A[i][k] / R[k][k];
+		}
+		
+
+		for (j = k + 1; j < _PB_NJ; j++)
+		{
+			R[k][j] = 0;
+			for (i = 0; i < _PB_NI; i++)
+			{
+				R[k][j] += Q[i][k] * A[i][j];
+			}
+			for (i = 0; i < _PB_NI; i++)
+			{
+				A[i][j] = A[i][j] - Q[i][k] * R[k][j];
+			}
+		}
+
+	}
+}
+
+/* Array initialization. */
+void init_array(int ni, int nj,
+		DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj),
+		DATA_TYPE POLYBENCH_2D(R,NJ,NJ,nj,nj),
+		DATA_TYPE POLYBENCH_2D(Q,NI,NJ,ni,nj))
+{
+	int i, j;
+
+	for (i = 0; i < ni; i++)
+	{
+		for (j = 0; j < nj; j++) 
+		{
+			A[i][j] = ((DATA_TYPE) i*j) / ni;
+			Q[i][j] = ((DATA_TYPE) i*(j+1)) / nj;
+		}
+	}
+
+	for (i = 0; i < nj; i++)
+	{
+		for (j = 0; j < nj; j++)
+		{
+			R[i][j] = ((DATA_TYPE) i*(j+2)) / nj;
+		}
+	}
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int ni, int nj, DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj))
+{
+  int i, j;
+
+  for (i = 0; i < ni; i++)
+    for (j = 0; j < nj; j++) {
+	fprintf (stderr, DATA_PRINTF_MODIFIER, A[i][j]);
+	if (i % 20 == 0) fprintf (stderr, "\n");
+    }
+
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+	/* Retrieve problem size. */
+	int ni = NI;
+	int nj = NJ;
+
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NI,NJ,ni,nj);
+  	POLYBENCH_2D_ARRAY_DECL(A_outputFromGpu,DATA_TYPE,NI,NJ,ni,nj);
+	POLYBENCH_2D_ARRAY_DECL(R,DATA_TYPE,NJ,NJ,nj,nj);
+	POLYBENCH_2D_ARRAY_DECL(Q,DATA_TYPE,NI,NJ,ni,nj);
+	
+	init_array(ni, nj, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(R), POLYBENCH_ARRAY(Q));
+	
+	//GPU_argv_init();
+
+	//gramschmidtCuda(ni, nj, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(R), POLYBENCH_ARRAY(Q), POLYBENCH_ARRAY(A_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+	
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		gramschmidt(ni, nj, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(R), POLYBENCH_ARRAY(Q));
+
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		//compareResults(ni, nj, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(A_outputFromGpu));
+	
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(ni, nj, POLYBENCH_ARRAY(A_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(A_outputFromGpu);
+	POLYBENCH_FREE_ARRAY(R);
+	POLYBENCH_FREE_ARRAY(Q);  
+
+    return 0;
+}
+
+#include <polybench.c>

+ 159 - 0
real-life-dataset/polybench/CPU/linear-algebra/solvers/gramschmidt/gramschmidt.c_backup

@@ -0,0 +1,159 @@
+/**
+ * gramschmidt.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <math.h>
+
+#define POLYBENCH_TIME 1
+
+#include "gramschmidt.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void gramschmidt(int ni, int nj, DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj), DATA_TYPE POLYBENCH_2D(R,NJ,NJ,nj,nj), DATA_TYPE POLYBENCH_2D(Q,NI,NJ,ni,nj))
+{
+	int i,j,k;
+	DATA_TYPE nrm;
+	for (k = 0; k < _PB_NJ; k++)
+	{
+
+
+		nrm = 0;
+		for (i = 0; i < _PB_NI; i++)
+		{
+			nrm += A[i][k] * A[i][k];
+		}
+		
+
+		R[k][k] = sqrt(nrm);
+		for (i = 0; i < _PB_NI; i++)
+		{
+			Q[i][k] = A[i][k] / R[k][k];
+		}
+		
+
+		for (j = k + 1; j < _PB_NJ; j++)
+		{
+			R[k][j] = 0;
+			for (i = 0; i < _PB_NI; i++)
+			{
+				R[k][j] += Q[i][k] * A[i][j];
+			}
+			for (i = 0; i < _PB_NI; i++)
+			{
+				A[i][j] = A[i][j] - Q[i][k] * R[k][j];
+			}
+		}
+
+	}
+}
+
+/* Array initialization. */
+void init_array(int ni, int nj,
+		DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj),
+		DATA_TYPE POLYBENCH_2D(R,NJ,NJ,nj,nj),
+		DATA_TYPE POLYBENCH_2D(Q,NI,NJ,ni,nj))
+{
+	int i, j;
+
+	for (i = 0; i < ni; i++)
+	{
+		for (j = 0; j < nj; j++) 
+		{
+			A[i][j] = ((DATA_TYPE) i*j) / ni;
+			Q[i][j] = ((DATA_TYPE) i*(j+1)) / nj;
+		}
+	}
+
+	for (i = 0; i < nj; i++)
+	{
+		for (j = 0; j < nj; j++)
+		{
+			R[i][j] = ((DATA_TYPE) i*(j+2)) / nj;
+		}
+	}
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int ni, int nj, DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj))
+{
+  int i, j;
+
+  for (i = 0; i < ni; i++)
+    for (j = 0; j < nj; j++) {
+	fprintf (stderr, DATA_PRINTF_MODIFIER, A[i][j]);
+	if (i % 20 == 0) fprintf (stderr, "\n");
+    }
+
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+	/* Retrieve problem size. */
+	int ni = NI;
+	int nj = NJ;
+
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NI,NJ,ni,nj);
+  	POLYBENCH_2D_ARRAY_DECL(A_outputFromGpu,DATA_TYPE,NI,NJ,ni,nj);
+	POLYBENCH_2D_ARRAY_DECL(R,DATA_TYPE,NJ,NJ,nj,nj);
+	POLYBENCH_2D_ARRAY_DECL(Q,DATA_TYPE,NI,NJ,ni,nj);
+	
+	init_array(ni, nj, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(R), POLYBENCH_ARRAY(Q));
+	
+	//GPU_argv_init();
+
+	//gramschmidtCuda(ni, nj, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(R), POLYBENCH_ARRAY(Q), POLYBENCH_ARRAY(A_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+	
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		gramschmidt(ni, nj, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(R), POLYBENCH_ARRAY(Q));
+
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		//compareResults(ni, nj, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(A_outputFromGpu));
+	
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(ni, nj, POLYBENCH_ARRAY(A_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(A_outputFromGpu);
+	POLYBENCH_FREE_ARRAY(R);
+	POLYBENCH_FREE_ARRAY(Q);  
+
+    return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/linear-algebra/solvers/gramschmidt/gramschmidt.exe


+ 60 - 0
real-life-dataset/polybench/CPU/linear-algebra/solvers/gramschmidt/gramschmidt.h

@@ -0,0 +1,60 @@
+/**
+ * gramschmidt.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef GRAMSCHMIDT_CUH
+# define GRAMSCHMIDT_CUH
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(NI) && !defined(NJ)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+#define NI 512
+#define NJ 512
+#  endif
+
+#  ifdef SMALL_DATASET
+#define NI 1024
+#define NJ 1024
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+#define NI 2048
+#define NJ 2048
+#  endif
+
+#  ifdef LARGE_DATASET
+#define NI 4096
+#define NJ 4096
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+#define NI 8192
+#define NJ 8192
+#  endif
+# endif /* !N */
+
+# define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni)
+# define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions */
+#define DIM_THREAD_BLOCK_X 256
+#define DIM_THREAD_BLOCK_Y 1
+
+#endif /* !GRAMSCHMIDT*/

+ 5 - 0
real-life-dataset/polybench/CPU/linear-algebra/solvers/lu/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := lu.exe
+CUFILES := lu.cu
+PATH_TO_UTILS := ../../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 216 - 0
real-life-dataset/polybench/CPU/linear-algebra/solvers/lu/lu.cu

@@ -0,0 +1,216 @@
+/**
+ * lu.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define POLYBENCH_TIME 1
+
+#include "lu.cuh"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void lu(int n, DATA_TYPE POLYBENCH_2D(A,N,N,n,n))
+{
+	for (int k = 0; k < _PB_N; k++)
+    {
+		for (int j = k + 1; j < _PB_N; j++)
+		{
+			A[k][j] = A[k][j] / A[k][k];
+		}
+
+		for (int i = k + 1; i < _PB_N; i++)
+		{
+			for (int j = k + 1; j < _PB_N; j++)
+			{
+				A[i][j] = A[i][j] - A[i][k] * A[k][j];
+			}
+		}
+    }
+}
+
+
+void init_array(int n, DATA_TYPE POLYBENCH_2D(A,N,N,n,n))
+{
+	int i, j;
+
+	for (i = 0; i < n; i++)
+	{
+		for (j = 0; j < n; j++)
+		{
+			A[i][j] = ((DATA_TYPE) i*j + 1) / N;
+		}
+	}
+}
+
+
+void compareResults(int n, DATA_TYPE POLYBENCH_2D(A_cpu,N,N,n,n), DATA_TYPE POLYBENCH_2D(A_outputFromGpu,N,N,n,n))
+{
+	int i, j, fail;
+	fail = 0;
+	
+	// Compare a and b
+	for (i=0; i<n; i++) 
+	{
+		for (j=0; j<n; j++) 
+		{
+			if (percentDiff(A_cpu[i][j], A_outputFromGpu[i][j]) > PERCENT_DIFF_ERROR_THRESHOLD) 
+			{
+				fail++;
+			}
+		}
+	}
+	
+	// Print results
+	printf("Non-Matching CPU-GPU Outputs Beyond Error Threshold of %4.2f Percent: %d\n", PERCENT_DIFF_ERROR_THRESHOLD, fail);
+}
+
+
+void GPU_argv_init()
+{
+	cudaDeviceProp deviceProp;
+	cudaGetDeviceProperties(&deviceProp, GPU_DEVICE);
+	printf("setting device %d with name %s\n",GPU_DEVICE,deviceProp.name);
+	cudaSetDevice( GPU_DEVICE );
+}
+
+
+__global__ void lu_kernel1(int n, DATA_TYPE *A, int k)
+{
+	int j = blockIdx.x * blockDim.x + threadIdx.x;
+	
+	if ((j > k) && (j < _PB_N))
+	{
+		A[k*N + j] = A[k*N + j] / A[k*N + k];
+	}
+}
+
+
+__global__ void lu_kernel2(int n, DATA_TYPE *A, int k)
+{
+	int j = blockIdx.x * blockDim.x + threadIdx.x;
+	int i = blockIdx.y * blockDim.y + threadIdx.y;
+	
+	if ((i > k) && (j > k) && (i < _PB_N) && (j < _PB_N))
+	{
+		A[i*N + j] = A[i*N + j] - A[i*N + k] * A[k*N + j];
+	}
+}
+
+
+void luCuda(int n, DATA_TYPE POLYBENCH_2D(A,N,N,n,n), DATA_TYPE POLYBENCH_2D(A_outputFromGpu,N,N,n,n))
+{
+	DATA_TYPE* AGpu;
+
+	cudaMalloc(&AGpu, N * N * sizeof(DATA_TYPE));
+	cudaMemcpy(AGpu, A, N * N * sizeof(DATA_TYPE), cudaMemcpyHostToDevice);
+
+	dim3 block1(DIM_THREAD_BLOCK_KERNEL_1_X, DIM_THREAD_BLOCK_KERNEL_1_Y);
+	dim3 block2(DIM_THREAD_BLOCK_KERNEL_2_X, DIM_THREAD_BLOCK_KERNEL_2_Y);
+	dim3 grid1(1, 1, 1);
+	dim3 grid2(1, 1, 1);
+
+	/* Start timer. */
+  	polybench_start_instruments;
+
+	for (int k = 0; k < N; k++)
+	{
+		grid1.x = (unsigned int)(ceil((float)(N - (k + 1)) / ((float)block1.x)));
+		lu_kernel1<<<grid1, block1>>>(n, AGpu, k);
+		cudaThreadSynchronize();
+
+		grid2.x = (unsigned int)(ceil((float)(N - (k + 1)) / ((float)block2.x)));
+		grid2.y = (unsigned int)(ceil((float)(N - (k + 1)) / ((float)block2.y)));
+		lu_kernel2<<<grid2, block2>>>(n, AGpu, k);
+		cudaThreadSynchronize();
+	}
+	
+	/* Stop and print timer. */
+	printf("GPU Time in seconds:\n");
+  	polybench_stop_instruments;
+ 	polybench_print_instruments;
+
+	cudaMemcpy(A_outputFromGpu, AGpu, N * N * sizeof(DATA_TYPE), cudaMemcpyDeviceToHost);
+	cudaFree(AGpu);
+}
+
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int n,
+		 DATA_TYPE POLYBENCH_2D(A,N,N,n,n))
+
+{
+  int i, j;
+
+  for (i = 0; i < n; i++)
+    for (j = 0; j < n; j++) {
+      fprintf (stderr, DATA_PRINTF_MODIFIER, A[i][j]);
+      if ((i * n + j) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+	
+
+int main(int argc, char *argv[])
+{
+	int n = N;
+
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,N,N,n,n);
+  	POLYBENCH_2D_ARRAY_DECL(A_outputFromGpu,DATA_TYPE,N,N,n,n);
+
+	init_array(n, POLYBENCH_ARRAY(A));
+
+	GPU_argv_init();
+	luCuda(n, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(A_outputFromGpu));
+	
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		lu(n, POLYBENCH_ARRAY(A));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		compareResults(n, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(A_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(A_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(A_outputFromGpu);
+
+   	return 0;
+}
+
+#include <polybench.c>

+ 59 - 0
real-life-dataset/polybench/CPU/linear-algebra/solvers/lu/lu.cuh

@@ -0,0 +1,59 @@
+/**
+ * lu.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef LU_CUH
+# define LU_CUH
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(N)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+#define N 512
+#  endif
+
+#  ifdef SMALL_DATASET
+#define N 1024
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+#define N 2048
+#  endif
+
+#  ifdef LARGE_DATASET
+#define N 4096
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+#define N 8192
+#  endif
+# endif /* !N */
+
+# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions for kernel 1 */
+#define DIM_THREAD_BLOCK_KERNEL_1_X 256
+#define DIM_THREAD_BLOCK_KERNEL_1_Y 1
+
+/* Thread block dimensions for kernel 2 */
+#define DIM_THREAD_BLOCK_KERNEL_2_X 32
+#define DIM_THREAD_BLOCK_KERNEL_2_Y 8
+
+
+#endif /* !LU*/

+ 5 - 0
real-life-dataset/polybench/CPU/stencils/adi/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := adi.exe
+CUFILES := adi.c
+PATH_TO_UTILS := ../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 169 - 0
real-life-dataset/polybench/CPU/stencils/adi/adi.c

@@ -0,0 +1,169 @@
+/**
+ * adi.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define POLYBENCH_TIME 1
+
+#include "adi.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 2.5
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void adi(int tsteps, int n, DATA_TYPE POLYBENCH_2D(A,N,N,n,n), DATA_TYPE POLYBENCH_2D(B,N,N,n,n), DATA_TYPE POLYBENCH_2D(X,N,N,n,n))
+{
+
+	
+	for (int t = 0; t < _PB_TSTEPS; t++)
+    	{
+    		for (int i1 = 0; i1 < _PB_N; i1++)
+		{
+			for (int i2 = 1; i2 < _PB_N; i2++)
+			{
+				X[i1][i2] = X[i1][i2] - X[i1][(i2-1)] * A[i1][i2] / B[i1][(i2-1)];
+				B[i1][i2] = B[i1][i2] - A[i1][i2] * A[i1][i2] / B[i1][(i2-1)];
+			}
+		}
+
+	   	for (int i1 = 0; i1 < _PB_N; i1++)
+		{
+			X[i1][(N-1)] = X[i1][(N-1)] / B[i1][(N-1)];
+		}
+
+	   	for (int i1 = 0; i1 < _PB_N; i1++)
+		{
+			for (int i2 = 0; i2 < _PB_N-2; i2++)
+			{
+				X[i1][(N-i2-2)] = (X[i1][(N-2-i2)] - X[i1][(N-2-i2-1)] * A[i1][(N-i2-3)]) / B[i1][(N-3-i2)];
+			}
+		}
+
+	   	for (int i1 = 1; i1 < _PB_N; i1++)
+		{
+			for (int i2 = 0; i2 < _PB_N; i2++) 
+			{
+		  		X[i1][i2] = X[i1][i2] - X[(i1-1)][i2] * A[i1][i2] / B[(i1-1)][i2];
+		  		B[i1][i2] = B[i1][i2] - A[i1][i2] * A[i1][i2] / B[(i1-1)][i2];
+			}
+		}
+
+	   	for (int i2 = 0; i2 < _PB_N; i2++)
+		{
+			X[(N-1)][i2] = X[(N-1)][i2] / B[(N-1)][i2];
+		}
+
+	   	for (int i1 = 0; i1 < _PB_N-2; i1++)
+		{
+			for (int i2 = 0; i2 < _PB_N; i2++)
+			{
+		 	 	X[(N-2-i1)][i2] = (X[(N-2-i1)][i2] - X[(N-i1-3)][i2] * A[(N-3-i1)][i2]) / B[(N-2-i1)][i2];
+			}
+		}}
+
+
+    
+}
+
+
+void init_array(int n, DATA_TYPE POLYBENCH_2D(A,N,N,n,n), DATA_TYPE POLYBENCH_2D(B,N,N,n,n), DATA_TYPE POLYBENCH_2D(X,N,N,n,n))
+{
+  	int i, j;
+
+  	for (i = 0; i < n; i++)
+	{
+    		for (j = 0; j < n; j++)
+      		{
+			X[i][j] = ((DATA_TYPE) i*(j+1) + 1) / N;
+			A[i][j] = ((DATA_TYPE) (i-1)*(j+4) + 2) / N;
+			B[i][j] = ((DATA_TYPE) (i+3)*(j+7) + 3) / N;
+      		}
+	}
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int n,
+		 DATA_TYPE POLYBENCH_2D(X,N,N,n,n))
+
+{
+  int i, j;
+
+  for (i = 0; i < n; i++)
+    for (j = 0; j < n; j++) {
+      fprintf(stderr, DATA_PRINTF_MODIFIER, X[i][j]);
+      if ((i * N + j) % 20 == 0) fprintf(stderr, "\n");
+    }
+  fprintf(stderr, "\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+	int tsteps = TSTEPS;
+	int n = N;
+
+	//GPU_argv_init();
+
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,N,N,n,n);
+	POLYBENCH_2D_ARRAY_DECL(B,DATA_TYPE,N,N,n,n);
+	POLYBENCH_2D_ARRAY_DECL(B_outputFromGpu,DATA_TYPE,N,N,n,n);
+	POLYBENCH_2D_ARRAY_DECL(X,DATA_TYPE,N,N,n,n);
+	POLYBENCH_2D_ARRAY_DECL(X_outputFromGpu,DATA_TYPE,N,N,n,n);
+
+	init_array(n, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(X));
+
+	//adiCuda(tsteps, n, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(X), POLYBENCH_ARRAY(B_outputFromGpu), 
+	//	POLYBENCH_ARRAY(X_outputFromGpu));
+	
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		adi(tsteps, n, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(X));
+	
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		//compareResults(n, POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(B_outputFromGpu), POLYBENCH_ARRAY(X), POLYBENCH_ARRAY(X_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(X_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(B);
+	POLYBENCH_FREE_ARRAY(B_outputFromGpu);
+	POLYBENCH_FREE_ARRAY(X);
+	POLYBENCH_FREE_ARRAY(X_outputFromGpu);
+
+	return 0;
+}
+
+#include <polybench.c>

+ 169 - 0
real-life-dataset/polybench/CPU/stencils/adi/adi.c_backup

@@ -0,0 +1,169 @@
+/**
+ * adi.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define POLYBENCH_TIME 1
+
+#include "adi.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 2.5
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void adi(int tsteps, int n, DATA_TYPE POLYBENCH_2D(A,N,N,n,n), DATA_TYPE POLYBENCH_2D(B,N,N,n,n), DATA_TYPE POLYBENCH_2D(X,N,N,n,n))
+{
+
+	
+	for (int t = 0; t < _PB_TSTEPS; t++)
+    	{
+    		for (int i1 = 0; i1 < _PB_N; i1++)
+		{
+			for (int i2 = 1; i2 < _PB_N; i2++)
+			{
+				X[i1][i2] = X[i1][i2] - X[i1][(i2-1)] * A[i1][i2] / B[i1][(i2-1)];
+				B[i1][i2] = B[i1][i2] - A[i1][i2] * A[i1][i2] / B[i1][(i2-1)];
+			}
+		}
+
+	   	for (int i1 = 0; i1 < _PB_N; i1++)
+		{
+			X[i1][(N-1)] = X[i1][(N-1)] / B[i1][(N-1)];
+		}
+
+	   	for (int i1 = 0; i1 < _PB_N; i1++)
+		{
+			for (int i2 = 0; i2 < _PB_N-2; i2++)
+			{
+				X[i1][(N-i2-2)] = (X[i1][(N-2-i2)] - X[i1][(N-2-i2-1)] * A[i1][(N-i2-3)]) / B[i1][(N-3-i2)];
+			}
+		}
+
+	   	for (int i1 = 1; i1 < _PB_N; i1++)
+		{
+			for (int i2 = 0; i2 < _PB_N; i2++) 
+			{
+		  		X[i1][i2] = X[i1][i2] - X[(i1-1)][i2] * A[i1][i2] / B[(i1-1)][i2];
+		  		B[i1][i2] = B[i1][i2] - A[i1][i2] * A[i1][i2] / B[(i1-1)][i2];
+			}
+		}
+
+	   	for (int i2 = 0; i2 < _PB_N; i2++)
+		{
+			X[(N-1)][i2] = X[(N-1)][i2] / B[(N-1)][i2];
+		}
+
+	   	for (int i1 = 0; i1 < _PB_N-2; i1++)
+		{
+			for (int i2 = 0; i2 < _PB_N; i2++)
+			{
+		 	 	X[(N-2-i1)][i2] = (X[(N-2-i1)][i2] - X[(N-i1-3)][i2] * A[(N-3-i1)][i2]) / B[(N-2-i1)][i2];
+			}
+		}}
+
+
+    
+}
+
+
+void init_array(int n, DATA_TYPE POLYBENCH_2D(A,N,N,n,n), DATA_TYPE POLYBENCH_2D(B,N,N,n,n), DATA_TYPE POLYBENCH_2D(X,N,N,n,n))
+{
+  	int i, j;
+
+  	for (i = 0; i < n; i++)
+	{
+    		for (j = 0; j < n; j++)
+      		{
+			X[i][j] = ((DATA_TYPE) i*(j+1) + 1) / N;
+			A[i][j] = ((DATA_TYPE) (i-1)*(j+4) + 2) / N;
+			B[i][j] = ((DATA_TYPE) (i+3)*(j+7) + 3) / N;
+      		}
+	}
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int n,
+		 DATA_TYPE POLYBENCH_2D(X,N,N,n,n))
+
+{
+  int i, j;
+
+  for (i = 0; i < n; i++)
+    for (j = 0; j < n; j++) {
+      fprintf(stderr, DATA_PRINTF_MODIFIER, X[i][j]);
+      if ((i * N + j) % 20 == 0) fprintf(stderr, "\n");
+    }
+  fprintf(stderr, "\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+	int tsteps = TSTEPS;
+	int n = N;
+
+	//GPU_argv_init();
+
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,N,N,n,n);
+	POLYBENCH_2D_ARRAY_DECL(B,DATA_TYPE,N,N,n,n);
+	POLYBENCH_2D_ARRAY_DECL(B_outputFromGpu,DATA_TYPE,N,N,n,n);
+	POLYBENCH_2D_ARRAY_DECL(X,DATA_TYPE,N,N,n,n);
+	POLYBENCH_2D_ARRAY_DECL(X_outputFromGpu,DATA_TYPE,N,N,n,n);
+
+	init_array(n, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(X));
+
+	//adiCuda(tsteps, n, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(X), POLYBENCH_ARRAY(B_outputFromGpu), 
+	//	POLYBENCH_ARRAY(X_outputFromGpu));
+	
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		adi(tsteps, n, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(X));
+	
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		//compareResults(n, POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(B_outputFromGpu), POLYBENCH_ARRAY(X), POLYBENCH_ARRAY(X_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(X_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(B);
+	POLYBENCH_FREE_ARRAY(B_outputFromGpu);
+	POLYBENCH_FREE_ARRAY(X);
+	POLYBENCH_FREE_ARRAY(X_outputFromGpu);
+
+	return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/stencils/adi/adi.exe


+ 61 - 0
real-life-dataset/polybench/CPU/stencils/adi/adi.h

@@ -0,0 +1,61 @@
+/**
+ * adi.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef ADI_CUH
+# define ADI_CUH
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(TSTEPS) && !defined(N)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+#define TSTEPS 1
+#define N 256
+#  endif
+
+#  ifdef SMALL_DATASET
+#define TSTEPS 1
+#define N 512
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+#define TSTEPS 1
+#define N 1024
+#  endif
+
+#  ifdef LARGE_DATASET
+#define TSTEPS 1
+#define N 2048
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+#define TSTEPS 1
+#define N 4096
+#  endif
+# endif /* !N */
+
+# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
+# define _PB_TSTEPS POLYBENCH_LOOP_BOUND(TSTEPS,tsteps)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions */
+#define DIM_THREAD_BLOCK_X 256
+#define DIM_THREAD_BLOCK_Y 1
+
+
+#endif /* !ADI*/

+ 134 - 0
real-life-dataset/polybench/CPU/stencils/convolution-2d/2DConvolution.c

@@ -0,0 +1,134 @@
+/**
+ * 2DConvolution.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define POLYBENCH_TIME 1
+
+#include "2DConvolution.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void conv2D(int ni, int nj, DATA_TYPE POLYBENCH_2D(A, NI, NJ, ni, nj), DATA_TYPE POLYBENCH_2D(B, NI, NJ, ni, nj))
+{
+	int i, j;
+	DATA_TYPE c11, c12, c13, c21, c22, c23, c31, c32, c33;
+
+
+	c11 = +0.2;  c21 = +0.5;  c31 = -0.8;
+	c12 = -0.3;  c22 = +0.6;  c32 = -0.9;
+	c13 = +0.4;  c23 = +0.7;  c33 = +0.10;
+
+
+	for (i = 1; i < _PB_NI - 1; ++i) // 0
+	{
+		for (j = 1; j < _PB_NJ - 1; ++j) // 1
+		{
+			B[i][j] = c11 * A[(i - 1)][(j - 1)]  +  c12 * A[(i + 0)][(j - 1)]  +  c13 * A[(i + 1)][(j - 1)]
+				+ c21 * A[(i - 1)][(j + 0)]  +  c22 * A[(i + 0)][(j + 0)]  +  c23 * A[(i + 1)][(j + 0)] 
+				+ c31 * A[(i - 1)][(j + 1)]  +  c32 * A[(i + 0)][(j + 1)]  +  c33 * A[(i + 1)][(j + 1)];
+		}
+	}
+
+
+}
+
+
+
+void init(int ni, int nj, DATA_TYPE POLYBENCH_2D(A, NI, NJ, ni, nj))
+{
+	int i, j;
+
+	for (i = 0; i < ni; ++i)
+    	{
+		for (j = 0; j < nj; ++j)
+		{
+			A[i][j] = (float)rand()/RAND_MAX;
+        	}
+    	}
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int ni, int nj,
+		 DATA_TYPE POLYBENCH_2D(B,NI,NJ,ni,nj))
+{
+  int i, j;
+
+  for (i = 0; i < ni; i++)
+    for (j = 0; j < nj; j++) {
+	fprintf (stderr, DATA_PRINTF_MODIFIER, B[i][j]);
+	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+	/* Retrieve problem size */
+	int ni = NI;
+	int nj = NJ;
+
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NI,NJ,ni,nj);
+  	POLYBENCH_2D_ARRAY_DECL(B,DATA_TYPE,NI,NJ,ni,nj);
+  	POLYBENCH_2D_ARRAY_DECL(B_outputFromGpu,DATA_TYPE,NI,NJ,ni,nj);
+
+	//initialize the arrays
+	init(ni, nj, POLYBENCH_ARRAY(A));
+	
+	//GPU_argv_init();
+
+	//convolution2DCuda(ni, nj, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(B_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+	
+	 	/* Start timer. */
+	  	polybench_start_instruments;
+
+		conv2D(ni, nj, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		//compareResults(ni, nj, POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(B_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(ni, nj, POLYBENCH_ARRAY(B_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(A);
+  	POLYBENCH_FREE_ARRAY(B);
+	POLYBENCH_FREE_ARRAY(B_outputFromGpu);
+	
+	return 0;
+}
+
+#include <polybench.c>

+ 134 - 0
real-life-dataset/polybench/CPU/stencils/convolution-2d/2DConvolution.c_backup

@@ -0,0 +1,134 @@
+/**
+ * 2DConvolution.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define POLYBENCH_TIME 1
+
+#include "2DConvolution.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void conv2D(int ni, int nj, DATA_TYPE POLYBENCH_2D(A, NI, NJ, ni, nj), DATA_TYPE POLYBENCH_2D(B, NI, NJ, ni, nj))
+{
+	int i, j;
+	DATA_TYPE c11, c12, c13, c21, c22, c23, c31, c32, c33;
+
+
+	c11 = +0.2;  c21 = +0.5;  c31 = -0.8;
+	c12 = -0.3;  c22 = +0.6;  c32 = -0.9;
+	c13 = +0.4;  c23 = +0.7;  c33 = +0.10;
+
+
+	for (i = 1; i < _PB_NI - 1; ++i) // 0
+	{
+		for (j = 1; j < _PB_NJ - 1; ++j) // 1
+		{
+			B[i][j] = c11 * A[(i - 1)][(j - 1)]  +  c12 * A[(i + 0)][(j - 1)]  +  c13 * A[(i + 1)][(j - 1)]
+				+ c21 * A[(i - 1)][(j + 0)]  +  c22 * A[(i + 0)][(j + 0)]  +  c23 * A[(i + 1)][(j + 0)] 
+				+ c31 * A[(i - 1)][(j + 1)]  +  c32 * A[(i + 0)][(j + 1)]  +  c33 * A[(i + 1)][(j + 1)];
+		}
+	}
+
+
+}
+
+
+
+void init(int ni, int nj, DATA_TYPE POLYBENCH_2D(A, NI, NJ, ni, nj))
+{
+	int i, j;
+
+	for (i = 0; i < ni; ++i)
+    	{
+		for (j = 0; j < nj; ++j)
+		{
+			A[i][j] = (float)rand()/RAND_MAX;
+        	}
+    	}
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int ni, int nj,
+		 DATA_TYPE POLYBENCH_2D(B,NI,NJ,ni,nj))
+{
+  int i, j;
+
+  for (i = 0; i < ni; i++)
+    for (j = 0; j < nj; j++) {
+	fprintf (stderr, DATA_PRINTF_MODIFIER, B[i][j]);
+	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+	/* Retrieve problem size */
+	int ni = NI;
+	int nj = NJ;
+
+	POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NI,NJ,ni,nj);
+  	POLYBENCH_2D_ARRAY_DECL(B,DATA_TYPE,NI,NJ,ni,nj);
+  	POLYBENCH_2D_ARRAY_DECL(B_outputFromGpu,DATA_TYPE,NI,NJ,ni,nj);
+
+	//initialize the arrays
+	init(ni, nj, POLYBENCH_ARRAY(A));
+	
+	//GPU_argv_init();
+
+	//convolution2DCuda(ni, nj, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(B_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+	
+	 	/* Start timer. */
+	  	polybench_start_instruments;
+
+		conv2D(ni, nj, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		//compareResults(ni, nj, POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(B_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(ni, nj, POLYBENCH_ARRAY(B_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(A);
+  	POLYBENCH_FREE_ARRAY(B);
+	POLYBENCH_FREE_ARRAY(B_outputFromGpu);
+	
+	return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/stencils/convolution-2d/2DConvolution.exe


+ 61 - 0
real-life-dataset/polybench/CPU/stencils/convolution-2d/2DConvolution.h

@@ -0,0 +1,61 @@
+/**
+ * 2DConvolution.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef TWODCONV_H
+# define TWODCONV_H
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(NI) && !defined(NJ)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+#define NI 1024
+#define NJ 1024
+#  endif
+
+#  ifdef SMALL_DATASET
+#define NI 2048
+#define NJ 2048
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+#define NI 4096
+#define NJ 4096
+#  endif
+
+#  ifdef LARGE_DATASET
+#define NI 8192
+#define NJ 8192
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+#define NI 16384
+#define NJ 16384
+#  endif
+# endif /* !N */
+
+# define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni)
+# define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions */
+#define DIM_THREAD_BLOCK_X 32
+#define DIM_THREAD_BLOCK_Y 8
+
+
+#endif /* !TWODCONV*/

+ 5 - 0
real-life-dataset/polybench/CPU/stencils/convolution-2d/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := 2DConvolution.exe
+CUFILES := 2DConvolution.c
+PATH_TO_UTILS := ../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 143 - 0
real-life-dataset/polybench/CPU/stencils/convolution-3d/3DConvolution.c

@@ -0,0 +1,143 @@
+/**
+ * 3DConvolution.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define POLYBENCH_TIME 1
+
+#include "3DConvolution.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.5
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void conv3D(int ni, int nj, int nk, DATA_TYPE POLYBENCH_3D(A, NI, NJ, NK, ni, nj, nk), DATA_TYPE POLYBENCH_3D(B, NI, NJ, NK, ni, nj, nk))
+{
+	int i, j, k;
+	DATA_TYPE c11, c12, c13, c21, c22, c23, c31, c32, c33;
+
+
+	c11 = +2;  c21 = +5;  c31 = -8;
+	c12 = -3;  c22 = +6;  c32 = -9;
+	c13 = +4;  c23 = +7;  c33 = +10;
+
+	for (i = 1; i < _PB_NI - 1; ++i) // 0
+	{
+		for (j = 1; j < _PB_NJ - 1; ++j) // 1
+		{
+			for (k = 1; k < _PB_NK -1; ++k) // 2
+			{
+				B[i][j][k] = c11 * A[(i - 1)][(j - 1)][(k - 1)]  +  c13 * A[(i + 1)][(j - 1)][(k - 1)]
+					     +   c21 * A[(i - 1)][(j - 1)][(k - 1)]  +  c23 * A[(i + 1)][(j - 1)][(k - 1)]
+					     +   c31 * A[(i - 1)][(j - 1)][(k - 1)]  +  c33 * A[(i + 1)][(j - 1)][(k - 1)]
+					     +   c12 * A[(i + 0)][(j - 1)][(k + 0)]  +  c22 * A[(i + 0)][(j + 0)][(k + 0)]   
+					     +   c32 * A[(i + 0)][(j + 1)][(k + 0)]  +  c11 * A[(i - 1)][(j - 1)][(k + 1)]  
+					     +   c13 * A[(i + 1)][(j - 1)][(k + 1)]  +  c21 * A[(i - 1)][(j + 0)][(k + 1)]  
+					     +   c23 * A[(i + 1)][(j + 0)][(k + 1)]  +  c31 * A[(i - 1)][(j + 1)][(k + 1)]  
+					     +   c33 * A[(i + 1)][(j + 1)][(k + 1)];
+			}
+		}
+	}
+
+
+}
+
+
+void init(int ni, int nj, int nk, DATA_TYPE POLYBENCH_3D(A, NI, NJ, NK, ni, nj, nk))
+{
+	int i, j, k;
+
+	for (i = 0; i < ni; ++i)
+    	{
+		for (j = 0; j < nj; ++j)
+		{
+			for (k = 0; k < nk; ++k)
+			{
+				A[i][j][k] = i % 12 + 2 * (j % 7) + 3 * (k % 13);
+			}
+		}
+	}
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int ni, int nj, int nk,
+		 DATA_TYPE POLYBENCH_3D(B,NI,NJ,NK,ni,nj,nk))
+{
+  int i, j, k;
+
+  for (i = 0; i < ni; i++)
+    for (j = 0; j < nj; j++) 
+	for (k = 0; k < nk; k++)
+	{
+	fprintf (stderr, DATA_PRINTF_MODIFIER, B[i][j][k]);
+	if ((i * (nj*nk) + j*nk + k) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+	int ni = NI;
+	int nj = NJ;
+	int nk = NK;
+
+	POLYBENCH_3D_ARRAY_DECL(A,DATA_TYPE,NI,NJ,NK,ni,nj,nk);
+	POLYBENCH_3D_ARRAY_DECL(B,DATA_TYPE,NI,NJ,NK,ni,nj,nk);
+	POLYBENCH_3D_ARRAY_DECL(B_outputFromGpu,DATA_TYPE,NI,NJ,NK,ni,nj,nk);
+
+	init(ni, nj, nk, POLYBENCH_ARRAY(A));
+	
+	//GPU_argv_init();
+
+	//convolution3DCuda(ni, nj, nk, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(B_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		conv3D(ni, nj, nk, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B));
+
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		//compareResults(ni, nj, nk, POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(B_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(NI, NJ, NK, POLYBENCH_ARRAY(B_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(B);
+	POLYBENCH_FREE_ARRAY(B_outputFromGpu);
+
+    	return 0;
+}
+
+#include <polybench.c>

+ 143 - 0
real-life-dataset/polybench/CPU/stencils/convolution-3d/3DConvolution.c_backup

@@ -0,0 +1,143 @@
+/**
+ * 3DConvolution.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <time.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+#define POLYBENCH_TIME 1
+
+#include "3DConvolution.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.5
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void conv3D(int ni, int nj, int nk, DATA_TYPE POLYBENCH_3D(A, NI, NJ, NK, ni, nj, nk), DATA_TYPE POLYBENCH_3D(B, NI, NJ, NK, ni, nj, nk))
+{
+	int i, j, k;
+	DATA_TYPE c11, c12, c13, c21, c22, c23, c31, c32, c33;
+
+
+	c11 = +2;  c21 = +5;  c31 = -8;
+	c12 = -3;  c22 = +6;  c32 = -9;
+	c13 = +4;  c23 = +7;  c33 = +10;
+
+	for (i = 1; i < _PB_NI - 1; ++i) // 0
+	{
+		for (j = 1; j < _PB_NJ - 1; ++j) // 1
+		{
+			for (k = 1; k < _PB_NK -1; ++k) // 2
+			{
+				B[i][j][k] = c11 * A[(i - 1)][(j - 1)][(k - 1)]  +  c13 * A[(i + 1)][(j - 1)][(k - 1)]
+					     +   c21 * A[(i - 1)][(j - 1)][(k - 1)]  +  c23 * A[(i + 1)][(j - 1)][(k - 1)]
+					     +   c31 * A[(i - 1)][(j - 1)][(k - 1)]  +  c33 * A[(i + 1)][(j - 1)][(k - 1)]
+					     +   c12 * A[(i + 0)][(j - 1)][(k + 0)]  +  c22 * A[(i + 0)][(j + 0)][(k + 0)]   
+					     +   c32 * A[(i + 0)][(j + 1)][(k + 0)]  +  c11 * A[(i - 1)][(j - 1)][(k + 1)]  
+					     +   c13 * A[(i + 1)][(j - 1)][(k + 1)]  +  c21 * A[(i - 1)][(j + 0)][(k + 1)]  
+					     +   c23 * A[(i + 1)][(j + 0)][(k + 1)]  +  c31 * A[(i - 1)][(j + 1)][(k + 1)]  
+					     +   c33 * A[(i + 1)][(j + 1)][(k + 1)];
+			}
+		}
+	}
+
+
+}
+
+
+void init(int ni, int nj, int nk, DATA_TYPE POLYBENCH_3D(A, NI, NJ, NK, ni, nj, nk))
+{
+	int i, j, k;
+
+	for (i = 0; i < ni; ++i)
+    	{
+		for (j = 0; j < nj; ++j)
+		{
+			for (k = 0; k < nk; ++k)
+			{
+				A[i][j][k] = i % 12 + 2 * (j % 7) + 3 * (k % 13);
+			}
+		}
+	}
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int ni, int nj, int nk,
+		 DATA_TYPE POLYBENCH_3D(B,NI,NJ,NK,ni,nj,nk))
+{
+  int i, j, k;
+
+  for (i = 0; i < ni; i++)
+    for (j = 0; j < nj; j++) 
+	for (k = 0; k < nk; k++)
+	{
+	fprintf (stderr, DATA_PRINTF_MODIFIER, B[i][j][k]);
+	if ((i * (nj*nk) + j*nk + k) % 20 == 0) fprintf (stderr, "\n");
+    }
+  fprintf (stderr, "\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+	int ni = NI;
+	int nj = NJ;
+	int nk = NK;
+
+	POLYBENCH_3D_ARRAY_DECL(A,DATA_TYPE,NI,NJ,NK,ni,nj,nk);
+	POLYBENCH_3D_ARRAY_DECL(B,DATA_TYPE,NI,NJ,NK,ni,nj,nk);
+	POLYBENCH_3D_ARRAY_DECL(B_outputFromGpu,DATA_TYPE,NI,NJ,NK,ni,nj,nk);
+
+	init(ni, nj, nk, POLYBENCH_ARRAY(A));
+	
+	//GPU_argv_init();
+
+	//convolution3DCuda(ni, nj, nk, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(B_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		conv3D(ni, nj, nk, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B));
+
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+	
+		//compareResults(ni, nj, nk, POLYBENCH_ARRAY(B), POLYBENCH_ARRAY(B_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(NI, NJ, NK, POLYBENCH_ARRAY(B_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(A);
+	POLYBENCH_FREE_ARRAY(B);
+	POLYBENCH_FREE_ARRAY(B_outputFromGpu);
+
+    	return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/stencils/convolution-3d/3DConvolution.exe


+ 67 - 0
real-life-dataset/polybench/CPU/stencils/convolution-3d/3DConvolution.h

@@ -0,0 +1,67 @@
+/**
+ * 3DConvolution.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef THREEDCONV_H
+# define THREEDCONV_H
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(NI) && !defined(NJ) && !defined(NK)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+#define NI 64
+#define NJ 64
+#define NK 64
+#  endif
+
+#  ifdef SMALL_DATASET
+#define NI 128
+#define NJ 128
+#define NK 128
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+#define NI 256
+#define NJ 256
+#define NK 256
+#  endif
+
+#  ifdef LARGE_DATASET
+#define NI 384
+#define NJ 384
+#define NK 384
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+#define NI 512
+#define NJ 512
+#define NK 512
+#  endif
+# endif /* !N */
+
+# define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni)
+# define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj)
+# define _PB_NK POLYBENCH_LOOP_BOUND(NK,nk)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions */
+#define DIM_THREAD_BLOCK_X 32
+#define DIM_THREAD_BLOCK_Y 8
+
+
+#endif /* !THREEDCONV*/

+ 5 - 0
real-life-dataset/polybench/CPU/stencils/convolution-3d/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := 3DConvolution.exe
+CUFILES := 3DConvolution.c
+PATH_TO_UTILS := ../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 5 - 0
real-life-dataset/polybench/CPU/stencils/fdtd-2d/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := fdtd2d.exe
+CUFILES := fdtd2d.c
+PATH_TO_UTILS := ../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 160 - 0
real-life-dataset/polybench/CPU/stencils/fdtd-2d/fdtd2d.c

@@ -0,0 +1,160 @@
+/**
+ * fdtd2d.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/time.h>
+
+#define POLYBENCH_TIME 1
+
+#include "fdtd2d.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 10.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void init_arrays(int tmax, int nx, int ny, DATA_TYPE POLYBENCH_1D(_fict_, TMAX, TMAX), DATA_TYPE POLYBENCH_2D(ex,NX,NY,nx,ny), 
+		DATA_TYPE POLYBENCH_2D(ey,NX,NY,nx,ny), DATA_TYPE POLYBENCH_2D(hz,NX,NY,nx,ny))
+{
+	int i, j;
+
+  	for (i = 0; i < tmax; i++)
+	{
+		_fict_[i] = (DATA_TYPE) i;
+	}
+	
+	for (i = 0; i < nx; i++)
+	{
+		for (j = 0; j < ny; j++)
+		{
+			ex[i][j] = ((DATA_TYPE) i*(j+1) + 1) / NX;
+			ey[i][j] = ((DATA_TYPE) (i-1)*(j+2) + 2) / NX;
+			hz[i][j] = ((DATA_TYPE) (i-9)*(j+4) + 3) / NX;
+		}
+	}
+}
+
+
+void runFdtd(int tmax, int nx, int ny, DATA_TYPE POLYBENCH_1D(_fict_, TMAX, TMAX), DATA_TYPE POLYBENCH_2D(ex,NX,NY,nx,ny), 
+	DATA_TYPE POLYBENCH_2D(ey,NX,NY,nx,ny), DATA_TYPE POLYBENCH_2D(hz,NX,NY,nx,ny))
+{
+	int t, i, j;
+	
+
+	for (t=0; t < _PB_TMAX; t++)  
+	{
+		for (j=0; j < _PB_NY; j++)
+		{
+			ey[0][j] = _fict_[t];
+		}
+	
+		for (i = 1; i < _PB_NX; i++)
+		{
+       		for (j = 0; j < _PB_NY; j++)
+			{
+       			ey[i][j] = ey[i][j] - 0.5*(hz[i][j] - hz[(i-1)][j]);
+        		}
+		}
+
+		for (i = 0; i < _PB_NX; i++)
+		{
+       		for (j = 1; j < _PB_NY; j++)
+			{
+				ex[i][j] = ex[i][j] - 0.5*(hz[i][j] - hz[i][(j-1)]);
+			}
+		}
+
+		for (i = 0; i < _PB_NX-1; i++)
+		{
+			for (j = 0; j < _PB_NY-1; j++)
+			{
+				hz[i][j] = hz[i][j] - 0.7*(ex[i][(j+1)] - ex[i][j] + ey[(i+1)][j] - ey[i][j]);
+			}
+		}
+	}
+
+	
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int nx,
+		 int ny,
+		 DATA_TYPE POLYBENCH_2D(hz,NX,NY,nx,ny))
+{
+  int i, j;
+
+  for (i = 0; i < nx; i++)
+    for (j = 0; j < ny; j++) {
+         fprintf(stderr, DATA_PRINTF_MODIFIER, hz[i][j]);
+      if ((i * nx + j) % 20 == 0) fprintf(stderr, "\n");
+    }
+  fprintf(stderr, "\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+	int tmax = TMAX;
+	int nx = NX;
+	int ny = NY;
+
+	POLYBENCH_1D_ARRAY_DECL(_fict_,DATA_TYPE,TMAX,TMAX);
+	POLYBENCH_2D_ARRAY_DECL(ex,DATA_TYPE,NX,NY,nx,ny);
+	POLYBENCH_2D_ARRAY_DECL(ey,DATA_TYPE,NX,NY,nx,ny);
+	POLYBENCH_2D_ARRAY_DECL(hz,DATA_TYPE,NX,NY,nx,ny);
+	POLYBENCH_2D_ARRAY_DECL(hz_outputFromGpu,DATA_TYPE,NX,NY,nx,ny);
+
+	init_arrays(tmax, nx, ny, POLYBENCH_ARRAY(_fict_), POLYBENCH_ARRAY(ex), POLYBENCH_ARRAY(ey), POLYBENCH_ARRAY(hz));
+
+	//GPU_argv_init();
+	//fdtdCuda(tmax, nx, ny, POLYBENCH_ARRAY(_fict_), POLYBENCH_ARRAY(ex), POLYBENCH_ARRAY(ey), POLYBENCH_ARRAY(hz), POLYBENCH_ARRAY(hz_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		runFdtd(tmax, nx, ny, POLYBENCH_ARRAY(_fict_), POLYBENCH_ARRAY(ex), POLYBENCH_ARRAY(ey), POLYBENCH_ARRAY(hz));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+		
+		//compareResults(nx, ny, POLYBENCH_ARRAY(hz), POLYBENCH_ARRAY(hz_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(nx, ny, POLYBENCH_ARRAY(hz_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(_fict_);
+	POLYBENCH_FREE_ARRAY(ex);
+	POLYBENCH_FREE_ARRAY(ey);
+	POLYBENCH_FREE_ARRAY(hz);
+	POLYBENCH_FREE_ARRAY(hz_outputFromGpu);
+
+	return 0;
+}
+
+#include <polybench.c>

+ 160 - 0
real-life-dataset/polybench/CPU/stencils/fdtd-2d/fdtd2d.c_backup

@@ -0,0 +1,160 @@
+/**
+ * fdtd2d.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+#include <unistd.h>
+#include <sys/time.h>
+
+#define POLYBENCH_TIME 1
+
+#include "fdtd2d.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 10.05
+
+#define GPU_DEVICE 0
+
+#define RUN_ON_CPU
+
+
+void init_arrays(int tmax, int nx, int ny, DATA_TYPE POLYBENCH_1D(_fict_, TMAX, TMAX), DATA_TYPE POLYBENCH_2D(ex,NX,NY,nx,ny), 
+		DATA_TYPE POLYBENCH_2D(ey,NX,NY,nx,ny), DATA_TYPE POLYBENCH_2D(hz,NX,NY,nx,ny))
+{
+	int i, j;
+
+  	for (i = 0; i < tmax; i++)
+	{
+		_fict_[i] = (DATA_TYPE) i;
+	}
+	
+	for (i = 0; i < nx; i++)
+	{
+		for (j = 0; j < ny; j++)
+		{
+			ex[i][j] = ((DATA_TYPE) i*(j+1) + 1) / NX;
+			ey[i][j] = ((DATA_TYPE) (i-1)*(j+2) + 2) / NX;
+			hz[i][j] = ((DATA_TYPE) (i-9)*(j+4) + 3) / NX;
+		}
+	}
+}
+
+
+void runFdtd(int tmax, int nx, int ny, DATA_TYPE POLYBENCH_1D(_fict_, TMAX, TMAX), DATA_TYPE POLYBENCH_2D(ex,NX,NY,nx,ny), 
+	DATA_TYPE POLYBENCH_2D(ey,NX,NY,nx,ny), DATA_TYPE POLYBENCH_2D(hz,NX,NY,nx,ny))
+{
+	int t, i, j;
+	
+
+	for (t=0; t < _PB_TMAX; t++)  
+	{
+		for (j=0; j < _PB_NY; j++)
+		{
+			ey[0][j] = _fict_[t];
+		}
+	
+		for (i = 1; i < _PB_NX; i++)
+		{
+       		for (j = 0; j < _PB_NY; j++)
+			{
+       			ey[i][j] = ey[i][j] - 0.5*(hz[i][j] - hz[(i-1)][j]);
+        		}
+		}
+
+		for (i = 0; i < _PB_NX; i++)
+		{
+       		for (j = 1; j < _PB_NY; j++)
+			{
+				ex[i][j] = ex[i][j] - 0.5*(hz[i][j] - hz[i][(j-1)]);
+			}
+		}
+
+		for (i = 0; i < _PB_NX-1; i++)
+		{
+			for (j = 0; j < _PB_NY-1; j++)
+			{
+				hz[i][j] = hz[i][j] - 0.7*(ex[i][(j+1)] - ex[i][j] + ey[(i+1)][j] - ey[i][j]);
+			}
+		}
+	}
+
+	
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int nx,
+		 int ny,
+		 DATA_TYPE POLYBENCH_2D(hz,NX,NY,nx,ny))
+{
+  int i, j;
+
+  for (i = 0; i < nx; i++)
+    for (j = 0; j < ny; j++) {
+         fprintf(stderr, DATA_PRINTF_MODIFIER, hz[i][j]);
+      if ((i * nx + j) % 20 == 0) fprintf(stderr, "\n");
+    }
+  fprintf(stderr, "\n");
+}
+
+
+int main(int argc, char *argv[])
+{
+	int tmax = TMAX;
+	int nx = NX;
+	int ny = NY;
+
+	POLYBENCH_1D_ARRAY_DECL(_fict_,DATA_TYPE,TMAX,TMAX);
+	POLYBENCH_2D_ARRAY_DECL(ex,DATA_TYPE,NX,NY,nx,ny);
+	POLYBENCH_2D_ARRAY_DECL(ey,DATA_TYPE,NX,NY,nx,ny);
+	POLYBENCH_2D_ARRAY_DECL(hz,DATA_TYPE,NX,NY,nx,ny);
+	POLYBENCH_2D_ARRAY_DECL(hz_outputFromGpu,DATA_TYPE,NX,NY,nx,ny);
+
+	init_arrays(tmax, nx, ny, POLYBENCH_ARRAY(_fict_), POLYBENCH_ARRAY(ex), POLYBENCH_ARRAY(ey), POLYBENCH_ARRAY(hz));
+
+	//GPU_argv_init();
+	//fdtdCuda(tmax, nx, ny, POLYBENCH_ARRAY(_fict_), POLYBENCH_ARRAY(ex), POLYBENCH_ARRAY(ey), POLYBENCH_ARRAY(hz), POLYBENCH_ARRAY(hz_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+
+		/* Start timer. */
+	  	polybench_start_instruments;
+
+		runFdtd(tmax, nx, ny, POLYBENCH_ARRAY(_fict_), POLYBENCH_ARRAY(ex), POLYBENCH_ARRAY(ey), POLYBENCH_ARRAY(hz));
+
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+		
+		//compareResults(nx, ny, POLYBENCH_ARRAY(hz), POLYBENCH_ARRAY(hz_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(nx, ny, POLYBENCH_ARRAY(hz_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(_fict_);
+	POLYBENCH_FREE_ARRAY(ex);
+	POLYBENCH_FREE_ARRAY(ey);
+	POLYBENCH_FREE_ARRAY(hz);
+	POLYBENCH_FREE_ARRAY(hz_outputFromGpu);
+
+	return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/stencils/fdtd-2d/fdtd2d.exe


+ 67 - 0
real-life-dataset/polybench/CPU/stencils/fdtd-2d/fdtd2d.h

@@ -0,0 +1,67 @@
+/**
+ * fdtd2d.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef FDTD2D_CUH
+# define FDTD2D_CUH
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(TMAX) && !defined(NX) && !defined(NY)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+#define TMAX 500
+#define NX 512
+#define NY 512
+#  endif
+
+#  ifdef SMALL_DATASET
+#define TMAX 500
+#define NX 1024
+#define NY 1024
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+#define TMAX 500
+#define NX 2048
+#define NY 2048
+#  endif
+
+#  ifdef LARGE_DATASET
+#define TMAX 500
+#define NX 4096
+#define NY 4096
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+#define TMAX 500
+#define NX 8192
+#define NY 8192
+#  endif
+# endif /* !N */
+
+# define _PB_TMAX POLYBENCH_LOOP_BOUND(TMAX,tmax)
+# define _PB_NX POLYBENCH_LOOP_BOUND(NX,nx)
+# define _PB_NY POLYBENCH_LOOP_BOUND(NY,ny)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions */
+#define DIM_THREAD_BLOCK_X 32
+#define DIM_THREAD_BLOCK_Y 8
+
+
+#endif /* !FDTD2D*/

+ 5 - 0
real-life-dataset/polybench/CPU/stencils/jacobi-1d-imper/Makefile

@@ -0,0 +1,5 @@
+EXECUTABLE := jacobi1D.exe
+CUFILES := jacobi1D.c
+PATH_TO_UTILS := ../../utilities
+
+include ${PATH_TO_UTILS}/common.mk

+ 124 - 0
real-life-dataset/polybench/CPU/stencils/jacobi-1d-imper/jacobi1D.c

@@ -0,0 +1,124 @@
+/**
+ * jacobi1D.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <time.h>
+#include <sys/time.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <math.h>
+
+#define POLYBENCH_TIME 1
+
+#include "jacobi1D.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define RUN_ON_CPU
+
+
+void init_array(int n, DATA_TYPE POLYBENCH_1D(A,N,n), DATA_TYPE POLYBENCH_1D(B,N,n))
+{
+	int i;
+
+	for (i = 0; i < n; i++)
+    	{
+		A[i] = ((DATA_TYPE) 4 * i + 10) / N;
+		B[i] = ((DATA_TYPE) 7 * i + 11) / N;
+    	}
+}
+
+
+void runJacobi1DCpu(int tsteps, int n, DATA_TYPE POLYBENCH_1D(A,N,n), DATA_TYPE POLYBENCH_1D(B,N,n))
+{
+
+	for (int t = 0; t < _PB_TSTEPS; t++)
+    {
+		for (int i = 2; i < _PB_N - 1; i++)
+		{
+			B[i] = 0.33333 * (A[i-1] + A[i] + A[i + 1]);
+		}
+		
+		for (int j = 2; j < _PB_N - 1; j++)
+		{
+			A[j] = B[j];
+		}
+    }
+
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int n,
+		 DATA_TYPE POLYBENCH_1D(A,N,n))
+
+{
+  int i;
+
+  for (i = 0; i < n; i++)
+    {
+      fprintf(stderr, DATA_PRINTF_MODIFIER, A[i]);
+      if (i % 20 == 0) fprintf(stderr, "\n");
+    }
+  fprintf(stderr, "\n");
+}
+
+
+int main(int argc, char** argv)
+{
+	/* Retrieve problem size. */
+	int n = N;
+	int tsteps = TSTEPS;
+
+	POLYBENCH_1D_ARRAY_DECL(a,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(b,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(a_outputFromGpu,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(b_outputFromGpu,DATA_TYPE,N,n);
+
+	init_array(n, POLYBENCH_ARRAY(a), POLYBENCH_ARRAY(b));
+
+	//runJacobi1DCUDA(tsteps, n, POLYBENCH_ARRAY(a), POLYBENCH_ARRAY(b), POLYBENCH_ARRAY(a_outputFromGpu), POLYBENCH_ARRAY(b_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+	
+		/* Start timer. */
+	  	polybench_start_instruments;
+	
+		runJacobi1DCpu(tsteps, n, POLYBENCH_ARRAY(a), POLYBENCH_ARRAY(b));
+	
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+
+		//compareResults(n, POLYBENCH_ARRAY(a), POLYBENCH_ARRAY(a_outputFromGpu), POLYBENCH_ARRAY(b), POLYBENCH_ARRAY(b_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(a_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(a);
+	POLYBENCH_FREE_ARRAY(a_outputFromGpu);
+	POLYBENCH_FREE_ARRAY(b);
+	POLYBENCH_FREE_ARRAY(b_outputFromGpu);
+
+	return 0;
+}
+
+#include <polybench.c>

+ 124 - 0
real-life-dataset/polybench/CPU/stencils/jacobi-1d-imper/jacobi1D.c_backup

@@ -0,0 +1,124 @@
+/**
+ * jacobi1D.cu: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <time.h>
+#include <sys/time.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <math.h>
+
+#define POLYBENCH_TIME 1
+
+#include "jacobi1D.h"
+#include <polybench.h>
+#include <polybenchUtilFuncts.h>
+
+//define the error threshold for the results "not matching"
+#define PERCENT_DIFF_ERROR_THRESHOLD 0.05
+
+#define RUN_ON_CPU
+
+
+void init_array(int n, DATA_TYPE POLYBENCH_1D(A,N,n), DATA_TYPE POLYBENCH_1D(B,N,n))
+{
+	int i;
+
+	for (i = 0; i < n; i++)
+    	{
+		A[i] = ((DATA_TYPE) 4 * i + 10) / N;
+		B[i] = ((DATA_TYPE) 7 * i + 11) / N;
+    	}
+}
+
+
+void runJacobi1DCpu(int tsteps, int n, DATA_TYPE POLYBENCH_1D(A,N,n), DATA_TYPE POLYBENCH_1D(B,N,n))
+{
+
+	for (int t = 0; t < _PB_TSTEPS; t++)
+    {
+		for (int i = 2; i < _PB_N - 1; i++)
+		{
+			B[i] = 0.33333 * (A[i-1] + A[i] + A[i + 1]);
+		}
+		
+		for (int j = 2; j < _PB_N - 1; j++)
+		{
+			A[j] = B[j];
+		}
+    }
+
+}
+
+/* DCE code. Must scan the entire live-out data.
+   Can be used also to check the correctness of the output. */
+static
+void print_array(int n,
+		 DATA_TYPE POLYBENCH_1D(A,N,n))
+
+{
+  int i;
+
+  for (i = 0; i < n; i++)
+    {
+      fprintf(stderr, DATA_PRINTF_MODIFIER, A[i]);
+      if (i % 20 == 0) fprintf(stderr, "\n");
+    }
+  fprintf(stderr, "\n");
+}
+
+
+int main(int argc, char** argv)
+{
+	/* Retrieve problem size. */
+	int n = N;
+	int tsteps = TSTEPS;
+
+	POLYBENCH_1D_ARRAY_DECL(a,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(b,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(a_outputFromGpu,DATA_TYPE,N,n);
+	POLYBENCH_1D_ARRAY_DECL(b_outputFromGpu,DATA_TYPE,N,n);
+
+	init_array(n, POLYBENCH_ARRAY(a), POLYBENCH_ARRAY(b));
+
+	//runJacobi1DCUDA(tsteps, n, POLYBENCH_ARRAY(a), POLYBENCH_ARRAY(b), POLYBENCH_ARRAY(a_outputFromGpu), POLYBENCH_ARRAY(b_outputFromGpu));
+
+	#ifdef RUN_ON_CPU
+	
+		/* Start timer. */
+	  	polybench_start_instruments;
+	
+		runJacobi1DCpu(tsteps, n, POLYBENCH_ARRAY(a), POLYBENCH_ARRAY(b));
+	
+		/* Stop and print timer. */
+		printf("CPU Time in seconds:\n");
+	  	polybench_stop_instruments;
+	 	polybench_print_instruments;
+
+		//compareResults(n, POLYBENCH_ARRAY(a), POLYBENCH_ARRAY(a_outputFromGpu), POLYBENCH_ARRAY(b), POLYBENCH_ARRAY(b_outputFromGpu));
+
+	#else //prevent dead code elimination
+
+		polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(a_outputFromGpu)));
+
+	#endif //RUN_ON_CPU
+
+
+	POLYBENCH_FREE_ARRAY(a);
+	POLYBENCH_FREE_ARRAY(a_outputFromGpu);
+	POLYBENCH_FREE_ARRAY(b);
+	POLYBENCH_FREE_ARRAY(b_outputFromGpu);
+
+	return 0;
+}
+
+#include <polybench.c>

BIN
real-life-dataset/polybench/CPU/stencils/jacobi-1d-imper/jacobi1D.exe


+ 61 - 0
real-life-dataset/polybench/CPU/stencils/jacobi-1d-imper/jacobi1D.h

@@ -0,0 +1,61 @@
+/**
+ * jacobi1D.cuh: This file is part of the PolyBench/GPU 1.0 test suite.
+ *
+ *
+ * Contact: Scott Grauer-Gray <sgrauerg@gmail.com>
+ * Will Killian <killian@udel.edu>
+ * Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
+ * Web address: http://www.cse.ohio-state.edu/~pouchet/software/polybench/GPU
+ */
+
+#ifndef JACOBI1D_H
+# define JACOBI1D_H
+
+/* Default to STANDARD_DATASET. */
+# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
+#  define STANDARD_DATASET
+# endif
+
+/* Do not define anything if the user manually defines the size. */
+# if !defined(TSTEPS) && !defined(N)
+/* Define the possible dataset sizes. */
+#  ifdef MINI_DATASET
+#define TSTEPS 10000
+#define N 1024
+#  endif
+
+#  ifdef SMALL_DATASET
+#define TSTEPS 10000
+#define N 2048
+#  endif
+
+#  ifdef STANDARD_DATASET /* Default if unspecified. */
+#define TSTEPS 10000
+#define N 4096
+#  endif
+
+#  ifdef LARGE_DATASET
+#define TSTEPS 10000
+#define N 8192
+#  endif
+
+#  ifdef EXTRALARGE_DATASET
+#define TSTEPS 10000
+#define N 16384
+#  endif
+# endif /* !N */
+
+# define _PB_TSTEPS POLYBENCH_LOOP_BOUND(TSTEPS,tsteps)
+# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
+
+# ifndef DATA_TYPE
+#  define DATA_TYPE float
+#  define DATA_PRINTF_MODIFIER "%0.2lf "
+# endif
+
+/* Thread block dimensions */
+#define DIM_THREAD_BLOCK_X 256
+#define DIM_THREAD_BLOCK_Y 1
+
+
+#endif /* !JACOBI1D*/

+ 0 - 0
real-life-dataset/polybench/CPU/stencils/jacobi-2d-imper/Makefile


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików