Browse Source

The new phatk kernel needs a different nonce passed according to how many vectors are in use.

This fixes breakage that otherwise occurs when 1 or 4 vectors are chosen.
nfactor-troky
Con Kolivas 13 years ago
parent
commit
64e7cdd61b
  1. 14
      main.c

14
main.c

@ -3415,9 +3415,11 @@ static cl_int queue_poclbm_kernel(_clState *clState, dev_blk_ctx *blk)
static cl_int queue_phatk_kernel(_clState *clState, dev_blk_ctx *blk) static cl_int queue_phatk_kernel(_clState *clState, dev_blk_ctx *blk)
{ {
cl_kernel *kernel = &clState->kernel; cl_uint vwidth = clState->preferred_vwidth;
cl_kernel *kernel = &clState->kernel;
cl_int status = 0; cl_int status = 0;
int num = 0; int i, num = 0;
uint *nonces;
status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->ctx_a); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->ctx_a);
status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->ctx_b); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->ctx_b);
@ -3435,10 +3437,10 @@ static cl_int queue_phatk_kernel(_clState *clState, dev_blk_ctx *blk)
status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->cty_g); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->cty_g);
status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->cty_h); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->cty_h);
uint nonces[2]; nonces = alloca(sizeof(uint) * vwidth);
nonces[0] = blk->nonce; for (i = 0; i < vwidth; i++)
nonces[1] = (blk->nonce)+1; nonces[i] = blk->nonce + i;
status |= clSetKernelArg(*kernel, num++, 2 * sizeof(uint), (void *)nonces); status |= clSetKernelArg(*kernel, num++, vwidth * sizeof(uint), (void *)nonces);
status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->W16); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->W16);
status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->W17); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->W17);

Loading…
Cancel
Save