I'm interested in using an optional extension to OpenCL which adds certain functions to the OpenCL language (in particular, cl_khr_gl_msaa_sharing). I'm using Apple's openclc to compile my OpenCL sources at build-time, however, openclc fails to compile my source (see below) because of calls to these new functions. The machine I'm running on does, indeed, support the extensions, and if I use clCreateProgramWithSource() and clBuildProgram() at runtime, everything works great.
Obviously, any build-time tool can't know which extensions are supported at run-time. However, I'd like to be able to compile my source at build-time assuming the extension exists, then at run-time query for the presence for the extension and degrade gracefully if the extension isn't present. Is there a mechanism for doing anything like this?
The top answer to OpenCL half4 type Apple OS X suggests using preprocessor defines inside the OpenCL program to detect extensions, but that won't help me as those defines are evaluated at build-time.
The particular build-time compiler error is this: error: target does not support depth and MSAA textures