2 Replies Latest reply on Oct 6, 2014 4:13 PM by ginquo

    Warnings when linking separately compiled objects.

    ginquo

      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!

       

       


        • Re: Warnings when linking separately compiled objects.
          dipak

          I tried to build it (with flag "-cl-std=CL1.2") on Windows 7 (64bit) with latest 2.0 driver (higher version number than yours) but found no warning. I'll try the same on Linux. Please let us know your setup details such as OS, driver version, SDK etc. Meanwhile if possible please try on Windows and share your findings.

          I guess building the program for multiple devices may not giving the proper error message. Please try to build/compile it for a specific device and then get the error log message. Or as you have only one GPU and one CPU, you can set device type as CL_DEVICE_TYPE_GPU or CL_DEVICE_TYPE_CPU each time and check the error.

            • Re: Warnings when linking separately compiled objects.
              ginquo

              Hello dipak,

              My OS is the 64 bit version of Arch Linux. I have the 14.41 OpenCL 2.0 driver and no SDK installed.

               

              I should be building the program for just one device. I've replaced the relevant parts of my test program with calls to the C API to make sure of this:

              kernel_linker_warning_capi.cpp

              I'm also requiring CL_DEVICE_TYPE_GPU. Still the same behavior.  (output & clinfo  are identical)

               

              I don't really have the resources to port and test my program on windows at the moment. I guess I'll wait for the stable driver release and check again. It's promising if you didn't have the same problems with the later driver version you are using.