OS X OpenCL External Functions are Hosed

I'd spent some time trying to repair some OpenCL kernels, and was first, having a problem with data types.

It appears that now, if you want to use a double precision float, you have to do this:

#pragma OPENCL EXTENSION cl_khr_fp64 : enable

...but apparently not at the top of the program, instead, before each invocation. I'm uncertain if that's correct, but I can tell that using this pragma directly before a float4 constant I was setting up finally got rid of compiler warnings.

Unfortunately, I ran into a way bigger problem.

"no previous prototype for function"

The real bummer here is that I found out after some googling that external functions in OpenCL are broken across the board, and I guess have been since Mountain Lion. Oh well!



Supposedly omitting -Werror when building the OpenCL kernel will get rid of these warnings, but this is untested by me, and a drag for something like QC, which doesn't expose that.



Marking the data type of the function as static gets rid of the function nag. BUT, there are still mystery problems that result in some problem with kernel compilation in the case I was attempting, without flagging an actual problem.