diff --git a/ccminer.cpp b/ccminer.cpp index eb35fc6..7b0de24 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -1866,9 +1866,16 @@ void parse_arg(int key, char *arg) int n = 0; int ngpus = cuda_num_devices(); 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++) - 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; } while (pch != NULL) { @@ -1876,7 +1883,7 @@ void parse_arg(int key, char *arg) v = (uint32_t) d; if (v > 7) { /* 0 = default */ 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; applog(LOG_INFO, "Adding %u threads to intensity %u, %u cuda threads", adds, v, gpus_intensity[n]);