Browse Source

Implement -n/--ndevs option.

Con Kolivas 14 years ago
parent
commit
1fb09eaa0e
1 changed files with 11 additions and 4 deletions
  1. 11 4
      main.c

+ 11 - 4
main.c

@@ -1367,6 +1367,10 @@ static void parse_arg (int key, char *arg)
 			show_usage();
 		opt_log_interval = v;
 		break;
+	case 'n':
+		opt_log_output = true;
+		opt_ndevs = true;
+		break;
 	case 'p':
 		free(rpc_pass);
 		rpc_pass = strdup(arg);
@@ -1523,10 +1527,6 @@ int main (int argc, char *argv[])
 
 #ifdef HAVE_OPENCL
 	nDevs = clDevicesNum();
-	if (opt_ndevs) {
-		applog(LOG_INFO, "%i", nDevs);
-		return nDevs;
-	}
 #endif
 	/* Invert the value to determine if we manually set it in cmdline
 	 * or disable gpu threads */
@@ -1538,6 +1538,13 @@ int main (int argc, char *argv[])
 	/* parse command line */
 	parse_cmdline(argc, argv);
 
+#ifdef HAVE_OPENCL
+	if (opt_ndevs) {
+		applog(LOG_INFO, "%i", nDevs);
+		return nDevs;
+	}
+#endif
+
 	gpu_threads = nDevs * opt_g_threads;
 	if (opt_n_threads < 0) {
 		if (gpu_threads)