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;
63 if( n == 200 && k == 9 )
65 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"};
69 else if( n == 184 && k == 7 )
71 std::vector<std::string> kernels {
"kernel_init_ht",
"kernel_round0",
"kernel_round1",
"kernel_round2",
"kernel_round3",
"kernel_round4",
"kernel_round5",
"kernel_round6",
"kernel_sols"};
85 size_t global_work_size = 1 << 20;
86 size_t local_work_size = 32;
92 std::cout <<
"Error allocating indices array!" << std::endl;
102 std::cout <<
"ERROR: No suitable GPU found! No work will be performed!" << std::endl;
111 if( n == 200 && k == 9 )
113 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"};
117 else if( n == 184 && k == 7 )
119 std::vector<std::string> kernels {
"kernel_init_ht",
"kernel_round0",
"kernel_round1",
"kernel_round2",
"kernel_round3",
"kernel_round4",
"kernel_round5",
"kernel_round6",
"kernel_sols"};
138 bool GPUSolver::run(
unsigned int n,
unsigned int k, uint8_t *header,
size_t header_len,
uint256 nonce,
139 const std::function<
bool(std::vector<unsigned char>)> validBlock,
141 crypto_generichash_blake2b_state base_state)
143 return GPUSolve(n, k, header, header_len, nonce, validBlock, cancelled, base_state);
147 const std::function<
bool(std::vector<unsigned char>)> validBlock,
149 crypto_generichash_blake2b_state base_state)
180 size_t checkedSols =
n_sol;
190 std::vector<eh_index> index_vector(512);
192 index_vector.resize(1<<k);
193 for (
size_t i = 0; i < (
unsigned int)1 << k; i++)
215 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)
#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)