Browse Source

Set default GPU threads to 1 for scrypt.

Con Kolivas 13 years ago
parent
commit
d7d630b86c
2 changed files with 10 additions and 1 deletions
  1. 1 1
      cgminer.c
  2. 9 0
      driver-opencl.c

+ 1 - 1
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;

+ 9 - 0
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;