Merge pull request #262 from luke-jr/bugfix_ocl_err Bugfix: Adapt OpenCL scanhash errors to driver API change
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
diff --git a/driver-opencl.c b/driver-opencl.c
index 10b20a4..838665d 100644
--- a/driver-opencl.c
+++ b/driver-opencl.c
@@ -1386,7 +1386,7 @@ static int64_t opencl_scanhash(struct thr_info *thr, struct work *work,
status = thrdata->queue_kernel_parameters(clState, &work->blk, globalThreads[0]);
if (unlikely(status != CL_SUCCESS)) {
applog(LOG_ERR, "Error: clSetKernelArg of all params failed.");
- return 0;
+ return -1;
}
/* MAXBUFFERS entry is used as a flag to say nonces exist */
@@ -1396,7 +1396,7 @@ static int64_t opencl_scanhash(struct thr_info *thr, struct work *work,
BUFFERSIZE, blank_res, 0, NULL, NULL);
if (unlikely(status != CL_SUCCESS)) {
applog(LOG_ERR, "Error: clEnqueueWriteBuffer failed.");
- return 0;
+ return -1;
}
if (unlikely(thrdata->last_work)) {
applog(LOG_DEBUG, "GPU %d found something in last work?", gpu->device_id);
@@ -1423,14 +1423,14 @@ static int64_t opencl_scanhash(struct thr_info *thr, struct work *work,
globalThreads, localThreads, 0, NULL, NULL);
if (unlikely(status != CL_SUCCESS)) {
applog(LOG_ERR, "Error: Enqueueing kernel onto command queue. (clEnqueueNDRangeKernel)");
- return 0;
+ return -1;
}
status = clEnqueueReadBuffer(clState->commandQueue, clState->outputBuffer, CL_FALSE, 0,
BUFFERSIZE, thrdata->res, 0, NULL, NULL);
if (unlikely(status != CL_SUCCESS)) {
applog(LOG_ERR, "Error: clEnqueueReadBuffer failed. (clEnqueueReadBuffer)");
- return 0;
+ return -1;
}
/* The amount of work scanned can fluctuate when intensity changes