Fix !HAVE_OPENCL build.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
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;
};