|
|
@ -7,9 +7,8 @@ extern "C" { |
|
|
|
#include "lyra2/Lyra2.h" |
|
|
|
#include "lyra2/Lyra2.h" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#include "miner.h" |
|
|
|
#include <miner.h> |
|
|
|
#include "cuda_helper.h" |
|
|
|
#include <cuda_helper.h> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static uint64_t *d_hash[MAX_GPUS]; |
|
|
|
static uint64_t *d_hash[MAX_GPUS]; |
|
|
|
static uint64_t* d_matrix[MAX_GPUS]; |
|
|
|
static uint64_t* d_matrix[MAX_GPUS]; |
|
|
@ -73,21 +72,6 @@ void lyra2v2_hash(void *state, const void *input) |
|
|
|
memcpy(state, hashA, 32); |
|
|
|
memcpy(state, hashA, 32); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#ifdef _DEBUG |
|
|
|
|
|
|
|
#define TRACE(algo) { \ |
|
|
|
|
|
|
|
if (max_nonce == 1 && pdata[19] <= 1) { \ |
|
|
|
|
|
|
|
uint32_t* debugbuf = NULL; \ |
|
|
|
|
|
|
|
cudaMallocHost(&debugbuf, 32); \ |
|
|
|
|
|
|
|
cudaMemcpy(debugbuf, d_hash[thr_id], 32, cudaMemcpyDeviceToHost); \ |
|
|
|
|
|
|
|
printf("lyra2 %s %08x %08x %08x %08x...%08x... \n", algo, swab32(debugbuf[0]), swab32(debugbuf[1]), \ |
|
|
|
|
|
|
|
swab32(debugbuf[2]), swab32(debugbuf[3]), swab32(debugbuf[7])); \ |
|
|
|
|
|
|
|
cudaFreeHost(debugbuf); \ |
|
|
|
|
|
|
|
} \ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
#define TRACE(algo) {} |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static bool init[MAX_GPUS] = { 0 }; |
|
|
|
static bool init[MAX_GPUS] = { 0 }; |
|
|
|
|
|
|
|
|
|
|
|
extern "C" int scanhash_lyra2v2(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) |
|
|
|
extern "C" int scanhash_lyra2v2(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done) |
|
|
@ -145,17 +129,11 @@ extern "C" int scanhash_lyra2v2(int thr_id, struct work* work, uint32_t max_nonc |
|
|
|
int order = 0; |
|
|
|
int order = 0; |
|
|
|
|
|
|
|
|
|
|
|
blake256_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); |
|
|
|
blake256_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); |
|
|
|
TRACE("blake :"); |
|
|
|
|
|
|
|
keccak256_cpu_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], order++); |
|
|
|
keccak256_cpu_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], order++); |
|
|
|
TRACE("keccak :"); |
|
|
|
|
|
|
|
cubehash256_cpu_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], order++); |
|
|
|
cubehash256_cpu_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], order++); |
|
|
|
TRACE("cube :"); |
|
|
|
|
|
|
|
lyra2v2_cpu_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], order++); |
|
|
|
lyra2v2_cpu_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], order++); |
|
|
|
TRACE("lyra2 :"); |
|
|
|
|
|
|
|
skein256_cpu_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], order++); |
|
|
|
skein256_cpu_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], order++); |
|
|
|
TRACE("skein :"); |
|
|
|
|
|
|
|
cubehash256_cpu_hash_32(thr_id, throughput,pdata[19], d_hash[thr_id], order++); |
|
|
|
cubehash256_cpu_hash_32(thr_id, throughput,pdata[19], d_hash[thr_id], order++); |
|
|
|
TRACE("cube :"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
memset(work->nonces, 0, sizeof(work->nonces)); |
|
|
|
memset(work->nonces, 0, sizeof(work->nonces)); |
|
|
|
bmw256_cpu_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], work->nonces); |
|
|
|
bmw256_cpu_hash_32(thr_id, throughput, pdata[19], d_hash[thr_id], work->nonces); |
|
|
|