The above kernel code looks okay to me and I don't see any reason to get the error. I was successfully able to build the kernel using a simple C/C++ wrapper.
Btw, clSetKernelExecInfo is an OpenCL 2.0 API and I don't see any use of it inside the above code. You may try CodeXL (in "Analyze" mode) to verify the kernel build.
P.S. You've been whitelisted now.
Mmhh, this is interesting. I experimented a bit and observed the following:
- When i run the application while debugging it with CodeXL the error does not appear at all. (Maybe it catches the exception?)
- Rewriting the code in c++ and compiling it with the microsoft compiler there is also no crash.
This may be a problem of the pascal compiler i used. Thank you!
Edit: Seems like the problem is simply an unhandled floating point exception. Disabling all related exceptions removes the problem and the code works just fine. A little bit surprised that this is not handled somewhere inside the OpenCL implementation.
Setting a exceptionmask via SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide, exOverflow, exUnderflow, exPrecision]); avoids the problem.