Commit a095f0fae2c1052585322f9a7613c34e0a53e85f

Con Kolivas 2011-06-30T14:30:10

Broke source generated program. Fix.

diff --git a/ocl.c b/ocl.c
index 574af6e..64497e5 100644
--- a/ocl.c
+++ b/ocl.c
@@ -328,12 +328,16 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
 	char binaryfilename[255];
 	char numbuf[10];
 	char filename[10];
+	if (clState->hasBitAlign)
+		strcpy(filename, "phatk.cl");
+	else
+		strcpy(filename, "poclbm.cl");
 	FILE *binaryfile;
 	size_t *binary_sizes;
 	char **binaries;
 	size_t nDevices = 1;
 	int pl;
-	char *source, *rawsource;
+	char *source, *rawsource = file_contents(filename, &pl);
 	size_t sourceSize[] = {(size_t)pl};
 
 	source = malloc(pl);
@@ -342,12 +346,6 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
 		return NULL;
 	}
 
-	if (clState->hasBitAlign)
-		strcpy(filename, "phatk.cl");
-	else
-		strcpy(filename, "poclbm.cl");
-	rawsource = file_contents(filename, &pl);
-
 	binary_sizes = (size_t *)malloc(sizeof(size_t)*nDevices);
 	if (unlikely(!binary_sizes)) {
 		applog(LOG_ERR, "Unable to malloc binary_sizes");