KlausT / ccminer-cryptonight

Software for mining various cryptocoins, like Monero (pool mining only)
GNU General Public License v3.0
133 stars 30 forks source link

Updating v1 monero cryptonight tweaks, and less global read/writes #66

Closed vtnerd closed 6 years ago

vtnerd commented 6 years ago

This patch has a few updates:

I ran a test harness with some test outputs that I can provide if necessary. People watching this PR should notice the changes to the CPU version as well - its similar to the ones that will be provided to other CPU miners.

vtnerd commented 6 years ago

I also wanted to mention that alternatively, d_input and ctx_state could have been passed to the inner work function, and then the d_tweak1_2 variable could have been computed without allocating and copying memory to an additional 64-bits of global memory. I implemented it this way because the offsets for the "tweak" are fixed, but the offset for the "nonce" is technically not (even though existing software assumes specific offset). This could bring additional compute savings at the cost of maintenance. Its not difficult to adapt the code if this is desired : pass in startNonce, d_input, and d_ctx_state to the inner processing loop and copy the nonce calculation logic and tweak logic from the prepare function.