|
|
@ -185,7 +185,7 @@ void patch_opcodes(char *w, unsigned remaining) |
|
|
|
|
|
|
|
|
|
|
|
_clState *initCl(unsigned int gpu, char *name, size_t nameSize) |
|
|
|
_clState *initCl(unsigned int gpu, char *name, size_t nameSize) |
|
|
|
{ |
|
|
|
{ |
|
|
|
bool patchbfi = false; |
|
|
|
bool patchbfi = false, prog_built = false; |
|
|
|
cl_int status = 0; |
|
|
|
cl_int status = 0; |
|
|
|
unsigned int i; |
|
|
|
unsigned int i; |
|
|
|
|
|
|
|
|
|
|
@ -526,6 +526,8 @@ build: |
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
prog_built = true; |
|
|
|
|
|
|
|
|
|
|
|
status = clGetProgramInfo( clState->program, CL_PROGRAM_BINARY_SIZES, sizeof(size_t)*numDevices, binary_sizes, NULL ); |
|
|
|
status = clGetProgramInfo( clState->program, CL_PROGRAM_BINARY_SIZES, sizeof(size_t)*numDevices, binary_sizes, NULL ); |
|
|
|
if (unlikely(status != CL_SUCCESS)) { |
|
|
|
if (unlikely(status != CL_SUCCESS)) { |
|
|
|
applog(LOG_ERR, "Error: Getting program info CL_PROGRAM_BINARY_SIZES. (clGetPlatformInfo)"); |
|
|
|
applog(LOG_ERR, "Error: Getting program info CL_PROGRAM_BINARY_SIZES. (clGetPlatformInfo)"); |
|
|
@ -624,6 +626,7 @@ built: |
|
|
|
applog(LOG_INFO, "Initialising kernel %s with%s BFI_INT, %d vectors and worksize %d", |
|
|
|
applog(LOG_INFO, "Initialising kernel %s with%s BFI_INT, %d vectors and worksize %d", |
|
|
|
filename, patchbfi ? "" : "out", clState->preferred_vwidth, clState->work_size); |
|
|
|
filename, patchbfi ? "" : "out", clState->preferred_vwidth, clState->work_size); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!prog_built) { |
|
|
|
/* create a cl program executable for all the devices specified */ |
|
|
|
/* create a cl program executable for all the devices specified */ |
|
|
|
status = clBuildProgram(clState->program, 1, &devices[gpu], NULL, NULL, NULL); |
|
|
|
status = clBuildProgram(clState->program, 1, &devices[gpu], NULL, NULL, NULL); |
|
|
|
if (status != CL_SUCCESS) { |
|
|
|
if (status != CL_SUCCESS) { |
|
|
@ -636,6 +639,7 @@ built: |
|
|
|
applog(LOG_INFO, "%s", log); |
|
|
|
applog(LOG_INFO, "%s", log); |
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* get a kernel object handle for a kernel with the given name */ |
|
|
|
/* get a kernel object handle for a kernel with the given name */ |
|
|
|
clState->kernel = clCreateKernel(clState->program, "search", &status); |
|
|
|
clState->kernel = clCreateKernel(clState->program, "search", &status); |
|
|
|