From 56ed0fed056130dbac879caca3d1a27001eb5318 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Mon, 1 Dec 2014 05:58:01 +0100 Subject: [PATCH] blake: remove hashharder workaround --- blake32.cu | 14 ++++---------- ccminer.cpp | 10 +++------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/blake32.cu b/blake32.cu index 8974109..b37f50c 100644 --- a/blake32.cu +++ b/blake32.cu @@ -48,7 +48,7 @@ __device__ static uint32_t prevsum = 0; extern "C" uint32_t crc32_u32t(const uint32_t *buf, size_t size); #endif -/* 8 adapters max (-t threads) */ +/* 8 adapters max */ static uint32_t *d_resNonce[8]; static uint32_t *h_resNonce[8]; @@ -303,17 +303,11 @@ void blake256_gpu_hash_16(const uint32_t threads, const uint32_t startNonce, uin ending[3] = nonce; /* our tested value */ blake256_compress(h, ending, 640, rounds); -#if 0 - if (trace) { - printf("blake hash[6][7]: %08x %08x\n", h[6], h[7]); - } -#endif - //if (h[7] == 0 && high64 <= highTarget) { - if (h[7] == 0) { + + if (h[7] == 0 && cuda_swab32(h[6]) <= highTarget) { #if NBN == 2 /* keep the smallest nonce, + extra one if found */ if (resNonce[0] > nonce) { - // printf("%llx %llx \n", high64, highTarget); resNonce[1] = resNonce[0]; resNonce[0] = nonce; } @@ -468,7 +462,7 @@ extern "C" int scanhash_blake256(int thr_id, uint32_t *pdata, const uint32_t *pt blake256hash(vhashcpu, endiandata, blakerounds); //applog(LOG_BLUE, "%08x %16llx", vhashcpu[6], targetHigh); - if (vhashcpu[6] <= Htarg /*&& fulltest(vhashcpu, ptarget)*/) + if (vhashcpu[6] <= Htarg && fulltest(vhashcpu, ptarget)) { pdata[19] = foundNonce; rc = 1; diff --git a/ccminer.cpp b/ccminer.cpp index aba7a87..49df5fd 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -1134,13 +1134,9 @@ static void *miner_thread(void *userdata) // we can't scan more than uint capacity max64 = min(UINT32_MAX, max64); - //if (opt_debug) - // applog(LOG_DEBUG, "GPU #%d: start=%08x end=%08x max64=%llx", - // device_map[thr_id], *nonceptr, end_nonce, max64); - start_nonce = *nonceptr; - - /* do not recompute something already scanned */ +#if 0 + /* do not recompute something already scanned (hashharder workaround) */ if (opt_algo == ALGO_BLAKE && opt_n_threads == 1) { union { uint64_t data; @@ -1176,7 +1172,7 @@ static void *miner_thread(void *userdata) } } } - +#endif /* never let small ranges at end */ if (end_nonce >= UINT32_MAX - 256) end_nonce = UINT32_MAX;