12 Replies Latest reply on Feb 19, 2012 11:00 AM by bubu

    Offline Compilation of OpenCL kernel.

    KumarSaurabh
      Pre compiling opencl kernels.

      Hi,

      I am trying to generate a binary(.clbin file) for offline compilation of my opencl kernels. Is there any example that can illustrate the process of offline compilation using AMD OpenCl devices.

      Any suggestion in this direction shall be highly appreciated.

      Thanks and Regards.

      Kumar Saurabh.

        • Offline Compilation of OpenCL kernel.
          himanshu.gautam

          All SDK Samples support the option --dump where binares for all AMD devices ae dumped. They can later be used with --load option.

            • Offline Compilation of OpenCL kernel.
              KumarSaurabh

              Thanks a lot Himanshu for your reply to our query.

              We wish to do offline compilation of self created codes. Can you please help?

              Any help shall be appreciated.

                • Offline Compilation of OpenCL kernel.
                  bubu

                  I still think you really should add a simply button in the SKA tool to precompile your kernel and output it as a binary file as the Intel's IOC tool does.

                  I hope we could get that feature in the SDK 2.5 :p

                    • Offline Compilation of OpenCL kernel.
                      himanshu.gautam

                      kumar saurabh,

                      IT is possible to do offline compilation and you should be able to find relevent code in the SDKUtils library we ship with the SDK.

                       

                      Bubu,

                      AFAIK, you are able to see the device specific ISA code by compiling the opencl code. Can you please explain the feature request.

                        • Offline Compilation of OpenCL kernel.
                          bubu

                           

                          Originally posted by: himanshu.gautam kumar saurabh,

                           

                          IT is possible to do offline compilation and you should be able to find relevent code in the SDKUtils library we ship with the SDK.

                           

                           

                           

                          Bubu,

                           

                          AFAIK, you are able to see the device specific ISA code by compiling the opencl code. Can you please explain the feature request.

                           

                          Modify your SKA tool adding a simple "Precompile to file" button that works like this:

                           

                          1. you paste your kernel source into the left side.

                          2. you click the button.

                          3. A dialog appears to choose the platform and devices you want to pre-compile the kernels for ( Radeon 5750, Radeon 6870, Phenom II, etc... )... and also add an option to strip completely the debugging symbol or any thing that could compromise your IP, etc...

                          4. The kernels are precompiled and output to a single .bin file.

                           

                          Also, add that functionality via command-line, so we can call the precompilation tool from a bash shell, ms-dos command-line, batches, etc...

                           

                          You could load after that .bin file from memory/disk using clLoadProgramFromBinary(). The implementation must filter internally all the binary code which does not belong to the current architecture.

                           

                          This is probably the most important feature you should add, because I personally know a lot for commercial projects discarding OpenCL because they simply don't want to distribute their kernels's sources in any form.

                    • Offline Compilation of OpenCL kernel.
                      AM_902

                       

                      Originally posted by: himanshu.gautam All SDK Samples support the option --dump where binares for all AMD devices ae dumped. They can later be used with --load option.

                       

                      I've tried to dump il and isa using option (--dump 3) for MatrixTranspose and MemoryOptimizations Samples of SDK v2.5. The apllication stops responding and debugging takes to this portion of code.

                      I'm using VS 2010 on windows 7, ATI M 5650 GPU and Catalyst 11.7.

                      Is there something wrong with the sample??

                      /* create a cl program executable for all the devices specified */ status = clBuildProgram(program, 0, NULL, flagsStr.c_str(), NULL, NULL); sampleCommon->checkVal(status, CL_SUCCESS, "clBuildProgram failed.");