From 347d4e49285731b796021e9c2631e3bf8aee8f40 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Thu, 11 Sep 2014 02:08:25 +0200 Subject: [PATCH] blake: +8MH/s on linux, weird optimisation Like doom/luffa, using a int pos make the proc faster --- blake32.cu | 9 +++++++-- cpu-miner.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/blake32.cu b/blake32.cu index 6b51e2e..103e4ce 100644 --- a/blake32.cu +++ b/blake32.cu @@ -241,13 +241,18 @@ void blake256_gpu_hash_80(uint32_t threads, uint32_t startNounce, uint32_t *resN blake256_compress(h, ending, 640, blakerounds); + int pos = -1; + #pragma unroll 8 for (int i = 7; i >= 0; i--) { uint32_t hash = cuda_swab32(h[i]); if (hash > c_Target[i]) { return; } if (hash < c_Target[i]) { - break; + /* dont ask me why, we lose 8MH/s in perfs + without the int variable */ + if (pos < i) pos = i; + //break; } } @@ -382,7 +387,7 @@ extern "C" int scanhash_blake256(int thr_id, uint32_t *pdata, const uint32_t *pt } if ((uint64_t) pdata[19] + throughput > (uint64_t) max_nonce) { - pdata[19] = max_nonce - first_nonce + 1; + pdata[19] = max_nonce; break; } diff --git a/cpu-miner.c b/cpu-miner.c index 830b68a..c42997a 100644 --- a/cpu-miner.c +++ b/cpu-miner.c @@ -1453,7 +1453,7 @@ out: return NULL; } -#define PROGRAM_VERSION "1.4.3" +#define PROGRAM_VERSION "1.4.4" static void show_version_and_exit(void) { printf("%s v%s\n"