add --cuda-usleep flag to optionally usleep between search iterations#2281
add --cuda-usleep flag to optionally usleep between search iterations#2281jonreiter wants to merge 1 commit intoethereum-mining:masterfrom
Conversation
aloisklink
left a comment
There was a problem hiding this comment.
Hiya, I just wanted to thank you for adding this feature! I'll probably use it in my personal fork, since I've been wanting the same thing.
Unfortunately, this repo is pretty unmaintained, so it's unlikely for this PR to get merged, but I thought I'd add my recommended changes, just in case some fork wants to pick up this feature. I remember https://github.com/no-fee-ethereum-mining/nsfminer was a new fork that looked pretty promising, but unfortunately that's archived now.
| app.add_option("--cuda-usleep,--cu-usleep", m_CUSettings.usleep, "", true) | ||
| ->check(CLI::Range(-1, 1000000)); |
There was a problem hiding this comment.
It's probably worth improving the documentation on this, just to make it more clear what this actually does.
| app.add_option("--cuda-usleep,--cu-usleep", m_CUSettings.usleep, "", true) | |
| ->check(CLI::Range(-1, 1000000)); | |
| // adds an optional usleep between batches. Can be used to slow down mining. | |
| app.add_option("--cuda-usleep,--cu-usleep", m_CUSettings.usleep, "Sleep time in μs between batches (default: no sleep)", true) | |
| ->check(CLI::Range(-1, 1000000)); |
| unsigned schedule = 4; | ||
| unsigned gridSize = 8192; | ||
| unsigned blockSize = 128; | ||
| int usleep = -1; |
There was a problem hiding this comment.
C and C++ are annoying languages, and even though int is usually 32-bits large, on some platforms, it can be 16-bits, so it's better to use one of the types in <cstdint> instead.
The following should work if you include #include <cstdint> at the top of the file. Alternatively, you could replace the CLI::Range(-1, 1000000)) to a smaller range that will fit in a int16 like CLI::Range(-1, 10000)).
| int usleep = -1; | |
| int_fast32_t usleep = -1; |
No description provided.