Commit 1b1fa5cd897e37c169a605ff4656335ff1b97a9c

ckolivas 2012-02-22T20:08:29

Allow writing of multiple vector sizes to the configuration file.

diff --git a/cgminer.c b/cgminer.c
index 03a9b4d..6fa5f98 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2304,6 +2304,10 @@ void write_config(FILE *fcfg)
 		fputs("\"intensity\" : \"", fcfg);
 		for(i = 0; i < nDevs; i++)
 			fprintf(fcfg, gpus[i].dynamic ? "%sd" : "%s%d", i > 0 ? "," : "", gpus[i].intensity);
+		fputs("\",\n\"vectors\" : \"", fcfg);
+		for(i = 0; i < nDevs; i++)
+			fprintf(fcfg, "%s%d", i > 0 ? "," : "",
+				gpus[i].vwidth);
 #ifdef HAVE_ADL
 		fputs("\",\n\"gpu-engine\" : \"", fcfg);
 		for(i = 0; i < nDevs; i++)
diff --git a/ocl.c b/ocl.c
index d84d15a..9ab58ac 100644
--- a/ocl.c
+++ b/ocl.c
@@ -345,8 +345,10 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
 
 	if (gpus[gpu].vwidth)
 		clState->vwidth = gpus[gpu].vwidth;
-	else
+	else {
 		clState->vwidth = preferred_vwidth;
+		gpus[gpu].vwidth = preferred_vwidth;
+	}
 
 	if (gpus[gpu].work_size && gpus[gpu].work_size <= clState->max_work_size)
 		clState->wsize = gpus[gpu].work_size;