Browse Source

fix quark and jackpot algos

pull/2/head
Tanguy Pruvot 8 years ago
parent
commit
e584f28441
  1. 6
      JHA/jackpotcoin.cu
  2. 2
      Makefile.am
  3. 6
      algos.h
  4. 2
      bench.cpp
  5. 11
      ccminer.cpp
  6. 1
      ccminer.vcxproj
  7. 3
      ccminer.vcxproj.filters
  8. 2
      miner.h
  9. 2
      quark/cuda_quark.h
  10. 8
      quark/cuda_skein512.cu

6
JHA/jackpotcoin.cu

@ -30,8 +30,8 @@ extern void jackpot_compactTest_cpu_hash_64(int thr_id, uint32_t threads, uint32
extern uint32_t cuda_check_hash_branch(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_inputHash, int order); extern uint32_t cuda_check_hash_branch(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_inputHash, int order);
// Original jackpothash Funktion aus einem miner Quelltext // CPU HASH JHA v8
extern "C" unsigned int jackpothash(void *state, const void *input) extern "C" void jackpothash(void *state, const void *input)
{ {
uint32_t hash[16]; uint32_t hash[16];
unsigned int rnd; unsigned int rnd;
@ -71,8 +71,6 @@ extern "C" unsigned int jackpothash(void *state, const void *input)
} }
} }
memcpy(state, hash, 32); memcpy(state, hash, 32);
return rnd;
} }
static bool init[MAX_GPUS] = { 0 }; static bool init[MAX_GPUS] = { 0 };

2
Makefile.am

@ -45,7 +45,7 @@ ccminer_SOURCES = elist.h miner.h compat.h \
crypto/cryptolight.cu crypto/cryptolight-core.cu crypto/cryptolight-cpu.cpp \ crypto/cryptolight.cu crypto/cryptolight-core.cu crypto/cryptolight-cpu.cpp \
crypto/cryptonight.cu crypto/cryptonight-core.cu crypto/cryptonight-extra.cu \ crypto/cryptonight.cu crypto/cryptonight-core.cu crypto/cryptonight-extra.cu \
crypto/cryptonight-cpu.cpp crypto/oaes_lib.cpp crypto/aesb.cpp crypto/cpu/c_keccak.c \ crypto/cryptonight-cpu.cpp crypto/oaes_lib.cpp crypto/aesb.cpp crypto/cpu/c_keccak.c \
JHA/jha.cu JHA/cuda_jha_keccak512.cu \ JHA/jha.cu JHA/jackpotcoin.cu JHA/cuda_jha_keccak512.cu \
JHA/cuda_jha_compactionTest.cu cuda_checkhash.cu \ JHA/cuda_jha_compactionTest.cu cuda_checkhash.cu \
quark/cuda_jh512.cu quark/cuda_quark_blake512.cu quark/cuda_quark_groestl512.cu quark/cuda_skein512.cu \ quark/cuda_jh512.cu quark/cuda_quark_blake512.cu quark/cuda_quark_groestl512.cu quark/cuda_skein512.cu \
quark/cuda_bmw512.cu quark/cuda_quark_keccak512.cu \ quark/cuda_bmw512.cu quark/cuda_quark_keccak512.cu \

6
algos.h

