From 283d5d2343d4426f9477a769bda4d8ff96a0d098 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 29 Jul 2011 10:09:24 +1000 Subject: [PATCH] Create a command queue from the program created from source which allows us to flush the command queue in the hope it will not generate a zero sized binary any more. --- ocl.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ocl.c b/ocl.c index 3d07f34e..d5bd8e82 100644 --- a/ocl.c +++ b/ocl.c @@ -514,6 +514,21 @@ build: return NULL; } + /* Create the command queue just so we can flush it to try and avoid + * zero sized binaries */ + clState->commandQueue = clCreateCommandQueue(clState->context, devices[gpu], 0, &status); + if (status != CL_SUCCESS) + { + applog(LOG_ERR, "Creating Command Queue. (clCreateCommandQueue)"); + return NULL; + } + status = clFinish(clState->commandQueue); + if (status != CL_SUCCESS) + { + applog(LOG_ERR, "Finishing command queue. (clFinish)"); + return NULL; + } + status = clGetProgramInfo( clState->program, CL_PROGRAM_BINARY_SIZES, sizeof(size_t)*nDevices, binary_sizes, NULL ); if (unlikely(status != CL_SUCCESS)) {