|
|
@ -1,12 +1,12 @@ |
|
|
|
|
|
|
|
#include <string.h> |
|
|
|
|
|
|
|
#include <stdint.h> |
|
|
|
|
|
|
|
|
|
|
|
#include "uint256.h" |
|
|
|
#include "uint256.h" |
|
|
|
#include "sph/sph_fugue.h" |
|
|
|
#include "sph/sph_fugue.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "miner.h" |
|
|
|
#include "miner.h" |
|
|
|
|
|
|
|
|
|
|
|
#include <string.h> |
|
|
|
#include "cuda_fugue256.h" |
|
|
|
#include <stdint.h> |
|
|
|
|
|
|
|
#include <algorithm> |
|
|
|
|
|
|
|
#include <cuda_fugue256.h> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" void my_fugue256_init(void *cc); |
|
|
|
extern "C" void my_fugue256_init(void *cc); |
|
|
|
extern "C" void my_fugue256(void *cc, const void *data, size_t len); |
|
|
|
extern "C" void my_fugue256(void *cc, const void *data, size_t len); |
|
|
@ -16,12 +16,6 @@ extern "C" void my_fugue256_addbits_and_close(void *cc, unsigned ub, unsigned n, |
|
|
|
extern int device_map[8]; |
|
|
|
extern int device_map[8]; |
|
|
|
extern int device_sm[8]; |
|
|
|
extern int device_sm[8]; |
|
|
|
|
|
|
|
|
|
|
|
#ifdef _MSC_VER |
|
|
|
|
|
|
|
#define MIN min |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
#define MIN std::min |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// vorbereitete Kontexte nach den ersten 80 Bytes
|
|
|
|
// vorbereitete Kontexte nach den ersten 80 Bytes
|
|
|
|
sph_fugue256_context ctx_fugue_const[8]; |
|
|
|
sph_fugue256_context ctx_fugue_const[8]; |
|
|
|
|
|
|
|
|
|
|
@ -35,7 +29,7 @@ extern "C" int scanhash_fugue256(int thr_id, uint32_t *pdata, const uint32_t *pt |
|
|
|
uint32_t start_nonce = pdata[19]++; |
|
|
|
uint32_t start_nonce = pdata[19]++; |
|
|
|
int intensity = (device_sm[device_map[thr_id]] > 500) ? 22 : 19; |
|
|
|
int intensity = (device_sm[device_map[thr_id]] > 500) ? 22 : 19; |
|
|
|
uint32_t throughPut = opt_work_size ? opt_work_size : (1 << intensity); |
|
|
|
uint32_t throughPut = opt_work_size ? opt_work_size : (1 << intensity); |
|
|
|
throughPut = MIN(throughPut, max_nonce - start_nonce); |
|
|
|
throughPut = min(throughPut, max_nonce - start_nonce); |
|
|
|
|
|
|
|
|
|
|
|
if (opt_benchmark) |
|
|
|
if (opt_benchmark) |
|
|
|
((uint32_t*)ptarget)[7] = 0xf; |
|
|
|
((uint32_t*)ptarget)[7] = 0xf; |
|
|
@ -98,6 +92,7 @@ extern "C" int scanhash_fugue256(int thr_id, uint32_t *pdata, const uint32_t *pt |
|
|
|
void fugue256_hash(unsigned char* output, const unsigned char* input, int len) |
|
|
|
void fugue256_hash(unsigned char* output, const unsigned char* input, int len) |
|
|
|
{ |
|
|
|
{ |
|
|
|
sph_fugue256_context ctx; |
|
|
|
sph_fugue256_context ctx; |
|
|
|
|
|
|
|
|
|
|
|
sph_fugue256_init(&ctx); |
|
|
|
sph_fugue256_init(&ctx); |
|
|
|
sph_fugue256(&ctx, input, len); |
|
|
|
sph_fugue256(&ctx, input, len); |
|
|
|
sph_fugue256_close(&ctx, (void *)output); |
|
|
|
sph_fugue256_close(&ctx, (void *)output); |
|
|
|