From fa7d744a6c3bd4ade9522d11fabac886d74f4f02 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Mon, 15 Dec 2014 09:47:26 +0100 Subject: [PATCH] lyra2: make_uint2 and set pool difficulty --- Algo256/cuda_keccak256.cu | 18 ++++++------------ ccminer.cpp | 1 + 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Algo256/cuda_keccak256.cu b/Algo256/cuda_keccak256.cu index 7437622..8688a8a 100644 --- a/Algo256/cuda_keccak256.cu +++ b/Algo256/cuda_keccak256.cu @@ -7,12 +7,6 @@ extern "C" { #include "cuda_helper.h" -#ifdef _MSC_VER -#define UINT2(x,y) { x, y } -#else -#define UINT2(x,y) (uint2) { x, y } -#endif - static const uint64_t host_keccak_round_constants[24] = { 0x0000000000000001ull, 0x0000000000008082ull, 0x800000000000808aull, 0x8000000080008000ull, @@ -188,13 +182,13 @@ void keccak256_gpu_hash_80(int threads, uint32_t startNounce, void *outputHash, #pragma unroll 25 for (int i=0; i<25; i++) { if (i<9) keccak_gpu_state[i] = vectorize(c_PaddedMessage80[i]); - else keccak_gpu_state[i] = UINT2(0, 0); + else keccak_gpu_state[i] = make_uint2(0, 0); } keccak_gpu_state[9]= vectorize(c_PaddedMessage80[9]); keccak_gpu_state[9].y = cuda_swab32(nounce); - keccak_gpu_state[10] = UINT2(1, 0); - keccak_gpu_state[16] = UINT2(0, 0x80000000); + keccak_gpu_state[10] = make_uint2(1, 0); + keccak_gpu_state[16] = make_uint2(0, 0x80000000); keccak_blockv35(keccak_gpu_state,keccak_round_constants); if (devectorize(keccak_gpu_state[3]) <= ((uint64_t*)pTarget)[3]) {resNounce[0] = nounce;} @@ -248,10 +242,10 @@ void keccak256_gpu_hash_32(int threads, uint32_t startNounce, uint64_t *outputHa #pragma unroll 25 for (int i = 0; i<25; i++) { if (i<4) keccak_gpu_state[i] = vectorize(outputHash[i*threads+thread]); - else keccak_gpu_state[i] = UINT2(0, 0); + else keccak_gpu_state[i] = make_uint2(0, 0); } - keccak_gpu_state[4] = UINT2(1, 0); - keccak_gpu_state[16] = UINT2(0, 0x80000000); + keccak_gpu_state[4] = make_uint2(1, 0); + keccak_gpu_state[16] = make_uint2(0, 0x80000000); keccak_blockv35(keccak_gpu_state, keccak_round_constants); #pragma unroll 4 diff --git a/ccminer.cpp b/ccminer.cpp index 9d687a0..85f3a41 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -1046,6 +1046,7 @@ static void stratum_gen_work(struct stratum_ctx *sctx, struct work *work) diff_to_target(work->target, sctx->job.diff / (256.0 * opt_difficulty)); break; case ALGO_KECCAK: + case ALGO_LYRA2: diff_to_target(work->target, sctx->job.diff / (128.0 * opt_difficulty)); break; default: