6 Replies Latest reply on Nov 1, 2010 5:32 PM by arsenm

    creating opencl binary kernel with CAL

    byly

      Hi!

      Can I create OpenCL binary kernel (listed as preview feature in 2.1 SDK release) somehow using CAL and ISA or IL assembly language?

      My problem is OpenCL compiler preventing me from optimizing code enough while manual optimization path looks quite straightforward. My code snippets work with performance near to theoretical while being assembled together program runs 3x slower than expected.

        • creating opencl binary kernel with CAL
          zeland

           

          Originally posted by: byly Hi!

           

          Can I create OpenCL binary kernel (listed as preview feature in 2.1 SDK release) somehow using CAL and ISA or IL assembly language? My problem is OpenCL compiler preventing me from optimizing code enough while manual optimization path looks quite straightforward. My code snippets work with performance near to theoretical while being assembled together program runs 3x slower than expected.

           

          UP.

          I'm interesting in it too.

            • creating opencl binary kernel with CAL
              genaganna

               

              Originally posted by: zeland
              Originally posted by: byly Hi!

               

               Can I create OpenCL binary kernel (listed as preview feature in 2.1 SDK release) somehow using CAL and ISA or IL assembly language? My problem is OpenCL compiler preventing me from optimizing code enough while manual optimization path looks quite straightforward. My code snippets work with performance near to theoretical while being assembled together program runs 3x slower than expected.

               

               



               

              UP.

               

              I'm interesting in it too.

               

              There is no way to do this. I don't think this will be available in future as OpenCL compiler able to optimize code in future.

                • creating opencl binary kernel with CAL
                  zeland

                  from "CAL Programming Guide":

                  2.2.3 High Level Kernel Languages
                  chrome://simplemail/content/blank.html?ui=2&ik=e681aae223&view=att&th=12aa93e58ef1d9c1&attid=0.1&disp=emb&zw<...>
                  For example, developers can use OpenCL to develop their kernels, then generate the
                  equivalent ATI IL using offline tools provided by ATI
                  . The generated ATI IL kernel
                  then can be passed to the CAL compiler, with any required modifications, for
                  generating the binary image.

                  <...>

                   

                  I want to use CAL++ for generating the binary image and loading it to OpenCL program.

                   

                  mr. Hazeman, where are you, bro?

                    • creating opencl binary kernel with CAL
                      ryta1203

                       

                      Originally posted by: zeland from "CAL Programming Guide":

                      2.2.3 High Level Kernel Languages chrome://simplemail/content/blank.html?ui=2&ik=e681aae223&view=att&th=12aa93e58ef1d9c1&attid=0.1&disp=emb&zw<...> For example, developers can use OpenCL to develop their kernels, then generate the equivalent ATI IL using offline tools provided by ATI. The generated ATI IL kernel then can be passed to the CAL compiler, with any required modifications, for generating the binary image. <...>

                       

                       

                      This seems to be a little diff than what the OP asked. The above doesn't explicitly state that you can reuse that image with OpenCL.

                      To me, the above means that you can generate the IL with OpenCL for "ease of use" and then tweak that IL and run it in CAL.

                      The OP is asking if he can create a kernel in CAL and then run it in OpenCL.

                      Though I could be misinterpreting things.

                      Though I do  have a question, will those OpenCL "optimizations" not be available in the CAL compiler?

                      Does this mean that non-hand tuned OpenCL should beat non-hand tuned CAL?

                      This seems backwards, IMO.



                       

                        • creating opencl binary kernel with CAL
                          byly

                          Thank you for your replies!

                          I was missing for some time, being upset after not seeing any replies for a long Since than I implemented CAL/IL version of my code, and yes, it runs almost *4* times faster!

                          After getting some experience w/ IL I used some (quite weird, BTW, for the ordinary logics) optimization techniques to OpenCL (backported so to say but it's still very far behind IL (approx. 2 times slower).

                          I still see no problems with feeding IL code to OpenCL as a binary, except for unspecified OpenCL kernel calling ABI which isn't too complex to simulate, IMHO. Anyway, I see no reason to disable OpenCL developers to use IL fragments one way or another, although support for this is obviously absent from OpenCL spec.

                          P.S. And yes, ryta1203 is right: originally I wanted to use IL code with the more user-friendly OpenCL host API, not vice versa.