mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-10 23:08:07 +00:00
Create command queue before compiling program in opencl.
This commit is contained in:
parent
e17ee1e894
commit
3e61db105d
24
ocl.c
24
ocl.c
@ -309,6 +309,18 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////
|
||||||
|
// Create an OpenCL command queue
|
||||||
|
/////////////////////////////////////////////////////////////////
|
||||||
|
clState->commandQueue = clCreateCommandQueue(clState->context, devices[gpu],
|
||||||
|
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, &status);
|
||||||
|
if (status != CL_SUCCESS) /* Try again without OOE enable */
|
||||||
|
clState->commandQueue = clCreateCommandQueue(clState->context, devices[gpu], 0 , &status);
|
||||||
|
if (status != CL_SUCCESS) {
|
||||||
|
applog(LOG_ERR, "Error %d: Creating Command Queue. (clCreateCommandQueue)", status);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check for BFI INT support. Hopefully people don't mix devices with
|
/* Check for BFI INT support. Hopefully people don't mix devices with
|
||||||
* and without it! */
|
* and without it! */
|
||||||
char * extensions = malloc(1024);
|
char * extensions = malloc(1024);
|
||||||
@ -739,18 +751,6 @@ built:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////
|
|
||||||
// Create an OpenCL command queue
|
|
||||||
/////////////////////////////////////////////////////////////////
|
|
||||||
clState->commandQueue = clCreateCommandQueue(clState->context, devices[gpu],
|
|
||||||
CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, &status);
|
|
||||||
if (status != CL_SUCCESS) /* Try again without OOE enable */
|
|
||||||
clState->commandQueue = clCreateCommandQueue(clState->context, devices[gpu], 0 , &status);
|
|
||||||
if (status != CL_SUCCESS) {
|
|
||||||
applog(LOG_ERR, "Error %d: Creating Command Queue. (clCreateCommandQueue)", status);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef USE_SCRYPT
|
#ifdef USE_SCRYPT
|
||||||
if (opt_scrypt) {
|
if (opt_scrypt) {
|
||||||
size_t ipt = (1024 / clState->lookup_gap + (1024 % clState->lookup_gap > 0));
|
size_t ipt = (1024 / clState->lookup_gap + (1024 % clState->lookup_gap > 0));
|
||||||
|
Loading…
Reference in New Issue
Block a user