From 37395eefe4e67b64b934779b5165d66fadde1bbe Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Sat, 28 Mar 2015 12:04:22 +0100 Subject: [PATCH] skein: restore previous x11 speed --- configure.ac | 2 +- quark/cuda_skein512.cu | 24 ++++++++++-------------- skein.cu | 2 +- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index fd49c12..45b5254 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([ccminer], [1.6]) +AC_INIT([ccminer], [1.6.1-git]) AC_PREREQ([2.59c]) AC_CANONICAL_SYSTEM diff --git a/quark/cuda_skein512.cu b/quark/cuda_skein512.cu index f472087..f9f64a0 100644 --- a/quark/cuda_skein512.cu +++ b/quark/cuda_skein512.cu @@ -358,14 +358,13 @@ void quark_skein512_gpu_hash_64(uint32_t threads, uint32_t startNounce, uint64_t if (thread < threads) { // Skein - uint2 p[8]; uint2 h0, h1, h2, h3, h4, h5, h6, h7, h8; uint2 t0, t1, t2; uint32_t nounce = (g_nonceVector != NULL) ? g_nonceVector[thread] : (startNounce + thread); - int hashPosition = nounce - startNounce; - uint64_t *inpHash = &g_hash[8 * hashPosition]; + uint32_t hashPosition = nounce - startNounce; + uint64_t *inpHash = &g_hash[hashPosition * 8U]; // Initialisierung h0 = vectorize(0x4903ADFF749C51CEull); @@ -377,6 +376,7 @@ void quark_skein512_gpu_hash_64(uint32_t threads, uint32_t startNounce, uint64_t h6 = vectorize(0x991112C71A75B523ull); h7 = vectorize(0xAE18A40B660FCC33ull); + uint2 p[8]; // 1. Runde -> etype = 480, ptr = 64, bcount = 0, data = msg #pragma unroll 8 for (int i = 0; i < 8; i++) @@ -417,7 +417,7 @@ void quark_skein512_gpu_hash_64(uint32_t threads, uint32_t startNounce, uint64_t // 2. Runde -> etype = 510, ptr = 8, bcount = 0, data = 0 #pragma unroll 8 for(int i=0; i<8; i++) - p[i] = make_uint2(0,0); + p[i] = vectorize(0ull); t0 = vectorize(8); // ptr t1 = vectorize(510ull << 55); // etype @@ -442,12 +442,11 @@ void quark_skein512_gpu_hash_64(uint32_t threads, uint32_t startNounce, uint64_t TFBIG_4o_UI2(17); TFBIG_ADDKEY_UI2(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], h, t, 18); - // fertig - uint2 *outpHash = (uint2*) (&g_hash[hashPosition * 8]); - + // output + uint64_t *outpHash = &g_hash[hashPosition * 8U]; #pragma unroll 8 for(int i=0; i<8; i++) - outpHash[i] = p[i]; + outpHash[i] = devectorize(p[i]); } } @@ -467,7 +466,7 @@ void quark_skein512_gpu_hash_64_v30(uint32_t threads, uint32_t startNounce, uint int hashPosition = nounce - startNounce; uint64_t *inpHash = &g_hash[8 * hashPosition]; - // Initialisierung + // Init h0 = 0x4903ADFF749C51CEull; h1 = 0x0D95DE399746DF03ull; h2 = 0x8FD1934127C79BCEull; @@ -517,7 +516,7 @@ void quark_skein512_gpu_hash_64_v30(uint32_t threads, uint32_t startNounce, uint // 2. Runde -> etype = 510, ptr = 8, bcount = 0, data = 0 #pragma unroll 8 for(int i=0; i<8; i++) - p[i] = 0; + p[i] = 0ull; t0 = 8; // ptr t1 = 510ull << 55; // etype @@ -574,9 +573,6 @@ void skein512_gpu_hash_close(uint32_t threads, uint32_t startNounce, uint64_t *g TFBIG_KINIT_UI2(h0, h1, h2, h3, h4, h5, h6, h7, h8, t0, t1, t2); uint2 p[8] = { 0 }; - //#pragma unroll 8 - //for (int i = 0; i<8; i++) - // p[i] = make_uint2(0, 0); TFBIG_4e_UI2(0); TFBIG_4o_UI2(1); @@ -674,7 +670,7 @@ void skein512_gpu_hash_80(uint32_t threads, uint32_t startNounce, uint64_t *outp #pragma unroll for (int i = 2; i < 8; i++) - p[i] = make_uint2(0,0); + p[i] = vectorize(0ull); t0 = vectorize(0x50ull); // SPH_T64(bcount << 6) + (sph_u64)(extra); t1 = vectorize(0xB000000000000000ull); // (bcount >> 58) + ((sph_u64)(etype) << 55); diff --git a/skein.cu b/skein.cu index 8b06dc2..ad8e4ca 100644 --- a/skein.cu +++ b/skein.cu @@ -412,7 +412,7 @@ extern "C" int scanhash_skeincoin(int thr_id, uint32_t *pdata, throughput = min(throughput, (max_nonce - first_nonce)); if (opt_benchmark) - ((uint32_t*)ptarget)[7] = 0x0FFF; + ((uint32_t*)ptarget)[7] = 0x07; if (!init[thr_id]) {