Send correct values to scrypt kernel to get it finally working.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
diff --git a/cgminer.c b/cgminer.c
index df9feee..f2ea382 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -1711,8 +1711,13 @@ static bool submit_upstream_work(const struct work *work, CURL *curl)
if (!QUIET) {
hash32 = (uint32_t *)(work->hash);
- sprintf(hashshow, "%08lx.%08lx%s", (unsigned long)(hash32[6]), (unsigned long)(hash32[5]),
- work->block? " BLOCK!" : "");
+ if (opt_scrypt) {
+ sprintf(hashshow, "%08lx.%08lx%s", (unsigned long)(hash32[7]), (unsigned long)(hash32[6]),
+ work->block? " BLOCK!" : "");
+ } else {
+ sprintf(hashshow, "%08lx.%08lx%s", (unsigned long)(hash32[6]), (unsigned long)(hash32[5]),
+ work->block? " BLOCK!" : "");
+ }
}
/* Theoretically threads could race when modifying accepted and
@@ -3991,10 +3996,13 @@ bool test_nonce(struct work *work, uint32_t nonce)
{
uint32_t *work_nonce = (uint32_t *)(work->data + 64 + 12);
+ if (opt_scrypt) {
+ *work_nonce = nonce;
+ return true;
+ }
+
*work_nonce = htobe32(nonce);
- if (opt_scrypt)
- return true;
return hashtest(work);
}
diff --git a/driver-opencl.c b/driver-opencl.c
index 4ddf336..3ec60dd 100644
--- a/driver-opencl.c
+++ b/driver-opencl.c
@@ -995,7 +995,7 @@ static cl_int queue_diablo_kernel(_clState *clState, dev_blk_ctx *blk, cl_uint t
#ifdef USE_SCRYPT
static cl_int queue_scrypt_kernel(_clState *clState, dev_blk_ctx *blk, __maybe_unused cl_uint threads)
{
- cl_uint4 *midstate = (cl_uint4 *)blk->work->midstate;
+ char *midstate = blk->work->midstate;
cl_kernel *kernel = &clState->kernel;
unsigned int num = 0;
cl_int status = 0;
@@ -1006,16 +1006,9 @@ static cl_int queue_scrypt_kernel(_clState *clState, dev_blk_ctx *blk, __maybe_u
CL_SET_ARG(clState->CLbuffer0);
CL_SET_ARG(clState->outputBuffer);
CL_SET_ARG(clState->padbuffer8);
- CL_SET_ARG(midstate[0]);
- CL_SET_ARG(midstate[16]);
-
-#if 0
- clSetKernelArg(clState->kernel,0,sizeof(cl_mem), &clState->CLbuffer[0]);
- clSetKernelArg(clState->kernel,1,sizeof(cl_mem), &clState->CLbuffer[1]);
- clSetKernelArg(clState->kernel,2,sizeof(cl_mem), &clState->padbuffer8);
- clSetKernelArg(clState->kernel,3,sizeof(cl_uint4), &midstate[0]);
- clSetKernelArg(clState->kernel,4,sizeof(cl_uint4), &midstate[16]);
-#endif
+ CL_SET_VARG(4, &midstate[0]);
+ CL_SET_VARG(4, &midstate[16]);
+
return status;
}
#endif
diff --git a/findnonce.c b/findnonce.c
index d0e1917..a11333a 100644
--- a/findnonce.c
+++ b/findnonce.c
@@ -229,13 +229,16 @@ static void *postcalc_hash(void *userdata)
pthread_detach(pthread_self());
for (entry = 0; entry < FOUND; entry++) {
- if (pcd->res[entry]) {
+ uint32_t nonce = pcd->res[entry];
+
+ if (nonce) {
+ applog(LOG_DEBUG, "OCL NONCE %u", nonce);
#ifdef USE_SCRYPT
if (opt_scrypt)
- submit_nonce(thr, pcd->work, pcd->res[entry]);
+ submit_nonce(thr, pcd->work, nonce);
else
#endif
- send_nonce(pcd, pcd->res[entry]);
+ send_nonce(pcd, nonce);
nonces++;
}
}
diff --git a/ocl.c b/ocl.c
index feb6aa2..1c6d98e 100644
--- a/ocl.c
+++ b/ocl.c
@@ -487,8 +487,8 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
#ifdef USE_SCRYPT
if (opt_scrypt) {
- clState->lookup_gap = 1;
- clState->thread_concurrency = 1;
+ clState->lookup_gap = 2;
+ clState->thread_concurrency = 6144;
}
#endif