From 8043af5ec704c859a231e06e6fd62c395aa8cd03 Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Fri, 7 Feb 2014 00:52:13 +0200 Subject: [PATCH] core: write gpu-threads to config when using ncurses menu. --- driver-opencl.c | 4 +++- sgminer.c | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/driver-opencl.c b/driver-opencl.c index 54f3e0de..a1c62284 100644 --- a/driver-opencl.c +++ b/driver-opencl.c @@ -731,8 +731,10 @@ void manage_gpu(void) char checkin[40]; char input; - if (!opt_g_threads) + if (!opt_g_threads) { + applog(LOG_ERR, "opt_g_threads not set in manage_gpu()"); return; + } opt_loginput = true; immedok(logwin, true); diff --git a/sgminer.c b/sgminer.c index 37486f13..a89a2433 100644 --- a/sgminer.c +++ b/sgminer.c @@ -1128,7 +1128,7 @@ static struct opt_table opt_config_table[] = { set_int_0_to_9999, opt_show_intval, &opt_platform_id, "Select OpenCL platform ID to use for GPU mining"), #ifndef HAVE_ADL - OPT_WITH_ARG("--gpu-threads|-g", + OPT_WITH_ARG("--gpu-threads|-g", // FIXME: why is this in a conditional? set_int_1_to_10, opt_show_intval, &opt_g_threads, "Number of threads per GPU (1 - 10)"), #else @@ -4220,6 +4220,11 @@ void write_config(FILE *fcfg) fprintf(fcfg, "%s%d", i > 0 ? "," : "", (int)gpus[i].shaders); + fputs("\",\n\"gpu-threads\" : \"", fcfg); + for(i = 0; i < nDevs; i++) + fprintf(fcfg, "%s%d", i > 0 ? "," : "", + (int)gpus[i].threads); + #ifdef HAVE_ADL fputs("\",\n\"gpu-engine\" : \"", fcfg); for(i = 0; i < nDevs; i++)