What I wonder is if there is any other way to make use of device-side enqueue without having to rip out all local definitions out of a kernel and having to pass them as arguments.
Unfortunately, I don't think there is a work-around other than passing the local memory dynamically as kernel arguments that are a pointer type to local address space. As per spec, you can not pass blocks having global variables or stack variables local to the enclosing lexical scope that are a pointer type in the local or private address space. I guess, this is also valid for local memory variables declared inside a kernel.
Is there any way to get a linker output log from a failed call to clLinkProgram()? I thought I'd use clGetProgramBuildInfo(), but since clLinkProgram() doesn't return a valid program on error, I don't know what to pass as argument.
I guess, you can use clGetProgramBuildInfo on that unsuccessful program object to check the linking error. Whereas, if the clLinkProgram returns a NULL program object, it passes an appropriate error code using errcode_ret.
Yeah, my solution in the end was to wrap the concrete kernel implementation in another function, that takes pointers to the local variables as arguments. I then defined and passed those in the block and kernel: device_enqueue_fix.cl
I will try checking the program objects for linker errors, thanks.