Browse Source

Bugfix: Adapt OpenCL scanhash errors to driver API change (errors are now -1, not 0)

nfactor-troky
Luke Dashjr 13 years ago
parent
commit
a3998e26e8
  1. 8
      driver-opencl.c

8
driver-opencl.c

@ -1387,7 +1387,7 @@ static int64_t opencl_scanhash(struct thr_info *thr, struct work *work,
status = thrdata->queue_kernel_parameters(clState, &work->blk, globalThreads[0]); status = thrdata->queue_kernel_parameters(clState, &work->blk, globalThreads[0]);
if (unlikely(status != CL_SUCCESS)) { if (unlikely(status != CL_SUCCESS)) {
applog(LOG_ERR, "Error: clSetKernelArg of all params failed."); applog(LOG_ERR, "Error: clSetKernelArg of all params failed.");
return 0; return -1;
} }
/* MAXBUFFERS entry is used as a flag to say nonces exist */ /* MAXBUFFERS entry is used as a flag to say nonces exist */
@ -1397,7 +1397,7 @@ static int64_t opencl_scanhash(struct thr_info *thr, struct work *work,
BUFFERSIZE, blank_res, 0, NULL, NULL); BUFFERSIZE, blank_res, 0, NULL, NULL);
if (unlikely(status != CL_SUCCESS)) { if (unlikely(status != CL_SUCCESS)) {
applog(LOG_ERR, "Error: clEnqueueWriteBuffer failed."); applog(LOG_ERR, "Error: clEnqueueWriteBuffer failed.");
return 0; return -1;
} }
if (unlikely(thrdata->last_work)) { if (unlikely(thrdata->last_work)) {
applog(LOG_DEBUG, "GPU %d found something in last work?", gpu->device_id); applog(LOG_DEBUG, "GPU %d found something in last work?", gpu->device_id);
@ -1422,14 +1422,14 @@ static int64_t opencl_scanhash(struct thr_info *thr, struct work *work,
globalThreads, localThreads, 0, NULL, NULL); globalThreads, localThreads, 0, NULL, NULL);
if (unlikely(status != CL_SUCCESS)) { if (unlikely(status != CL_SUCCESS)) {
applog(LOG_ERR, "Error: Enqueueing kernel onto command queue. (clEnqueueNDRangeKernel)"); applog(LOG_ERR, "Error: Enqueueing kernel onto command queue. (clEnqueueNDRangeKernel)");
return 0; return -1;
} }
status = clEnqueueReadBuffer(clState->commandQueue, clState->outputBuffer, CL_FALSE, 0, status = clEnqueueReadBuffer(clState->commandQueue, clState->outputBuffer, CL_FALSE, 0,
BUFFERSIZE, thrdata->res, 0, NULL, NULL); BUFFERSIZE, thrdata->res, 0, NULL, NULL);
if (unlikely(status != CL_SUCCESS)) { if (unlikely(status != CL_SUCCESS)) {
applog(LOG_ERR, "Error: clEnqueueReadBuffer failed. (clEnqueueReadBuffer)"); applog(LOG_ERR, "Error: clEnqueueReadBuffer failed. (clEnqueueReadBuffer)");
return 0; return -1;
} }
/* The amount of work scanned can fluctuate when intensity changes /* The amount of work scanned can fluctuate when intensity changes

Loading…
Cancel
Save