Add missing options gpu-memdiff and gpu-reorder to write config function.
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
diff --git a/NEWS b/NEWS
index 32f3aa2..b167b0f 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ NOTE - The GPU Device reordering in 2.2.0 by default was considered a bad idea
so the original GPU ordering is used by default again unless reordering is
explicitly requested.
+- Add missing options to write config function.
- Add a --gpu-reorder option to only reorder devices according to PCI Bus ID
when requested.
- Fix for midstate support being broken on pools that supported no-midstate
diff --git a/main.c b/main.c
index 4ddcd07..b953454 100644
--- a/main.c
+++ b/main.c
@@ -3169,6 +3169,9 @@ void write_config(FILE *fcfg)
fputs("\",\n\"gpu-memclock\" : \"", fcfg);
for(i = 0; i < nDevs; i++)
fprintf(fcfg, "%s%d", i > 0 ? "," : "", gpus[i].gpu_memclock);
+ fputs("\",\n\"gpu-memdiff\" : \"", fcfg);
+ for(i = 0; i < nDevs; i++)
+ fprintf(fcfg, "%s%d", i > 0 ? "," : "", gpus[i].gpu_memdiff);
fputs("\",\n\"gpu-powertune\" : \"", fcfg);
for(i = 0; i < nDevs; i++)
fprintf(fcfg, "%s%d", i > 0 ? "," : "", gpus[i].gpu_powertune);
@@ -3190,6 +3193,10 @@ void write_config(FILE *fcfg)
fputs(",\n", fcfg);
#endif
}
+#ifdef HAVE_ADL
+ if (opt_reorder)
+ fprintf(fcfg, ",\n\"gpu-reorder\" : true");
+#endif
#ifdef WANT_CPUMINE
fprintf(fcfg, "\n\"algo\" : \"%s\"", algo_names[opt_algo]);
#endif
@@ -3246,7 +3253,7 @@ void write_config(FILE *fcfg)
if (!gpus[i].enabled)
break;
if (i < nDevs)
- for(i = 0; i < nDevs; i++)
+ for (i = 0; i < nDevs; i++)
if (gpus[i].enabled)
fprintf(fcfg, ",\n\"device\" : \"%d\"", i);
if (strcmp(opt_api_description, PACKAGE_STRING) != 0)