Browse Source

Added run script, fix for cpu pathfinder benchmark

Fixed selection of the OCL platform and removed a define that should be
in debug
Andrea Gussoni 8 years ago
parent
commit
0a14257dc4
3 changed files with 4 additions and 3 deletions
  1. 1 1
      opencl/pathfinder/OpenCL.cpp
  2. 2 2
      opencl/pathfinder/main.cpp
  3. 1 0
      opencl/pathfinder/run-cpu

+ 1 - 1
opencl/pathfinder/OpenCL.cpp

@@ -224,7 +224,7 @@ void OpenCL::getDevices(cl_device_type deviceType)
 		}
 	}
 	
-	clGetDeviceIDs(platform_id[0], deviceType, 100, device_id, &devices_n);
+	clGetDeviceIDs(platform_id[1], deviceType, 100, device_id, &devices_n);
 	if (VERBOSE)
 	{
 		printf("Using the default platform (platform 0)...\n\n");

+ 2 - 2
opencl/pathfinder/main.cpp

@@ -24,7 +24,7 @@ using namespace std;
 #define STR_SIZE 256
 #define DEVICE   0
 #define M_SEED   9
-#define BENCH_PRINT
+//#define BENCH_PRINT
 #define IN_RANGE(x, min, max)	((x)>=(min) && (x)<=(max))
 #define CLAMP_RANGE(x, min, max) x = (x<(min)) ? min : ((x>(max)) ? max : x )
 #define MIN(a, b) ((a)<=(b) ? (a) : (b))
@@ -103,7 +103,7 @@ int main(int argc, char** argv)
 
 	// Create and initialize the OpenCL object.
 	OpenCL cl(1);  // 1 means to display output (debugging mode).
-	cl.init(1);    // 1 means to use GPU. 0 means use CPU.
+	cl.init(0);    // 1 means to use GPU. 0 means use CPU.
 	cl.gwSize(rows * cols);
 
 	// Create and build the kernel.

+ 1 - 0
opencl/pathfinder/run-cpu

@@ -0,0 +1 @@
+./pathfinder 100000 100 20