Browse Source

Added run script, fix for cpu streamcluster benchmark

Fixed selection of the OCL platform, fixed a kernel argument dimension
(long different on x86 and arm-v7)
Andrea Gussoni 8 years ago
parent
commit
803c92078e

+ 1 - 1
opencl/streamcluster/CLHelper.h

@@ -311,7 +311,7 @@ void _clInit(string device_type, int device_id)throw(string){
         throw (string("InitCL()::Error: Getting platform ids (clGetPlatformIDs)"));
 
     // Select the target platform. Default: first platform 
-    targetPlatform = allPlatforms[0];
+    targetPlatform = allPlatforms[1];
     for (int i = 0; i < numPlatforms; i++)
     {
         char pbuff[128];

+ 1 - 0
opencl/streamcluster/run-cpu

@@ -0,0 +1 @@
+./streamcluster 10 20 16 65536 65536 1000 none output.txt 4 -t cpu -d 0

+ 1 - 1
opencl/streamcluster/streamcluster.cpp

@@ -336,7 +336,7 @@ float pFL(Points *points, int *feasible, int numfeasible,
   pthread_barrier_wait(barrier);
 #endif
   long i;
-  long x;
+  long long x;
   float change;
   long numberOfPoints;
 

+ 1 - 1
opencl/streamcluster/streamcluster.h

@@ -45,7 +45,7 @@ using namespace std;
 typedef struct {
   float weight;
   float * coord;
-  long assign;  /* number of point where this one is assigned */
+  long long assign;  /* number of point where this one is assigned */
   float cost;  /* cost of that assignment, weight*distance */
 } Point;
 

+ 2 - 2
opencl/streamcluster/streamcluster_cl.h

@@ -19,7 +19,7 @@
 #include "CLHelper.h"
 typedef struct {
   float weight;
-  long assign;  /* number of point where this one is assigned */
+  long long assign;  /* number of point where this one is assigned */
   float cost;  /* cost of that assignment, weight*distance */
 } Point_Struct;
 
@@ -79,7 +79,7 @@ void allocDevMem(int num, int dim, int kmax){
 		quit(&(msg[0]));
 	}	
 }
-float pgain( long x, Points *points, float z, long int *numcenters, int kmax, bool *is_center, int *center_table, char *switch_membership,
+float pgain(long long x, Points *points, float z, long int *numcenters, int kmax, bool *is_center, int *center_table, char *switch_membership,
 							double *serial, double *cpu_gpu_memcpy, double *memcpy_back, double *gpu_malloc, double *kernel){
 	float gl_cost = 0;
 	try{