@ -22,6 +22,7 @@ enum sha_algos {
ALGO_HEAVY, /* Heavycoin hash */ ALGO_HEAVY, /* Heavycoin hash */
ALGO_HMQ1725, ALGO_HMQ1725,
ALGO_KECCAK, ALGO_KECCAK,
ALGO_JACKPOT,
ALGO_JHA, ALGO_JHA,
ALGO_LBRY, ALGO_LBRY,
ALGO_LUFFA, ALGO_LUFFA,
@ -83,6 +84,7 @@ static const char *algo_names[] = {
"heavy", "heavy",
"hmq1725", "hmq1725",
"keccak", "keccak",
"jackpot",
"jha", "jha",
"lbry", "lbry",
"luffa", "luffa",
@ -151,8 +153,8 @@ static inline int algo_to_int(char* arg)
i = ALGO_LUFFA; i = ALGO_LUFFA;
else if (!strcasecmp("hmq17", arg)) else if (!strcasecmp("hmq17", arg))
i = ALGO_HMQ1725; i = ALGO_HMQ1725;
else if (!strcasecmp("jackpot", arg)) //else if (!strcasecmp("jackpot", arg))
i = ALGO_JHA; // i = ALGO_JHA;
else if (!strcasecmp("lyra2re", arg)) else if (!strcasecmp("lyra2re", arg))
i = ALGO_LYRA2; i = ALGO_LYRA2;
else if (!strcasecmp("lyra2rev2", arg)) else if (!strcasecmp("lyra2rev2", arg))

2
bench.cpp

@ -65,7 +65,7 @@ void algo_free_all(int thr_id)
free_groestlcoin(thr_id); free_groestlcoin(thr_id);
free_heavy(thr_id); free_heavy(thr_id);
free_hmq17(thr_id); free_hmq17(thr_id);
//free_jackpot(thr_id); free_jackpot(thr_id);
free_jha(thr_id); free_jha(thr_id);
free_lbry(thr_id); free_lbry(thr_id);
free_luffa(thr_id); free_luffa(thr_id);

11
ccminer.cpp

@ -240,7 +240,7 @@ Options:\n\
groestl Groestlcoin\n\ groestl Groestlcoin\n\
heavy Heavycoin\n\ heavy Heavycoin\n\
hmq1725 Doubloons / Espers\n\ hmq1725 Doubloons / Espers\n\
jackpot Jackpot\n\ jha JHA v8 (JackpotCoin)\n\
keccak Keccak-256 (Maxcoin)\n\ keccak Keccak-256 (Maxcoin)\n\
lbry LBRY Credits (Sha/Ripemd)\n\ lbry LBRY Credits (Sha/Ripemd)\n\
luffa Joincoin\n\ luffa Joincoin\n\
@ -1612,6 +1612,7 @@ static bool stratum_gen_work(struct stratum_ctx *sctx, struct work *work)
switch (opt_algo) { switch (opt_algo) {
case ALGO_HMQ1725: case ALGO_HMQ1725:
case ALGO_JACKPOT:
case ALGO_JHA: case ALGO_JHA:
case ALGO_NEOSCRYPT: case ALGO_NEOSCRYPT:
case ALGO_SCRYPT: case ALGO_SCRYPT:
@ -2128,6 +2129,7 @@ static void *miner_thread(void *userdata)
case ALGO_C11: case ALGO_C11:
case ALGO_DEEP: case ALGO_DEEP:
case ALGO_HEAVY: case ALGO_HEAVY:
case ALGO_JACKPOT:
case ALGO_JHA: case ALGO_JHA:
case ALGO_LYRA2v2: case ALGO_LYRA2v2:
case ALGO_S3: case ALGO_S3:
@ -2269,9 +2271,14 @@ static void *miner_thread(void *userdata)
case ALGO_KECCAK: case ALGO_KECCAK:
rc = scanhash_keccak256(thr_id, &work, max_nonce, &hashes_done); rc = scanhash_keccak256(thr_id, &work, max_nonce, &hashes_done);
break; break;
case ALGO_JACKPOT:
rc = scanhash_jackpot(thr_id, &work, max_nonce, &hashes_done);
break;
case ALGO_JHA: case ALGO_JHA:
rc = scanhash_jha(thr_id, &work, max_nonce, &hashes_done); rc = scanhash_jha(thr_id, &work, max_nonce, &hashes_done);
break; break;
case ALGO_LBRY: case ALGO_LBRY:
rc = scanhash_lbry(thr_id, &work, max_nonce, &hashes_done); rc = scanhash_lbry(thr_id, &work, max_nonce, &hashes_done);
break; break;
@ -2426,7 +2433,7 @@ static void *miner_thread(void *userdata)
/* hashrate factors for some algos */ /* hashrate factors for some algos */
double rate_factor = 1.0; double rate_factor = 1.0;
switch (opt_algo) { switch (opt_algo) {
//case ALGO_JACKPOT: case ALGO_JACKPOT:
case ALGO_QUARK: case ALGO_QUARK:
// to stay comparable to other ccminer forks or pools // to stay comparable to other ccminer forks or pools
rate_factor = 0.5; rate_factor = 0.5;

1
ccminer.vcxproj

@ -436,6 +436,7 @@
<CudaCompile Include="heavy\bastion.cu" /> <CudaCompile Include="heavy\bastion.cu" />
<CudaCompile Include="heavy\cuda_bastion.cu" /> <CudaCompile Include="heavy\cuda_bastion.cu" />
<CudaCompile Include="JHA\jha.cu" /> <CudaCompile Include="JHA\jha.cu" />
<CudaCompile Include="JHA\jackpotcoin.cu" />
<CudaCompile Include="JHA\cuda_jha_compactionTest.cu"> <CudaCompile Include="JHA\cuda_jha_compactionTest.cu">
<AdditionalOptions>-Xptxas "-abi=yes" %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>-Xptxas "-abi=yes" %(AdditionalOptions)</AdditionalOptions>
</CudaCompile> </CudaCompile>

3
ccminer.vcxproj.filters

@ -577,6 +577,9 @@
<CudaCompile Include="JHA\jha.cu"> <CudaCompile Include="JHA\jha.cu">
<Filter>Source Files\CUDA\JHA</Filter> <Filter>Source Files\CUDA\JHA</Filter>
</CudaCompile> </CudaCompile>
<CudaCompile Include="JHA\jackpotcoin.cu">
<Filter>Source Files\CUDA\JHA</Filter>
</CudaCompile>
<CudaCompile Include="cuda_myriadgroestl.cu"> <CudaCompile Include="cuda_myriadgroestl.cu">
<Filter>Source Files\CUDA</Filter> <Filter>Source Files\CUDA</Filter>
</CudaCompile> </CudaCompile>

2
miner.h

@ -871,7 +871,7 @@ void fugue256_hash(unsigned char* output, const unsigned char* input, int len);
void heavycoin_hash(unsigned char* output, const unsigned char* input, int len); void heavycoin_hash(unsigned char* output, const unsigned char* input, int len);
void hmq17hash(void *output, const void *input); void hmq17hash(void *output, const void *input);
void keccak256_hash(void *state, const void *input); void keccak256_hash(void *state, const void *input);
unsigned int jackpothash(void *state, const void *input); void jackpothash(void *state, const void *input);
void groestlhash(void *state, const void *input); void groestlhash(void *state, const void *input);
void jha_hash(void *output, const void *input); void jha_hash(void *output, const void *input);
void lbry_hash(void *output, const void *input); void lbry_hash(void *output, const void *input);

2
quark/cuda_quark.h

@ -17,7 +17,7 @@ extern void quark_doublegroestl512_cpu_hash_64(int thr_id, uint32_t threads, uin
extern void quark_groestl512_cpu_free(int thr_id); extern void quark_groestl512_cpu_free(int thr_id);
extern void quark_skein512_cpu_init(int thr_id, uint32_t threads); extern void quark_skein512_cpu_init(int thr_id, uint32_t threads);
extern void quark_skein512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); extern void quark_skein512_cpu_hash_64(int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_nonceVector, uint32_t *d_hash, int order);
extern void quark_keccak512_cpu_init(int thr_id, uint32_t threads); extern void quark_keccak512_cpu_init(int thr_id, uint32_t threads);
extern void quark_keccak512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order); extern void quark_keccak512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order);

8
quark/cuda_skein512.cu

@ -463,7 +463,7 @@ __launch_bounds__(TPB52, 3)
#else #else
__launch_bounds__(TPB50, 5) __launch_bounds__(TPB50, 5)
#endif #endif
void quark_skein512_gpu_hash_64(const uint32_t threads,uint64_t* __restrict__ g_hash, const uint32_t *const __restrict__ g_nonceVector) void quark_skein512_gpu_hash_64(const uint32_t threads, const uint32_t startNonce, uint64_t* __restrict__ g_hash, const uint32_t *const __restrict__ g_nonceVector)
{ {
const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x); const uint32_t thread = (blockDim.x * blockIdx.x + threadIdx.x);
@ -472,7 +472,7 @@ void quark_skein512_gpu_hash_64(const uint32_t threads,uint64_t* __restrict__ g_
// Skein // Skein
uint2 p[8], h[9]; uint2 p[8], h[9];
const uint32_t hashPosition = (g_nonceVector == NULL) ? thread : g_nonceVector[thread]; const uint32_t hashPosition = (g_nonceVector == NULL) ? thread : g_nonceVector[thread] - startNonce;
uint64_t *Hash = &g_hash[hashPosition<<3]; uint64_t *Hash = &g_hash[hashPosition<<3];
@ -756,7 +756,7 @@ void quark_skein512_gpu_hash_64(const uint32_t threads,uint64_t* __restrict__ g_
__host__ __host__
//void quark_skein512_cpu_hash_64(int thr_id,uint32_t threads, uint32_t *d_nonceVector, uint32_t *d_hash) //void quark_skein512_cpu_hash_64(int thr_id,uint32_t threads, uint32_t *d_nonceVector, uint32_t *d_hash)
void quark_skein512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order) void quark_skein512_cpu_hash_64(int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_nonceVector, uint32_t *d_hash, int order)
{ {
uint32_t tpb = TPB52; uint32_t tpb = TPB52;
int dev_id = device_map[thr_id]; int dev_id = device_map[thr_id];
@ -764,7 +764,7 @@ void quark_skein512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNoun
if (device_sm[dev_id] <= 500) tpb = TPB50; if (device_sm[dev_id] <= 500) tpb = TPB50;
const dim3 grid((threads + tpb-1)/tpb); const dim3 grid((threads + tpb-1)/tpb);
const dim3 block(tpb); const dim3 block(tpb);
quark_skein512_gpu_hash_64 << <grid, block >> >(threads, (uint64_t*)d_hash, d_nonceVector); quark_skein512_gpu_hash_64 <<<grid, block >>>(threads, startNonce, (uint64_t*)d_hash, d_nonceVector);
} }

Loading…
Cancel
Save