|
|
|
@ -152,19 +152,17 @@ static void *postcalc_hash(void *userdata)
@@ -152,19 +152,17 @@ static void *postcalc_hash(void *userdata)
|
|
|
|
|
struct thr_info *thr = pcd->thr; |
|
|
|
|
dev_blk_ctx *blk = &pcd->work->blk; |
|
|
|
|
struct work *work = pcd->work; |
|
|
|
|
uint32_t start = 0; |
|
|
|
|
|
|
|
|
|
cl_uint A, B, C, D, E, F, G, H; |
|
|
|
|
cl_uint W[16]; |
|
|
|
|
cl_uint nonce; |
|
|
|
|
cl_uint best_g; |
|
|
|
|
uint32_t end; |
|
|
|
|
cl_uint nonce = 0; |
|
|
|
|
int entry = 0; |
|
|
|
|
|
|
|
|
|
pthread_detach(pthread_self()); |
|
|
|
|
cycle: |
|
|
|
|
while (entry < MAXBUFFERS) { |
|
|
|
|
if (pcd->res[entry]) { |
|
|
|
|
start = pcd->res[entry++]; |
|
|
|
|
nonce = pcd->res[entry++]; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
entry++; |
|
|
|
@ -172,10 +170,6 @@ cycle:
@@ -172,10 +170,6 @@ cycle:
|
|
|
|
|
if (entry == MAXBUFFERS) |
|
|
|
|
goto out; |
|
|
|
|
|
|
|
|
|
best_g = ~0; |
|
|
|
|
end = start + 1026; |
|
|
|
|
|
|
|
|
|
for (nonce = start; nonce != end; nonce+=1) { |
|
|
|
|
A = blk->cty_a; B = blk->cty_b; |
|
|
|
|
C = blk->cty_c; D = blk->cty_d; |
|
|
|
|
E = blk->cty_e; F = blk->cty_f; |
|
|
|
@ -205,21 +199,12 @@ cycle:
@@ -205,21 +199,12 @@ cycle:
|
|
|
|
|
FR(32); FR(40); |
|
|
|
|
FR(48); PFR(56); |
|
|
|
|
|
|
|
|
|
if (unlikely(H == 0xA41F32E7)) { |
|
|
|
|
if (likely(H == 0xA41F32E7)) { |
|
|
|
|
if (unlikely(submit_nonce(thr, work, nonce) == false)) { |
|
|
|
|
applog(LOG_ERR, "Failed to submit work, exiting"); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
G += 0x1f83d9ab; |
|
|
|
|
G = ByteReverse(G); |
|
|
|
|
|
|
|
|
|
if (G < best_g) |
|
|
|
|
best_g = G; |
|
|
|
|
} |
|
|
|
|
goto out; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (unlikely(best_g == ~0)) { |
|
|
|
|
} else { |
|
|
|
|
if (opt_debug) |
|
|
|
|
applog(LOG_DEBUG, "No best_g found! Error in OpenCL code?"); |
|
|
|
|
hw_errors++; |
|
|
|
@ -228,7 +213,6 @@ cycle:
@@ -228,7 +213,6 @@ cycle:
|
|
|
|
|
if (entry < MAXBUFFERS) |
|
|
|
|
goto cycle; |
|
|
|
|
out: |
|
|
|
|
pthread_detach(pthread_self()); |
|
|
|
|
free(pcd); |
|
|
|
|
return NULL; |
|
|
|
|
} |
|
|
|
|