浏览代码

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 年之前
父节点
当前提交
d484024d46
共有 3 个文件被更改,包括 4 次插入3 次删除
  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__);
     if (error != CL_SUCCESS) fatal_CL(error, __LINE__);
 	
 	
 	// Print the chosen platform (if there are multiple platforms, choose the first one)
 	// 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];
 	char pbuf[100];
 	error = clGetPlatformInfo(platform, CL_PLATFORM_VENDOR, sizeof(pbuf), pbuf, NULL);
 	error = clGetPlatformInfo(platform, CL_PLATFORM_VENDOR, sizeof(pbuf), pbuf, NULL);
 	if (error != CL_SUCCESS) fatal_CL(error, __LINE__);
 	if (error != CL_SUCCESS) fatal_CL(error, __LINE__);
@@ -166,7 +166,7 @@ int main(int argc, char** argv) {
 	
 	
 	// Create a GPU context
 	// Create a GPU context
 	cl_context_properties context_properties[3] = { CL_CONTEXT_PLATFORM, (cl_context_properties) platform, 0};
 	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__);
     if (error != CL_SUCCESS) fatal_CL(error, __LINE__);
 	
 	
 	// Get and print the chosen device (if there are multiple devices, choose the first one)
 	// 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)                                                        
 #elif defined(RD_WG_SIZE)                                                        
         #define BLOCK_SIZE RD_WG_SIZE                                            
         #define BLOCK_SIZE RD_WG_SIZE                                            
 #else                                                                                    
 #else                                                                                    
-        #define BLOCK_SIZE 16                                                            
+        #define BLOCK_SIZE 8                                                            
 #endif                                                                                   
 #endif                                                                                   
 
 
 #define STR_SIZE 256
 #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