Browse Source

Added run script, fix for cpu hotspot benchmark

Fixed the platform selection (to select the pocl platform) and reduced
the size of the kernel in order to permit handling by the odroid
Andrea Gussoni 8 years ago
parent
commit
d484024d46
3 changed files with 4 additions and 3 deletions
  1. 2 2
      opencl/hotspot/hotspot.c
  2. 1 1
      opencl/hotspot/hotspot.h
  3. 1 0
      opencl/hotspot/run-cpu

+ 2 - 2
opencl/hotspot/hotspot.c

@@ -158,7 +158,7 @@ int main(int argc, char** argv) {
     if (error != CL_SUCCESS) fatal_CL(error, __LINE__);
 	
 	// Print the chosen platform (if there are multiple platforms, choose the first one)
-	cl_platform_id platform = platforms[0];
+	cl_platform_id platform = platforms[1];
 	char pbuf[100];
 	error = clGetPlatformInfo(platform, CL_PLATFORM_VENDOR, sizeof(pbuf), pbuf, NULL);
 	if (error != CL_SUCCESS) fatal_CL(error, __LINE__);
@@ -166,7 +166,7 @@ int main(int argc, char** argv) {
 	
 	// Create a GPU context
 	cl_context_properties context_properties[3] = { CL_CONTEXT_PLATFORM, (cl_context_properties) platform, 0};
-    context = clCreateContextFromType(context_properties, CL_DEVICE_TYPE_GPU, NULL, NULL, &error);
+    context = clCreateContextFromType(context_properties, CL_DEVICE_TYPE_CPU, NULL, NULL, &error);
     if (error != CL_SUCCESS) fatal_CL(error, __LINE__);
 	
 	// Get and print the chosen device (if there are multiple devices, choose the first one)

+ 1 - 1
opencl/hotspot/hotspot.h

@@ -18,7 +18,7 @@
 #elif defined(RD_WG_SIZE)                                                        
         #define BLOCK_SIZE RD_WG_SIZE                                            
 #else                                                                                    
-        #define BLOCK_SIZE 16                                                            
+        #define BLOCK_SIZE 8                                                            
 #endif                                                                                   
 
 #define STR_SIZE 256

+ 1 - 0
opencl/hotspot/run-cpu

@@ -0,0 +1 @@
+./hotspot 512 3 1000  ../../data/hotspot/temp_512 ../../data/hotspot/power_512 output.out