Commit 527e611b743d0a54104b8d8e8a9bc434f907e9ec

Con Kolivas 2012-02-23T01:27:36

Fix !HAVE_OPENCL build.

diff --git a/cgminer.c b/cgminer.c
index 8011a41..7868b24 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2327,6 +2327,7 @@ 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);
+#ifdef HAVE_OPENCL
 		fputs("\",\n\"vectors\" : \"", fcfg);
 		for(i = 0; i < nDevs; i++)
 			fprintf(fcfg, "%s%d", i > 0 ? "," : "",
@@ -2335,6 +2336,26 @@ void write_config(FILE *fcfg)
 		for(i = 0; i < nDevs; i++)
 			fprintf(fcfg, "%s%d", i > 0 ? "," : "",
 				(int)gpus[i].work_size);
+		fputs("\",\n\"kernel\" : \"", fcfg);
+		for(i = 0; i < nDevs; i++) {
+			fprintf(fcfg, "%s", i > 0 ? "," : "");
+			switch (gpus[i].kernel) {
+				case KL_NONE: // Shouldn't happen
+					break;
+				case KL_POCLBM:
+					fprintf(fcfg, "poclbm");
+					break;
+				case KL_PHATK:
+					fprintf(fcfg, "phatk");
+					break;
+				case KL_DIAKGCN:
+					fprintf(fcfg, "diakgcn");
+					break;
+				case KL_DIABLO:
+					fprintf(fcfg, "diablo");
+					break;
+			}
+		}
 #ifdef HAVE_ADL
 		fputs("\",\n\"gpu-engine\" : \"", fcfg);
 		for(i = 0; i < nDevs; i++)
@@ -2364,26 +2385,7 @@ void write_config(FILE *fcfg)
 		for(i = 0; i < nDevs; i++)
 			fprintf(fcfg, "%s%d", i > 0 ? "," : "", gpus[i].adl.targettemp);
 #endif
-		fputs("\",\n\"kernel\" : \"", fcfg);
-		for(i = 0; i < nDevs; i++) {
-			fprintf(fcfg, "%s", i > 0 ? "," : "");
-			switch (gpus[i].kernel) {
-				case KL_NONE: // Shouldn't happen
-					break;
-				case KL_POCLBM:
-					fprintf(fcfg, "poclbm");
-					break;
-				case KL_PHATK:
-					fprintf(fcfg, "phatk");
-					break;
-				case KL_DIAKGCN:
-					fprintf(fcfg, "diakgcn");
-					break;
-				case KL_DIABLO:
-					fprintf(fcfg, "diablo");
-					break;
-			}
-		}
+#endif
 		fputs("\"", fcfg);
 #ifdef WANT_CPUMINE
 		fputs(",\n", fcfg);
diff --git a/miner.h b/miner.h
index a08789c..23e91ec 100644
--- a/miner.h
+++ b/miner.h
@@ -245,13 +245,14 @@ struct cgpu_info {
 
 	unsigned int max_hashes;
 
-#ifdef HAVE_OPENCL
 	int virtual_gpu;
 	int intensity;
 	bool dynamic;
+#ifdef HAVE_OPENCL
 	cl_uint vwidth;
 	size_t work_size;
 	enum cl_kernels kernel;
+#endif
 
 	float temp;
 	int cutofftemp;
@@ -269,7 +270,6 @@ struct cgpu_info {
 	int gpu_powertune;
 	float gpu_vddc;
 #endif
-#endif
 	int last_share_pool;
 	time_t last_share_pool_time;
 };