35 const uint8_t *
a = (
const uint8_t *) _a;
36 static char buf[1024];
38 for (i = 0; i < a_len && i + 2 <
sizeof (buf); i++)
39 sprintf(buf + i * 2,
"%02x", a[i]);
46 size_t global_work_size = 1 << 20;
47 size_t local_work_size = 32;
53 std::cout <<
"Error allocating indices array!" << std::endl;
57 std::cout <<
"ERROR: No suitable GPU found! No work will be performed!" << std::endl;
62 std::vector<std::string> kernels {
"kernel_init_ht",
"kernel_round0",
"kernel_round1",
"kernel_round2",
"kernel_round3",
"kernel_round4",
"kernel_round5",
"kernel_round6",
"kernel_round7",
"kernel_round8",
"kernel_sols"};
76 size_t global_work_size = 1 << 20;
77 size_t local_work_size = 32;
83 std::cout <<
"Error allocating indices array!" << std::endl;
93 std::cout <<
"ERROR: No suitable GPU found! No work will be performed!" << std::endl;
102 std::vector<std::string> kernels {
"kernel_init_ht",
"kernel_round0",
"kernel_round1",
"kernel_round2",
"kernel_round3",
"kernel_round4",
"kernel_round5",
"kernel_round6",
"kernel_round7",
"kernel_round8",
"kernel_sols"};
121 const std::function<
bool(std::vector<unsigned char>)> validBlock,
123 crypto_generichash_blake2b_state base_state)
125 if (n == 200 && k == 9) {
126 return GPUSolve(n, k, header, header_len, nonce, validBlock, cancelled, base_state);
128 throw std::invalid_argument(
"Unsupported Equihash parameters");
133 const std::function<
bool(std::vector<unsigned char>)> validBlock,
135 crypto_generichash_blake2b_state base_state)
166 size_t checkedSols =
n_sol;
176 std::vector<eh_index> index_vector(
PROOFSIZE);
198 if (validBlock(sol_char))
#define function(a, b, c, d, k, s)
std::vector< unsigned char > GetMinimalFromIndices(std::vector< eh_index > indices, size_t cBitLen)
void run(uint8_t *header, size_t header_len, uint256 nonce, sols_t *indices, uint32_t *n_sol, uint256 *ptr)
bool run(unsigned int n, unsigned int k, uint8_t *header, size_t header_len, uint256 nonce, const std::function< bool(std::vector< unsigned char >)> validBlock, const std::function< bool(GPUSolverCancelCheck)> cancelled, crypto_generichash_blake2b_state base_state)
bool GPUSolve(unsigned int n, unsigned int k, uint8_t *header, size_t header_len, uint256 &nonce, const std::function< bool(std::vector< unsigned char >)> validBlock, const std::function< bool(GPUSolverCancelCheck)> cancelled, crypto_generichash_blake2b_state base_state)
bool init(unsigned _platformId, unsigned _deviceId, std::vector< std::string > _kernels)
#define EhIsValidSolution(n, k, base_state, soln, ret)
static const uint32_t PROOFSIZE
#define LogPrint(category,...)
uint values[MAX_SOLS][512]
char * s_hexdump(const void *_a, uint32_t a_len)
static bool configureGPU(unsigned _platformId, unsigned _localWorkSize, unsigned _globalWorkSize)