diff options
author | fireice-uk <fireice-uk@users.noreply.github.com> | 2018-05-30 21:18:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-30 21:18:45 +0100 |
commit | c0ab1734332d6472225d8ac7394f6fcba71aabc9 (patch) | |
tree | b53a4c37905a0cb5dfa6a66f514cf3dc1ea94a21 /xmrstak/backend/cryptonight.hpp | |
parent | 26a5d65f12b2f19a0a3ece39a2bc64718796367b (diff) | |
parent | 4f34bd18024fa71a8cab81d5a0b86cf5c7d9370e (diff) | |
download | xmr-stak-2.4.4.zip xmr-stak-2.4.4.tar.gz |
Merge pull request #1610 from fireice-uk/dev2.4.4
release 2.4.4
Diffstat (limited to 'xmrstak/backend/cryptonight.hpp')
-rw-r--r-- | xmrstak/backend/cryptonight.hpp | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/xmrstak/backend/cryptonight.hpp b/xmrstak/backend/cryptonight.hpp index 8a8e259..633ddf4 100644 --- a/xmrstak/backend/cryptonight.hpp +++ b/xmrstak/backend/cryptonight.hpp @@ -3,14 +3,16 @@ #include <inttypes.h> #include <type_traits> -enum xmrstak_algo +enum xmrstak_algo { invalid_algo = 0, cryptonight = 1, cryptonight_lite = 2, cryptonight_monero = 3, cryptonight_heavy = 4, - cryptonight_aeon = 5 + cryptonight_aeon = 5, + cryptonight_ipbc = 6, // equal to cryptonight_aeon with a small tweak in the miner code + cryptonight_stellite = 7 //equal to cryptonight_monero but with one tiny change }; // define aeon settings @@ -44,14 +46,22 @@ inline constexpr size_t cn_select_memory<cryptonight_heavy>() { return CRYPTONIG template<> inline constexpr size_t cn_select_memory<cryptonight_aeon>() { return CRYPTONIGHT_LITE_MEMORY; } +template<> +inline constexpr size_t cn_select_memory<cryptonight_ipbc>() { return CRYPTONIGHT_LITE_MEMORY; } + +template<> +inline constexpr size_t cn_select_memory<cryptonight_stellite>() { return CRYPTONIGHT_MEMORY; } + inline size_t cn_select_memory(xmrstak_algo algo) { switch(algo) { + case cryptonight_stellite: case cryptonight_monero: case cryptonight: - return CRYPTONIGHT_MEMORY; + return CRYPTONIGHT_MEMORY; + case cryptonight_ipbc: case cryptonight_aeon: case cryptonight_lite: return CRYPTONIGHT_LITE_MEMORY; @@ -80,13 +90,21 @@ inline constexpr uint32_t cn_select_mask<cryptonight_heavy>() { return CRYPTONIG template<> inline constexpr uint32_t cn_select_mask<cryptonight_aeon>() { return CRYPTONIGHT_LITE_MASK; } +template<> +inline constexpr uint32_t cn_select_mask<cryptonight_ipbc>() { return CRYPTONIGHT_LITE_MASK; } + +template<> +inline constexpr uint32_t cn_select_mask<cryptonight_stellite>() { return CRYPTONIGHT_MASK; } + inline size_t cn_select_mask(xmrstak_algo algo) { switch(algo) { + case cryptonight_stellite: case cryptonight_monero: case cryptonight: return CRYPTONIGHT_MASK; + case cryptonight_ipbc: case cryptonight_aeon: case cryptonight_lite: return CRYPTONIGHT_LITE_MASK; @@ -115,13 +133,21 @@ inline constexpr uint32_t cn_select_iter<cryptonight_heavy>() { return CRYPTONIG template<> inline constexpr uint32_t cn_select_iter<cryptonight_aeon>() { return CRYPTONIGHT_LITE_ITER; } +template<> +inline constexpr uint32_t cn_select_iter<cryptonight_ipbc>() { return CRYPTONIGHT_LITE_ITER; } + +template<> +inline constexpr uint32_t cn_select_iter<cryptonight_stellite>() { return CRYPTONIGHT_ITER; } + inline size_t cn_select_iter(xmrstak_algo algo) { switch(algo) { + case cryptonight_stellite: case cryptonight_monero: case cryptonight: return CRYPTONIGHT_ITER; + case cryptonight_ipbc: case cryptonight_aeon: case cryptonight_lite: return CRYPTONIGHT_LITE_ITER; |