Commit 1dfbe60353fb687133f362182edcd449fd2c0807

ckolivas 2011-06-29T09:24:38

Put sanity limit on work size since some nvidia fail :(

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/ocl.c b/ocl.c
index c5e814f..cd60875 100644
--- a/ocl.c
+++ b/ocl.c
@@ -303,6 +303,9 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
 	}
 	if (opt_debug)
 		applog(LOG_DEBUG, "Max work group size reported %d", clState->max_work_size);
+	/* Some nvidia cards report 1024 but fail when set larger than 512 !? */
+	if (clState->max_work_size > 512)
+		clState->max_work_size = 512;
 
 	/////////////////////////////////////////////////////////////////
 	// Load CL file, build CL program object, create CL kernel object