I'm currently in the process of adapting my program to use the new features available with OpenCL 2.0 (esp. dynamic parallelism).
For this I have to link several separately compiled kernel program objects together so that all kernels reside in the same name space.
However I'm getting weird behavior and linker warnings even when linking two minimal program objects together:
Warning: Input OpenCL binaries has inconsistent compile options. Using compile options from the first input binary!
I know for a fact that I've passed the same compiler option "-cl-std=CL1.2" for both objects. This is also returned when querying the object's build options with clGetProgramBuildInfo(). Passing anything other than "" as linker option will lead to the operation failing with CL_INVALID_LINKER_OPTIONS.
I've prepared a minimal test program for this:
source: here
output: here
clinfo: here
The output is for the first device on the first platform, so for the Radeon R9 290. My operating system is a 64 bit Linux.
I'm using the OpenCL C++ wrappers to keep the example short. My program uses the OpenCL C API directly and gets the same behavior.
Also: When I compile the objects with "-cl-std=CL2.0", then I also get the following compiler error message (despite the compiler returning CL_SUCCESS😞
Internal Error: creating OpenCL binary failed!