Browse Source

Only set option to show devices and exit if built with opencl support.

nfactor-troky
Con Kolivas 13 years ago
parent
commit
4766463b78
  1. 8
      main.c

8
main.c

@ -611,11 +611,13 @@ static char *load_config(const char *arg, void *unused)
return parse_config(config); return parse_config(config);
} }
#ifdef HAVE_OPENCL
static char *print_ndevs_and_exit(int *ndevs) static char *print_ndevs_and_exit(int *ndevs)
{ {
printf("%i GPU devices detected\n", *ndevs); printf("%i GPU devices detected\n", *ndevs);
exit(*ndevs); exit(*ndevs);
} }
#endif
/* These options are available from commandline only */ /* These options are available from commandline only */
static struct opt_table opt_cmdline_table[] = { static struct opt_table opt_cmdline_table[] = {
@ -626,14 +628,16 @@ static struct opt_table opt_cmdline_table[] = {
OPT_WITHOUT_ARG("--help|-h", OPT_WITHOUT_ARG("--help|-h",
opt_usage_and_exit, opt_usage_and_exit,
#ifdef HAVE_OPENCL #ifdef HAVE_OPENCL
"\nBuilt with CPU and GPU mining support.\n\n", "\nBuilt with CPU and GPU mining support.\n",
#else #else
"\nBuilt with CPU mining support only.\n\n", "\nBuilt with CPU mining support only.\n",
#endif #endif
"Print this message"), "Print this message"),
#ifdef HAVE_OPENCL
OPT_WITHOUT_ARG("--ndevs|-n", OPT_WITHOUT_ARG("--ndevs|-n",
print_ndevs_and_exit, &nDevs, print_ndevs_and_exit, &nDevs,
"Enumerate number of detected GPUs and exit"), "Enumerate number of detected GPUs and exit"),
#endif
OPT_ENDTABLE OPT_ENDTABLE
}; };

Loading…
Cancel
Save