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!


http://lists.blender.org/pipermail/bf-cycles/2011-September/000083.html

http://www.primegrid.com/forum_thread.php?id=2837


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.

http://boinc.thesonntags.com/collatz/forum_thread.php?id=823

ADDENDUM:

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.