Browse Source

Save config options for GPUs only if there are GPU devices.

nfactor-troky
Con Kolivas 13 years ago
parent
commit
eee665895d
  1. 60
      main.c

60
main.c

@ -3099,37 +3099,39 @@ static void write_config(FILE *fcfg)
} }
fputs("\n],\n\n", fcfg); fputs("\n],\n\n", fcfg);
/* Write GPU device values */ if (nDevs) {
fputs("\"intensity\" : \"", fcfg); /* Write GPU device values */
for(i = 0; i < nDevs; i++) fputs("\"intensity\" : \"", fcfg);
fprintf(fcfg, gpus[i].dynamic ? "%sd" : "%s%d", i > 0 ? "," : "", gpus[i].intensity); for(i = 0; i < nDevs; i++)
fprintf(fcfg, gpus[i].dynamic ? "%sd" : "%s%d", i > 0 ? "," : "", gpus[i].intensity);
#ifdef HAVE_ADL #ifdef HAVE_ADL
fputs("\",\n\"gpu-engine\" : \"", fcfg); fputs("\",\n\"gpu-engine\" : \"", fcfg);
for(i = 0; i < nDevs; i++) for(i = 0; i < nDevs; i++)
fprintf(fcfg, "%s%d-%d", i > 0 ? "," : "", gpus[i].min_engine, gpus[i].gpu_engine); fprintf(fcfg, "%s%d-%d", i > 0 ? "," : "", gpus[i].min_engine, gpus[i].gpu_engine);
fputs("\",\n\"gpu-fan\" : \"", fcfg); fputs("\",\n\"gpu-fan\" : \"", fcfg);
for(i = 0; i < nDevs; i++) for(i = 0; i < nDevs; i++)
fprintf(fcfg, "%s%d-%d", i > 0 ? "," : "", gpus[i].min_fan, gpus[i].gpu_fan); fprintf(fcfg, "%s%d-%d", i > 0 ? "," : "", gpus[i].min_fan, gpus[i].gpu_fan);
fputs("\",\n\"gpu-memclock\" : \"", fcfg); fputs("\",\n\"gpu-memclock\" : \"", fcfg);
for(i = 0; i < nDevs; i++) for(i = 0; i < nDevs; i++)
fprintf(fcfg, "%s%d", i > 0 ? "," : "", gpus[i].gpu_memclock); fprintf(fcfg, "%s%d", i > 0 ? "," : "", gpus[i].gpu_memclock);
fputs("\",\n\"gpu-powertune\" : \"", fcfg); fputs("\",\n\"gpu-powertune\" : \"", fcfg);
for(i = 0; i < nDevs; i++) for(i = 0; i < nDevs; i++)
fprintf(fcfg, "%s%d", i > 0 ? "," : "", gpus[i].gpu_powertune); fprintf(fcfg, "%s%d", i > 0 ? "," : "", gpus[i].gpu_powertune);
fputs("\",\n\"gpu-vddc\" : \"", fcfg); fputs("\",\n\"gpu-vddc\" : \"", fcfg);
for(i = 0; i < nDevs; i++) for(i = 0; i < nDevs; i++)
fprintf(fcfg, "%s%1.3f", i > 0 ? "," : "", gpus[i].gpu_vddc); fprintf(fcfg, "%s%1.3f", i > 0 ? "," : "", gpus[i].gpu_vddc);
fputs("\",\n\"temp-cutoff\" : \"", fcfg); fputs("\",\n\"temp-cutoff\" : \"", fcfg);
for(i = 0; i < nDevs; i++) for(i = 0; i < nDevs; i++)
fprintf(fcfg, "%s%d", i > 0 ? "," : "", gpus[i].adl.cutofftemp); fprintf(fcfg, "%s%d", i > 0 ? "," : "", gpus[i].adl.cutofftemp);
fputs("\",\n\"temp-overheat\" : \"", fcfg); fputs("\",\n\"temp-overheat\" : \"", fcfg);
for(i = 0; i < nDevs; i++) for(i = 0; i < nDevs; i++)
fprintf(fcfg, "%s%d", i > 0 ? "," : "", gpus[i].adl.overtemp); fprintf(fcfg, "%s%d", i > 0 ? "," : "", gpus[i].adl.overtemp);
fputs("\",\n\"temp-target\" : \"", fcfg); fputs("\",\n\"temp-target\" : \"", fcfg);
for(i = 0; i < nDevs; i++) for(i = 0; i < nDevs; i++)
fprintf(fcfg, "%s%d", i > 0 ? "," : "", gpus[i].adl.targettemp); fprintf(fcfg, "%s%d", i > 0 ? "," : "", gpus[i].adl.targettemp);
#endif #endif
fputs("\",\n", fcfg); fputs("\",\n", fcfg);
}
fprintf(fcfg, "\n\"algo\" : \"%s\"", algo_names[opt_algo]); fprintf(fcfg, "\n\"algo\" : \"%s\"", algo_names[opt_algo]);
/* Simple bool and int options */ /* Simple bool and int options */

Loading…
Cancel
Save