1
0
mirror of https://github.com/GOSTSec/ccminer synced 2025-01-22 12:34:17 +00:00

cmdline: fix multi-gpu intensity

the comma presence check was wrong...
This commit is contained in:
Tanguy Pruvot 2015-03-08 16:45:06 +01:00
parent 77c737ff72
commit c1cfb3a131

View File

@ -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]);