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:
parent
0ebdc39a19
commit
1fb09eaa0e
15
main.c
15
main.c
@ -1367,6 +1367,10 @@ static void parse_arg (int key, char *arg)
|
|||||||
show_usage();
|
show_usage();
|
||||||
opt_log_interval = v;
|
opt_log_interval = v;
|
||||||
break;
|
break;
|
||||||
|
case 'n':
|
||||||
|
opt_log_output = true;
|
||||||
|
opt_ndevs = true;
|
||||||
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
free(rpc_pass);
|
free(rpc_pass);
|
||||||
rpc_pass = strdup(arg);
|
rpc_pass = strdup(arg);
|
||||||
@ -1523,10 +1527,6 @@ int main (int argc, char *argv[])
|
|||||||
|
|
||||||
#ifdef HAVE_OPENCL
|
#ifdef HAVE_OPENCL
|
||||||
nDevs = clDevicesNum();
|
nDevs = clDevicesNum();
|
||||||
if (opt_ndevs) {
|
|
||||||
applog(LOG_INFO, "%i", nDevs);
|
|
||||||
return nDevs;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
/* Invert the value to determine if we manually set it in cmdline
|
/* Invert the value to determine if we manually set it in cmdline
|
||||||
* or disable gpu threads */
|
* or disable gpu threads */
|
||||||
@ -1538,6 +1538,13 @@ int main (int argc, char *argv[])
|
|||||||
/* parse command line */
|
/* parse command line */
|
||||||
parse_cmdline(argc, argv);
|
parse_cmdline(argc, argv);
|
||||||
|
|
||||||
|
#ifdef HAVE_OPENCL
|
||||||
|
if (opt_ndevs) {
|
||||||
|
applog(LOG_INFO, "%i", nDevs);
|
||||||
|
return nDevs;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
gpu_threads = nDevs * opt_g_threads;
|
gpu_threads = nDevs * opt_g_threads;
|
||||||
if (opt_n_threads < 0) {
|
if (opt_n_threads < 0) {
|
||||||
if (gpu_threads)
|
if (gpu_threads)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user