Browse Source

Added run script, fix for cpu srad benchmark

Fixed selection of the OCL platform, fixed a kernel argument dimension
(long different on x86 and arm-v7) and changed the OCL kernel threads
number
Andrea Gussoni 8 years ago
parent
commit
e82cd0a81e
3 changed files with 10 additions and 9 deletions
  1. 8 8
      opencl/srad/kernel/kernel_gpu_opencl_wrapper.c
  2. 1 1
      opencl/srad/main.h
  3. 1 0
      opencl/srad/run-cpu

+ 8 - 8
opencl/srad/kernel/kernel_gpu_opencl_wrapper.c

@@ -90,7 +90,7 @@ kernel_gpu_opencl_wrapper(	fp* image,											// input image
 		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];
@@ -540,7 +540,7 @@ kernel_gpu_opencl_wrapper(	fp* image,											// input image
 
 	error = clSetKernelArg(	extract_kernel, 
 							0, 
-							sizeof(long), 
+							sizeof(long)*2, 
 							(void *) &Ne);
 	if (error != CL_SUCCESS) 
 		fatal_CL(error, __LINE__);
@@ -589,7 +589,7 @@ kernel_gpu_opencl_wrapper(	fp* image,											// input image
 
 	error = clSetKernelArg(	prepare_kernel, 
 							0, 
-							sizeof(long), 
+							sizeof(long)*2, 
 							(void *) &Ne);
 	if (error != CL_SUCCESS) 
 		fatal_CL(error, __LINE__);
@@ -631,7 +631,7 @@ kernel_gpu_opencl_wrapper(	fp* image,											// input image
 
 	error = clSetKernelArg(	reduce_kernel, 
 							0, 
-							sizeof(long), 
+							sizeof(long)*2, 
 							(void *) &Ne);
 	if (error != CL_SUCCESS) 
 		fatal_CL(error, __LINE__);
@@ -672,7 +672,7 @@ kernel_gpu_opencl_wrapper(	fp* image,											// input image
 		fatal_CL(error, __LINE__);
 	error = clSetKernelArg(	srad_kernel, 
 							3, 
-							sizeof(long), 
+							sizeof(long)*2, 
 							(void *) &Ne);
 	if (error != CL_SUCCESS) 
 		fatal_CL(error, __LINE__);
@@ -761,7 +761,7 @@ kernel_gpu_opencl_wrapper(	fp* image,											// input image
 		fatal_CL(error, __LINE__);
 	error = clSetKernelArg(	srad2_kernel, 
 							3, 
-							sizeof(long), 
+							sizeof(long)*2, 
 							(void *) &Ne);
 	if (error != CL_SUCCESS) 
 		fatal_CL(error, __LINE__);
@@ -880,7 +880,7 @@ kernel_gpu_opencl_wrapper(	fp* image,											// input image
 			// set arguments that were uptaded in this loop
 			error = clSetKernelArg(	reduce_kernel, 
 									1, 
-									sizeof(long), 
+									sizeof(long)*2, 
 									(void *) &no);
 			if (error != CL_SUCCESS) 
 				fatal_CL(error, __LINE__);
@@ -1037,7 +1037,7 @@ kernel_gpu_opencl_wrapper(	fp* image,											// input image
 
 	error = clSetKernelArg(	compress_kernel, 
 							0, 
-							sizeof(long), 
+							sizeof(long)*2, 
 							(void *) &Ne);
 	if (error != CL_SUCCESS) 
 		fatal_CL(error, __LINE__);

+ 1 - 1
opencl/srad/main.h

@@ -15,7 +15,7 @@
 #elif defined(RD_WG_SIZE)
         #define NUMBER_THREADS RD_WG_SIZE
 #else
-        #define NUMBER_THREADS 256
+        #define NUMBER_THREADS 4
 #endif
 
 

+ 1 - 0
opencl/srad/run-cpu

@@ -0,0 +1 @@
+./srad 300 0.5 502 458