Browse Source

Meter out return of estimated hashes in BF1 to smooth out visible hashrate.

nfactor-troky
Con Kolivas 11 years ago
parent
commit
5a8ac9fdaf
  1. 15
      driver-bitfury.c
  2. 1
      driver-bitfury.h

15
driver-bitfury.c

@ -199,9 +199,8 @@ static int64_t bitfury_scanhash(struct thr_info *thr, struct work *work,
{ {
struct cgpu_info *bitfury = thr->cgpu; struct cgpu_info *bitfury = thr->cgpu;
struct bitfury_info *info = bitfury->device_data; struct bitfury_info *info = bitfury->device_data;
int64_t hashes = 0;
char buf[45];
int amount, i; int amount, i;
char buf[45];
buf[0] = 'W'; buf[0] = 'W';
memcpy(buf + 1, work->midstate, 32); memcpy(buf + 1, work->midstate, 32);
@ -238,15 +237,15 @@ static int64_t bitfury_scanhash(struct thr_info *thr, struct work *work,
memcpy(&nonce, info->buf + i + 3, 4); memcpy(&nonce, info->buf + i + 3, 4);
nonce = decnonce(nonce); nonce = decnonce(nonce);
if (bitfury_checkresults(thr, info->prevwork1, nonce)) { if (bitfury_checkresults(thr, info->prevwork1, nonce)) {
hashes += 0xffffffff; info->nonces++;
continue; continue;
} }
if (bitfury_checkresults(thr, info->prevwork2, nonce)) { if (bitfury_checkresults(thr, info->prevwork2, nonce)) {
hashes += 0xffffffff; info->nonces++;
continue; continue;
} }
if (bitfury_checkresults(thr, work, nonce)) { if (bitfury_checkresults(thr, work, nonce)) {
hashes += 0xffffffff; info->nonces++;
continue; continue;
} }
} }
@ -256,7 +255,11 @@ cascade:
info->prevwork2 = info->prevwork1; info->prevwork2 = info->prevwork1;
info->prevwork1 = copy_work(work); info->prevwork1 = copy_work(work);
work->blk.nonce = 0xffffffff; work->blk.nonce = 0xffffffff;
return hashes; if (info->nonces) {
info->nonces--;
return (int64_t)0xffffffff;
}
return 0;
} }
static void bitfury_flush_work(struct cgpu_info __maybe_unused *bitfury) static void bitfury_flush_work(struct cgpu_info __maybe_unused *bitfury)

1
driver-bitfury.h

@ -21,6 +21,7 @@ struct bitfury_info {
struct work *prevwork2; struct work *prevwork2;
char buf[512]; char buf[512];
int tot; int tot;
int nonces;
}; };
#endif /* BITFURY_H */ #endif /* BITFURY_H */

Loading…
Cancel
Save