Skip to content

Commit

Permalink
x16rv2 by penfold
Browse files Browse the repository at this point in the history
  • Loading branch information
traysi committed Aug 21, 2019
1 parent 64b8f77 commit ddede28
Show file tree
Hide file tree
Showing 13 changed files with 726 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Expand Up @@ -77,7 +77,7 @@ ccminer_SOURCES = elist.h miner.h compat.h \
x13/hsr.cu x13/cuda_hsr_sm3.cu x13/sm3.c \
x15/x14.cu x15/x15.cu x15/cuda_x14_shabal512.cu x15/cuda_x15_whirlpool.cu \
x15/whirlpool.cu x15/cuda_x15_whirlpool_sm3.cu \
x16/x16r.cu x16/x16s.cu x16/cuda_x16_echo512.cu x16/cuda_x16_fugue512.cu \
x16/x16r.cu x16/x16rv2.cu x16/x16s.cu x16/cuda_x16_echo512.cu x16/cuda_x16_fugue512.cu \
x16/cuda_x16_shabal512.cu x16/cuda_x16_simd512_80.cu \
x16/cuda_x16_echo512_64.cu \
x17/x17.cu x17/hmq17.cu x17/sonoa.cu x17/cuda_x17_haval256.cu x17/cuda_x17_sha512.cu \
Expand Down
2 changes: 2 additions & 0 deletions algos.h
Expand Up @@ -64,6 +64,7 @@ enum sha_algos {
ALGO_X14,
ALGO_X15,
ALGO_X16R,
ALGO_X16RV2,
ALGO_X16S,
ALGO_X17,
ALGO_X21S,
Expand Down Expand Up @@ -143,6 +144,7 @@ static const char *algo_names[] = {
"x14",
"x15",
"x16r",
"x16rv2",
"x16s",
"x17",
"x21s",
Expand Down
1 change: 1 addition & 0 deletions bench.cpp
Expand Up @@ -107,6 +107,7 @@ void algo_free_all(int thr_id)
free_x14(thr_id);
free_x15(thr_id);
free_x16r(thr_id);
free_x16rv2(thr_id);
free_x16s(thr_id);
free_x17(thr_id);
free_x21s(thr_id);
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Expand Up @@ -13,4 +13,4 @@ rm -f config.status
# CFLAGS="-O2" ./configure
./configure.sh

make -j 4
make -j $(nproc)
5 changes: 5 additions & 0 deletions ccminer.cpp
Expand Up @@ -304,6 +304,7 @@ Options:\n\
x14 X14\n\
x15 X15\n\
x16r X16R (Raven)\n\
x16rv2 X16Rv2 (Raven)\n\
x16s X16S\n\
x17 X17\n\
x21s X21S (Ritocoin)\n\
Expand Down Expand Up @@ -1744,6 +1745,7 @@ static bool stratum_gen_work(struct stratum_ctx *sctx, struct work *work)
case ALGO_TIMETRAVEL:
case ALGO_BITCORE:
case ALGO_X16R:
case ALGO_X16RV2:
case ALGO_X16S:
case ALGO_X21S:
work_set_target(work, sctx->job.diff / (256.0 * opt_difficulty));
Expand Down Expand Up @@ -2564,6 +2566,9 @@ static void *miner_thread(void *userdata)
case ALGO_X16R:
rc = scanhash_x16r(thr_id, &work, max_nonce, &hashes_done);
break;
case ALGO_X16RV2:
rc = scanhash_x16rv2(thr_id, &work, max_nonce, &hashes_done);
break;
case ALGO_X16S:
rc = scanhash_x16s(thr_id, &work, max_nonce, &hashes_done);
break;
Expand Down
1 change: 1 addition & 0 deletions ccminer.vcxproj
Expand Up @@ -597,6 +597,7 @@
<CudaCompile Include="x15\whirlpool.cu" />
<CudaCompile Include="x15\cuda_x15_whirlpool_sm3.cu" />
<CudaCompile Include="x16\x16r.cu" />
<CudaCompile Include="x16\x16rv2.cu" />
<CudaCompile Include="x16\x16s.cu" />
<CudaCompile Include="x16\cuda_x16_echo512.cu" />
<CudaCompile Include="x16\cuda_x16_fugue512.cu" />
Expand Down
3 changes: 3 additions & 0 deletions ccminer.vcxproj.filters
Expand Up @@ -1030,6 +1030,9 @@
<CudaCompile Include="x16\x16r.cu">
<Filter>Source Files\CUDA\x16</Filter>
</CudaCompile>
<CudaCompile Include="x16\x16rv2.cu">
<Filter>Source Files\CUDA\x16</Filter>
</CudaCompile>
<CudaCompile Include="x16\x16s.cu">
<Filter>Source Files\CUDA\x16</Filter>
</CudaCompile>
Expand Down
3 changes: 3 additions & 0 deletions miner.h
Expand Up @@ -330,6 +330,7 @@ extern int scanhash_x13(int thr_id, struct work* work, uint32_t max_nonce, unsig
extern int scanhash_x14(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_x15(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_x16r(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_x16rv2(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_x16s(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_x17(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
extern int scanhash_x21s(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done);
Expand Down Expand Up @@ -401,6 +402,7 @@ extern void free_x13(int thr_id);
extern void free_x14(int thr_id);
extern void free_x15(int thr_id);
extern void free_x16r(int thr_id);
extern void free_x16rv2(int thr_id);
extern void free_x16s(int thr_id);
extern void free_x17(int thr_id);
extern void free_x21s(int thr_id);
Expand Down Expand Up @@ -957,6 +959,7 @@ void x13hash(void *output, const void *input);
void x14hash(void *output, const void *input);
void x15hash(void *output, const void *input);
void x16r_hash(void *output, const void *input);
void x16rv2_hash(void *output, const void *input);
void x16s_hash(void *output, const void *input);
void x17hash(void *output, const void *input);
void x21s_hash(void *output, const void *input);
Expand Down
3 changes: 3 additions & 0 deletions util.cpp
Expand Up @@ -2348,6 +2348,9 @@ void print_hash_tests(void)
x16r_hash(&hash[0], &buf[0]);
printpfx("x16r", hash);

x16rv2_hash(&hash[0], &buf[0]);
printpfx("x16rv2", hash);

x16s_hash(&hash[0], &buf[0]);
printpfx("x16s", hash);

Expand Down
4 changes: 4 additions & 0 deletions x16/cuda_x16.h
Expand Up @@ -22,6 +22,8 @@ extern void x17_haval256_cpu_hash_64(int thr_id, uint32_t threads, uint32_t star

void quark_blake512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNonce, uint32_t *d_nonceVector, uint32_t *d_outputHash, int order);

extern void tiger192_cpu_hash_64(int thr_id, int threads, int zero_pad_64, uint32_t *d_hash);

// ---- optimised but non compatible kernels

void x16_echo512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t *d_hash);
Expand Down Expand Up @@ -78,3 +80,5 @@ void x16_whirlpool512_hash_80(int thr_id, const uint32_t threads, const uint32_t
void x16_sha512_setBlock_80(void *pdata);
void x16_sha512_cuda_hash_80(int thr_id, const uint32_t threads, const uint32_t startNonce, uint32_t *d_hash);

void tiger192_setBlock_80(void *pdata);
void tiger192_cpu_hash_80(int thr_id, int threads, uint32_t startNonce, uint32_t *d_hash);

0 comments on commit ddede28

Please sign in to comment.