mirror of
https://github.com/GOSTSec/ccminer
synced 2025-08-26 13:51:51 +00:00
x17: apply echo512 improvement
add a tiny 1% on x17, better than nothing...
This commit is contained in:
parent
a81ab0f7a5
commit
5d0c0a665d
@ -491,8 +491,9 @@ extern "C" int scanhash_x16r(int thr_id, struct work* work, uint32_t max_nonce,
|
|||||||
case ECHO:
|
case ECHO:
|
||||||
if (use_compat_kernels[thr_id])
|
if (use_compat_kernels[thr_id])
|
||||||
x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++);
|
x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++);
|
||||||
else
|
else {
|
||||||
x16_echo512_cpu_hash_64(thr_id, throughput, d_hash[thr_id]); order++;
|
x16_echo512_cpu_hash_64(thr_id, throughput, d_hash[thr_id]); order++;
|
||||||
|
}
|
||||||
TRACE("echo :");
|
TRACE("echo :");
|
||||||
break;
|
break;
|
||||||
case HAMSI:
|
case HAMSI:
|
||||||
|
@ -489,8 +489,9 @@ extern "C" int scanhash_x16s(int thr_id, struct work* work, uint32_t max_nonce,
|
|||||||
case ECHO:
|
case ECHO:
|
||||||
if (use_compat_kernels[thr_id])
|
if (use_compat_kernels[thr_id])
|
||||||
x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++);
|
x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++);
|
||||||
else
|
else {
|
||||||
x16_echo512_cpu_hash_64(thr_id, throughput, d_hash[thr_id]); order++;
|
x16_echo512_cpu_hash_64(thr_id, throughput, d_hash[thr_id]); order++;
|
||||||
|
}
|
||||||
TRACE("echo :");
|
TRACE("echo :");
|
||||||
break;
|
break;
|
||||||
case HAMSI:
|
case HAMSI:
|
||||||
|
16
x17/x17.cu
16
x17/x17.cu
@ -32,6 +32,8 @@ extern "C" {
|
|||||||
|
|
||||||
static uint32_t *d_hash[MAX_GPUS];
|
static uint32_t *d_hash[MAX_GPUS];
|
||||||
|
|
||||||
|
extern void x16_echo512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t *d_hash);
|
||||||
|
|
||||||
extern void x13_hamsi512_cpu_init(int thr_id, uint32_t threads);
|
extern void x13_hamsi512_cpu_init(int thr_id, uint32_t threads);
|
||||||
extern void x13_hamsi512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order);
|
extern void x13_hamsi512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_hash, int order);
|
||||||
|
|
||||||
@ -151,12 +153,14 @@ extern "C" void x17hash(void *output, const void *input)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool init[MAX_GPUS] = { 0 };
|
static bool init[MAX_GPUS] = { 0 };
|
||||||
|
static bool use_compat_kernels[MAX_GPUS] = { 0 };
|
||||||
|
|
||||||
extern "C" int scanhash_x17(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done)
|
extern "C" int scanhash_x17(int thr_id, struct work* work, uint32_t max_nonce, unsigned long *hashes_done)
|
||||||
{
|
{
|
||||||
uint32_t *pdata = work->data;
|
uint32_t *pdata = work->data;
|
||||||
uint32_t *ptarget = work->target;
|
uint32_t *ptarget = work->target;
|
||||||
const uint32_t first_nonce = pdata[19];
|
const uint32_t first_nonce = pdata[19];
|
||||||
|
const int dev_id = device_map[thr_id];
|
||||||
|
|
||||||
uint32_t throughput = cuda_default_throughput(thr_id, 1U << 19); // 19=256*256*8;
|
uint32_t throughput = cuda_default_throughput(thr_id, 1U << 19); // 19=256*256*8;
|
||||||
//if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce);
|
//if (init[thr_id]) throughput = min(throughput, max_nonce - first_nonce);
|
||||||
@ -166,7 +170,7 @@ extern "C" int scanhash_x17(int thr_id, struct work* work, uint32_t max_nonce, u
|
|||||||
|
|
||||||
if (!init[thr_id])
|
if (!init[thr_id])
|
||||||
{
|
{
|
||||||
cudaSetDevice(device_map[thr_id]);
|
cudaSetDevice(dev_id);
|
||||||
if (opt_cudaschedule == -1 && gpu_threads == 1) {
|
if (opt_cudaschedule == -1 && gpu_threads == 1) {
|
||||||
cudaDeviceReset();
|
cudaDeviceReset();
|
||||||
// reduce cpu usage
|
// reduce cpu usage
|
||||||
@ -174,6 +178,11 @@ extern "C" int scanhash_x17(int thr_id, struct work* work, uint32_t max_nonce, u
|
|||||||
}
|
}
|
||||||
gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput);
|
gpulog(LOG_INFO, thr_id, "Intensity set to %g, %u cuda threads", throughput2intensity(throughput), throughput);
|
||||||
|
|
||||||
|
cuda_get_arch(thr_id);
|
||||||
|
use_compat_kernels[thr_id] = (cuda_arch[dev_id] < 500);
|
||||||
|
if (use_compat_kernels[thr_id])
|
||||||
|
x11_echo512_cpu_init(thr_id, throughput);
|
||||||
|
|
||||||
quark_blake512_cpu_init(thr_id, throughput);
|
quark_blake512_cpu_init(thr_id, throughput);
|
||||||
quark_groestl512_cpu_init(thr_id, throughput);
|
quark_groestl512_cpu_init(thr_id, throughput);
|
||||||
quark_skein512_cpu_init(thr_id, throughput);
|
quark_skein512_cpu_init(thr_id, throughput);
|
||||||
@ -183,7 +192,6 @@ extern "C" int scanhash_x17(int thr_id, struct work* work, uint32_t max_nonce, u
|
|||||||
x11_luffaCubehash512_cpu_init(thr_id, throughput);
|
x11_luffaCubehash512_cpu_init(thr_id, throughput);
|
||||||
x11_shavite512_cpu_init(thr_id, throughput);
|
x11_shavite512_cpu_init(thr_id, throughput);
|
||||||
x11_simd512_cpu_init(thr_id, throughput);
|
x11_simd512_cpu_init(thr_id, throughput);
|
||||||
x11_echo512_cpu_init(thr_id, throughput);
|
|
||||||
x13_hamsi512_cpu_init(thr_id, throughput);
|
x13_hamsi512_cpu_init(thr_id, throughput);
|
||||||
x13_fugue512_cpu_init(thr_id, throughput);
|
x13_fugue512_cpu_init(thr_id, throughput);
|
||||||
x14_shabal512_cpu_init(thr_id, throughput);
|
x14_shabal512_cpu_init(thr_id, throughput);
|
||||||
@ -220,7 +228,11 @@ extern "C" int scanhash_x17(int thr_id, struct work* work, uint32_t max_nonce, u
|
|||||||
x11_luffaCubehash512_cpu_hash_64(thr_id, throughput, d_hash[thr_id], order++);
|
x11_luffaCubehash512_cpu_hash_64(thr_id, throughput, d_hash[thr_id], order++);
|
||||||
x11_shavite512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++);
|
x11_shavite512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++);
|
||||||
x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++);
|
x11_simd512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++);
|
||||||
|
if (use_compat_kernels[thr_id])
|
||||||
x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++);
|
x11_echo512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++);
|
||||||
|
else {
|
||||||
|
x16_echo512_cpu_hash_64(thr_id, throughput, d_hash[thr_id]); order++;
|
||||||
|
}
|
||||||
x13_hamsi512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++);
|
x13_hamsi512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++);
|
||||||
x13_fugue512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++);
|
x13_fugue512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++);
|
||||||
x14_shabal512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++);
|
x14_shabal512_cpu_hash_64(thr_id, throughput, pdata[19], NULL, d_hash[thr_id], order++);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user