Browse Source

cmdline: fix multi-gpu intensity

the comma presence check was wrong...
2upstream
Tanguy Pruvot 10 years ago
parent
commit
c1cfb3a131
  1. 13
      ccminer.cpp

13
ccminer.cpp

@ -1866,9 +1866,16 @@ void parse_arg(int key, char *arg)
int n = 0; int n = 0;
int ngpus = cuda_num_devices(); int ngpus = cuda_num_devices();
char * pch = strtok(arg,","); char * pch = strtok(arg,",");
if (pch == NULL) { if (!pch || pch == arg) {
// single value, set intensity for all cards
uint32_t adds = 0;
if ((d - v) > 0.0) {
adds = (uint32_t)floor((d - v) * (1 << (v - 8))) * 256;
}
for (n=0; n < ngpus; n++) for (n=0; n < ngpus; n++)
gpus_intensity[n] = (1 << v); gpus_intensity[n] = (1 << v) + adds;
applog(LOG_INFO, "Intensity set to %.1f, %u cuda threads",
d, gpus_intensity[0]);
break; break;
} }
while (pch != NULL) { while (pch != NULL) {
@ -1876,7 +1883,7 @@ void parse_arg(int key, char *arg)
v = (uint32_t) d; v = (uint32_t) d;
if (v > 7) { /* 0 = default */ if (v > 7) { /* 0 = default */
if ((d - v) > 0.0) { if ((d - v) > 0.0) {
int adds = (uint32_t)floor((d - v) * (1 << (v - 8))) * 256; uint32_t adds = (uint32_t)floor((d - v) * (1 << (v - 8))) * 256;
gpus_intensity[n] = (1 << v) + adds; gpus_intensity[n] = (1 << v) + adds;
applog(LOG_INFO, "Adding %u threads to intensity %u, %u cuda threads", applog(LOG_INFO, "Adding %u threads to intensity %u, %u cuda threads",
adds, v, gpus_intensity[n]); adds, v, gpus_intensity[n]);

Loading…
Cancel
Save