Browse Source

Added run script, fix for cpu lavaMD benchmark

Fixed the selection of the correct hardcoded OCL platform
Andrea Gussoni 8 years ago
parent
commit
f254008d7f
3 changed files with 11 additions and 10 deletions
  1. 2 2
      opencl/lavaMD/kernel/kernel_gpu_opencl_wrapper.c
  2. 8 8
      opencl/lavaMD/main.h
  3. 1 0
      opencl/lavaMD/run-cpu

+ 2 - 2
opencl/lavaMD/kernel/kernel_gpu_opencl_wrapper.c

@@ -92,7 +92,7 @@ kernel_gpu_opencl_wrapper(	par_str par_cpu,
 		fatal_CL(error, __LINE__);
 
 	// Select the 1st platform
-	cl_platform_id platform = platforms[0];
+	cl_platform_id platform = platforms[1];
 
 	// Get the name of the selected platform and print it (if there are multiple platforms, choose the first one)
 	char pbuf[100];
@@ -117,7 +117,7 @@ kernel_gpu_opencl_wrapper(	par_str par_cpu,
 	// Create context for selected platform being GPU
 	cl_context context;
 	context = clCreateContextFromType(	context_properties, 
-										CL_DEVICE_TYPE_GPU, 
+										CL_DEVICE_TYPE_CPU, 
 										NULL, 
 										NULL, 
 										&error);

+ 8 - 8
opencl/lavaMD/main.h

@@ -19,7 +19,7 @@
 #elif defined(RD_WG_SIZE)
         #define NUMBER_THREADS RD_WG_SIZE
 #else
-        #define NUMBER_THREADS 128
+        #define NUMBER_THREADS 64
 #endif
 
 
@@ -49,7 +49,7 @@ typedef struct nei_str
 	// neighbor box
 	int x, y, z;
 	int number;
-	long offset;
+	long long offset;
 
 } nei_str;
 
@@ -59,7 +59,7 @@ typedef struct box_str
 	// home box
 	int x, y, z;
 	int number;
-	long offset;
+	long long offset;
 
 	// neighbor boxes
 	int nn;
@@ -84,11 +84,11 @@ typedef struct dim_str
 	int boxes1d_arg;
 
 	// system memory
-	long number_boxes;
-	long box_mem;
-	long space_elem;
-	long space_mem;
-	long space_mem2;
+	long long number_boxes;
+	long long box_mem;
+	long long space_elem;
+	long long space_mem;
+	long long space_mem2;
 
 } dim_str;
 

+ 1 - 0
opencl/lavaMD/run-cpu

@@ -0,0 +1 @@
+./lavaMD -boxes1d 16