Commit d7d630b86c441deed3f813fd103c29c96c7aa83c

Con Kolivas 2013-03-16T08:56:37

Set default GPU threads to 1 for scrypt.

diff --git a/cgminer.c b/cgminer.c
index 43fd63b..aebdf2e 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -97,7 +97,7 @@ int nDevs;
 #endif
 #ifdef HAVE_OPENCL
 int opt_dynamic_interval = 7;
-int opt_g_threads = 2;
+int opt_g_threads = -1;
 int gpu_threads;
 #ifdef USE_SCRYPT
 bool opt_scrypt;
diff --git a/driver-opencl.c b/driver-opencl.c
index 5b83349..d117e2e 100644
--- a/driver-opencl.c
+++ b/driver-opencl.c
@@ -1245,6 +1245,15 @@ static void opencl_detect()
 	if (!nDevs)
 		return;
 
+	/* If opt_g_threads is not set, use default 1 thread on scrypt and
+	 * 2 for regular mining */
+	if (opt_g_threads == -1) {
+		if (opt_scrypt)
+			opt_g_threads = 1;
+		else
+			opt_g_threads = 2;
+	}
+
 	for (i = 0; i < nDevs; ++i) {
 		struct cgpu_info *cgpu;