From fb0c580b621f71c0ce74c7d2067c782e7a9f13fd Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 15 Oct 2011 13:29:44 +1100 Subject: [PATCH] Go to kernel build should we fail to clCreateProgramWithBinary instead of failing on that device. Should fix the windows problems with devices not initialising. --- ocl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ocl.c b/ocl.c index ab6fdfb0..682c3f3b 100644 --- a/ocl.c +++ b/ocl.c @@ -437,14 +437,14 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize) fclose(binaryfile); goto build; } - fclose(binaryfile); clState->program = clCreateProgramWithBinary(clState->context, 1, &devices[gpu], &binary_sizes[gpu], (const unsigned char **)&binaries[gpu], &status, NULL); - if (status != CL_SUCCESS) - { + if (status != CL_SUCCESS) { applog(LOG_ERR, "Error: Loading Binary into cl_program (clCreateProgramWithBinary)"); - return NULL; + fclose(binaryfile); + goto build; } + fclose(binaryfile); if (opt_debug) applog(LOG_DEBUG, "Loaded binary image %s", binaryfilename);