diff options
author | psychocrypt <psychocryptHPC@gmail.com> | 2018-03-27 20:54:47 +0200 |
---|---|---|
committer | psychocrypt <psychocryptHPC@gmail.com> | 2018-03-27 21:17:36 +0200 |
commit | 5a2c4444a4e2b5ddc5e5dbf98990dcad45e32fe8 (patch) | |
tree | 8185467fb893d95a9e3ada6a19d77973432c3e24 /xmrstak/backend/amd | |
parent | 09a5dcce2c51d87d77244970d2c09bea3207da7a (diff) | |
download | xmr-stak-5a2c4444a4e2b5ddc5e5dbf98990dcad45e32fe8.zip xmr-stak-5a2c4444a4e2b5ddc5e5dbf98990dcad45e32fe8.tar.gz |
POW AEON v7
- add new pow for AEON
- fix missing cryptonight-heavy selection for multi hashes
Diffstat (limited to 'xmrstak/backend/amd')
-rw-r--r-- | xmrstak/backend/amd/amd_gpu/gpu.cpp | 6 | ||||
-rw-r--r-- | xmrstak/backend/amd/minethd.cpp | 33 |
2 files changed, 16 insertions, 23 deletions
diff --git a/xmrstak/backend/amd/amd_gpu/gpu.cpp b/xmrstak/backend/amd/amd_gpu/gpu.cpp index 8d0fd32..80d852a 100644 --- a/xmrstak/backend/amd/amd_gpu/gpu.cpp +++ b/xmrstak/backend/amd/amd_gpu/gpu.cpp @@ -936,7 +936,7 @@ size_t XMRSetJob(GpuContext* ctx, uint8_t* input, size_t input_len, uint64_t tar /// @todo only activate if currency is monero int cn_kernel_offset = 0; - if(miner_algo == cryptonight_monero && version >= 7) + if((miner_algo == cryptonight_monero || miner_algo == cryptonight_aeon ) && version >= 7) { cn_kernel_offset = 6; } @@ -962,7 +962,7 @@ size_t XMRSetJob(GpuContext* ctx, uint8_t* input, size_t input_len, uint64_t tar return(ERR_OCL_API); } - if(miner_algo == cryptonight_monero && version >= 7) + if((miner_algo == cryptonight_monero || miner_algo == cryptonight_aeon ) && version >= 7) { // Input if ((ret = clSetKernelArg(ctx->Kernels[1 + cn_kernel_offset], 3, sizeof(cl_mem), &ctx->InputBuffer)) != CL_SUCCESS) @@ -1130,7 +1130,7 @@ size_t XMRRunJob(GpuContext* ctx, cl_uint* HashOutput, xmrstak_algo miner_algo, size_t tmpNonce = ctx->Nonce; /// @todo only activate if currency is monero int cn_kernel_offset = 0; - if(miner_algo == cryptonight_monero && version >= 7) + if((miner_algo == cryptonight_monero || miner_algo == cryptonight_aeon) && version >= 7) { cn_kernel_offset = 6; } diff --git a/xmrstak/backend/amd/minethd.cpp b/xmrstak/backend/amd/minethd.cpp index 46a04d5..78774c0 100644 --- a/xmrstak/backend/amd/minethd.cpp +++ b/xmrstak/backend/amd/minethd.cpp @@ -192,14 +192,9 @@ void minethd::work_main() cryptonight_ctx* cpu_ctx; cpu_ctx = cpu::minethd::minethd_alloc_ctx(); auto miner_algo = ::jconf::inst()->GetMiningAlgo(); - cn_hash_fun hash_fun; - if(miner_algo == cryptonight_monero || miner_algo == cryptonight_heavy) - { - // start with cryptonight and switch later if fork version is reached - hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, cryptonight); - } - else - hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, miner_algo); + + // start with root algorithm and switch later if fork version is reached + cn_hash_fun hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, ::jconf::inst()->GetMiningAlgoRoot()); globalStates::inst().iConsumeCnt++; @@ -219,13 +214,12 @@ void minethd::work_main() consume_work(); uint8_t new_version = oWork.getVersion(); - if(miner_algo == cryptonight_monero && version < 7 && new_version >= 7) - { - hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, cryptonight_monero); - } - else if(miner_algo == cryptonight_heavy && version < 3 && new_version >= 3) + const bool time_to_fork = + ((miner_algo == cryptonight_monero || miner_algo == cryptonight_aeon) && version < 7 && new_version >= 7) || + (miner_algo == cryptonight_heavy && version < 3 && new_version >= 3); + if(time_to_fork) { - hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, cryptonight_heavy); + hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, miner_algo); } version = new_version; continue; @@ -281,13 +275,12 @@ void minethd::work_main() consume_work(); uint8_t new_version = oWork.getVersion(); - if(miner_algo == cryptonight_monero && version < 7 && new_version >= 7) - { - hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, cryptonight_monero); - } - else if(miner_algo == cryptonight_heavy && version < 3 && new_version >= 3) + const bool time_to_fork = + ((miner_algo == cryptonight_monero || miner_algo == cryptonight_aeon) && version < 7 && new_version >= 7) || + (miner_algo == cryptonight_heavy && version < 3 && new_version >= 3); + if(time_to_fork) { - hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, cryptonight_heavy); + hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/, miner_algo); } version = new_version; } |