mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Ease the checking on allocation of padbuffer8 in the hope it works partially anyway on an apparently failed call.
This commit is contained in:
parent
e5babfa25b
commit
25c39c96bb
7
ocl.c
7
ocl.c
@ -816,8 +816,13 @@ built:
|
|||||||
bufsize = cgpu->max_alloc;
|
bufsize = cgpu->max_alloc;
|
||||||
applog(LOG_DEBUG, "Creating scrypt buffer sized %d", bufsize);
|
applog(LOG_DEBUG, "Creating scrypt buffer sized %d", bufsize);
|
||||||
clState->padbufsize = bufsize;
|
clState->padbufsize = bufsize;
|
||||||
|
|
||||||
|
/* This buffer is weird and might work to some degree even if
|
||||||
|
* the create buffer call has apparently failed, so check if we
|
||||||
|
* get anything back before we call it a failure. */
|
||||||
|
clState->padbuffer8 = NULL;
|
||||||
clState->padbuffer8 = clCreateBuffer(clState->context, CL_MEM_READ_WRITE, bufsize, NULL, &status);
|
clState->padbuffer8 = clCreateBuffer(clState->context, CL_MEM_READ_WRITE, bufsize, NULL, &status);
|
||||||
if (status != CL_SUCCESS) {
|
if (status != CL_SUCCESS && !clState->padbuffer8) {
|
||||||
applog(LOG_ERR, "Error %d: clCreateBuffer (padbuffer8), decrease CT or increase LG", status);
|
applog(LOG_ERR, "Error %d: clCreateBuffer (padbuffer8), decrease CT or increase LG", status);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user