Commit 1c67f6068c15b526b506d840f4f9bb191676a2d8

Con Kolivas 2011-07-21T10:07:29

Sometimes the cl compiler generates zero sized binaries and only a reboot seems to fix it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/ocl.c b/ocl.c
index 1d8dd0e..9ebf2c2 100644
--- a/ocl.c
+++ b/ocl.c
@@ -510,6 +510,10 @@ build:
 	/* copy over all of the generated binaries. */
 	if (opt_debug)
 		applog(LOG_DEBUG, "binary size %d : %d", gpu, binary_sizes[gpu]);
+	if (!binary_sizes[gpu]) {
+		applog(LOG_ERR, "OpenCL compiler generated a zero sized binary, may need to reboot!");
+		return NULL;
+	}
 	binaries[gpu] = (char *)malloc( sizeof(char)*binary_sizes[gpu]);
 	status = clGetProgramInfo( clState->program, CL_PROGRAM_BINARIES, sizeof(char *)*nDevices, binaries, NULL );
 	if (unlikely(status != CL_SUCCESS))