Browse Source

ccminer: argument fix for 10th device selection

pull/2/head
Tanguy Pruvot 7 years ago
parent
commit
575aa1a0e4
  1. 4
      ccminer.cpp

4
ccminer.cpp

@ -3593,10 +3593,10 @@ void parse_arg(int key, char *arg)
{ {
int device_thr[MAX_GPUS] = { 0 }; int device_thr[MAX_GPUS] = { 0 };
int ngpus = cuda_num_devices(); int ngpus = cuda_num_devices();
char * pch = strtok (arg,","); char* pch = strtok(arg,",");
opt_n_threads = 0; opt_n_threads = 0;
while (pch != NULL && opt_n_threads < MAX_GPUS) { while (pch != NULL && opt_n_threads < MAX_GPUS) {
if (pch[0] >= '0' && pch[0] <= '9' && pch[1] == '\0') if (pch[0] >= '0' && pch[0] <= '9' && strlen(pch) <= 2)
{ {
if (atoi(pch) < ngpus) if (atoi(pch) < ngpus)
device_map[opt_n_threads++] = atoi(pch); device_map[opt_n_threads++] = atoi(pch);

Loading…
Cancel
Save