1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-23 13:04:29 +00:00

Implement -n/--ndevs option.

This commit is contained in:
Con Kolivas 2011-07-05 23:11:05 +10:00
parent 0ebdc39a19
commit 1fb09eaa0e

15
main.c
View File

@ -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)