Browse Source

Add intensity parameter (-i 0:31)

Like cgminer, the value equals to 1 << n
if 0, we keep the default value defined in algo (19 for Xn algos)

19 = 524288 threads per gpu call

GTX 970 and 980 handle a higher number of threads compared to the 750 Ti

Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com>
2upstream
Tanguy Pruvot 10 years ago
parent
commit
9f62014690
  1. 25
      cpu-miner.c
  2. 1
      miner.h

25
cpu-miner.c

@ -235,6 +235,8 @@ static unsigned long rejected_count = 0L;
static double *thr_hashrates; static double *thr_hashrates;
uint64_t global_hashrate = 0; uint64_t global_hashrate = 0;
uint32_t opt_work_size = 0; /* default */
#ifdef HAVE_GETOPT_LONG #ifdef HAVE_GETOPT_LONG
#include <getopt.h> #include <getopt.h>
#else #else
@ -279,6 +281,7 @@ Options:\n\
Device IDs start counting from 0! Alternatively takes\n\ Device IDs start counting from 0! Alternatively takes\n\
string names of your cards like gtx780ti or gt640#2\n\ string names of your cards like gtx780ti or gt640#2\n\
(matching 2nd gt640 in the PC)\n\ (matching 2nd gt640 in the PC)\n\
-i --intensity=N GPU intensity 0-31 (default: auto) \n\
-f, --diff Divide difficulty by this factor (std is 1) \n\ -f, --diff Divide difficulty by this factor (std is 1) \n\
-v, --vote=VOTE block reward vote (for HeavyCoin)\n\ -v, --vote=VOTE block reward vote (for HeavyCoin)\n\
-m, --trust-pool trust the max block reward vote (maxvote) sent by the pool\n\ -m, --trust-pool trust the max block reward vote (maxvote) sent by the pool\n\
@ -298,7 +301,7 @@ Options:\n\
--no-longpoll disable X-Long-Polling support\n\ --no-longpoll disable X-Long-Polling support\n\
--no-stratum disable X-Stratum support\n\ --no-stratum disable X-Stratum support\n\
-q, --quiet disable per-thread hashmeter output\n\ -q, --quiet disable per-thread hashmeter output\n\
-K, --no-color disable colored output\n\ --no-color disable colored output\n\
-D, --debug enable debug output\n\ -D, --debug enable debug output\n\
-P, --protocol-dump verbose dump of protocol-level activities\n" -P, --protocol-dump verbose dump of protocol-level activities\n"
#ifdef HAVE_SYSLOG_H #ifdef HAVE_SYSLOG_H
@ -324,7 +327,7 @@ static char const short_options[] =
#ifdef HAVE_SYSLOG_H #ifdef HAVE_SYSLOG_H
"S" "S"
#endif #endif
"a:c:CKDhp:Px:qr:R:s:t:T:o:u:O:Vd:f:mv:"; "a:c:i:Dhp:Px:qr:R:s:t:T:o:u:O:Vd:f:mv:";
static struct option const options[] = { static struct option const options[] = {
{ "algo", 1, NULL, 'a' }, { "algo", 1, NULL, 'a' },
@ -335,9 +338,10 @@ static struct option const options[] = {
{ "cputest", 0, NULL, 1006 }, { "cputest", 0, NULL, 1006 },
{ "cert", 1, NULL, 1001 }, { "cert", 1, NULL, 1001 },
{ "config", 1, NULL, 'c' }, { "config", 1, NULL, 'c' },
{ "no-color", 0, NULL, 'K' }, { "no-color", 0, NULL, 1002 },
{ "debug", 0, NULL, 'D' }, { "debug", 0, NULL, 'D' },
{ "help", 0, NULL, 'h' }, { "help", 0, NULL, 'h' },
{ "intensity", 1, NULL, 'i' },
{ "no-longpoll", 0, NULL, 1003 }, { "no-longpoll", 0, NULL, 1003 },
{ "no-stratum", 0, NULL, 1007 }, { "no-stratum", 0, NULL, 1007 },
{ "pass", 1, NULL, 'p' }, { "pass", 1, NULL, 'p' },
@ -1603,12 +1607,12 @@ static void parse_arg (int key, char *arg)
} }
break; break;
} }
case 'C': case 'i':
/* color for compat */ v = atoi(arg);
use_colors = true; if (v < 0 || v > 31)
break; show_usage_and_exit(1);
case 'K': if (v > 0) /* 0 = default */
use_colors = false; opt_work_size = (1 << v);
break; break;
case 'D': case 'D':
opt_debug = true; opt_debug = true;
@ -1738,6 +1742,9 @@ static void parse_arg (int key, char *arg)
free(opt_cert); free(opt_cert);
opt_cert = strdup(arg); opt_cert = strdup(arg);
break; break;
case 1002:
use_colors = false;
break;
case 1005: case 1005:
opt_benchmark = true; opt_benchmark = true;
want_longpoll = false; want_longpoll = false;

1
miner.h

@ -370,6 +370,7 @@ extern int stratum_thr_id;
extern struct work_restart *work_restart; extern struct work_restart *work_restart;
extern bool opt_trust_pool; extern bool opt_trust_pool;
extern uint16_t opt_vote; extern uint16_t opt_vote;
extern uint32_t opt_work_size;
extern uint64_t global_hashrate; extern uint64_t global_hashrate;
#define CL_N "\x1B[0m" #define CL_N "\x1B[0m"

Loading…
Cancel
Save