Browse Source

Unwind.

nfactor-troky
ckolivas 14 years ago committed by Con Kolivas
parent
commit
fa2f6b19c1
  1. 59
      cpu-miner.c

59
cpu-miner.c

@ -738,41 +738,36 @@ enum {
static _clState *clStates[16]; static _clState *clStates[16];
/* queue kernel parameter */
static inline int qkp(cl_kernel *kernel, void *param, int param_num)
{
return clSetKernelArg(*kernel, param_num, sizeof(param), param);
}
static inline cl_int queue_kernel_parameters(dev_blk_ctx *blk, cl_kernel *kernel, static inline cl_int queue_kernel_parameters(dev_blk_ctx *blk, cl_kernel *kernel,
struct _cl_mem *output) struct _cl_mem *output)
{ {
cl_int status = 0; cl_int status = 0;
int num = 0;
status |= qkp(kernel, (void *)&blk->ctx_a, 0);
status |= qkp(kernel, (void *)&blk->ctx_b, 1); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->ctx_a);
status |= qkp(kernel, (void *)&blk->ctx_c, 2); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->ctx_b);
status |= qkp(kernel, (void *)&blk->ctx_d, 3); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->ctx_c);
status |= qkp(kernel, (void *)&blk->ctx_e, 4); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->ctx_d);
status |= qkp(kernel, (void *)&blk->ctx_f, 5); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->ctx_e);
status |= qkp(kernel, (void *)&blk->ctx_g, 6); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->ctx_f);
status |= qkp(kernel, (void *)&blk->ctx_h, 7); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->ctx_g);
status |= qkp(kernel, (void *)&blk->cty_b, 8); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->ctx_h);
status |= qkp(kernel, (void *)&blk->cty_c, 9); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->cty_b);
status |= qkp(kernel, (void *)&blk->cty_d, 10); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->cty_c);
status |= qkp(kernel, (void *)&blk->cty_f, 11); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->cty_d);
status |= qkp(kernel, (void *)&blk->cty_g, 12); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->cty_f);
status |= qkp(kernel, (void *)&blk->cty_h, 13); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->cty_g);
status |= qkp(kernel, (void *)&blk->nonce, 14); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->cty_h);
status |= qkp(kernel, (void *)&blk->fW0, 15); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->nonce);
status |= qkp(kernel, (void *)&blk->fW1, 16); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->fW0);
status |= qkp(kernel, (void *)&blk->fW2, 17); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->fW1);
status |= qkp(kernel, (void *)&blk->fW3, 18); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->fW2);
status |= qkp(kernel, (void *)&blk->fW15, 19); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->fW3);
status |= qkp(kernel, (void *)&blk->fW01r, 20); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->fW15);
status |= qkp(kernel, (void *)&blk->fcty_e, 21); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->fW01r);
status |= qkp(kernel, (void *)&blk->fcty_e2, 22); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->fcty_e);
status |= qkp(kernel, (void *)output, 23); status |= clSetKernelArg(*kernel, num++, sizeof(uint), (void *)&blk->fcty_e2);
status |= clSetKernelArg(*kernel, num++, sizeof(output), (void *)output);
return status; return status;
} }
@ -876,7 +871,7 @@ static void *gpuminer_thread(void *userdata)
need_work = true; need_work = true;
clFinish(clState->commandQueue); clFinish(clState->commandQueue);
status = qkp(kernel, (void *)&work->blk.nonce, 14); status = clSetKernelArg(*kernel, 14, sizeof(uint), (void *)&work->blk.nonce);
if (unlikely(status != CL_SUCCESS)) if (unlikely(status != CL_SUCCESS))
{ applog(LOG_ERR, "Error: clSetKernelArg failed."); goto out; } { applog(LOG_ERR, "Error: clSetKernelArg failed."); goto out; }
} }

Loading…
Cancel
Save