3 Replies Latest reply on Apr 11, 2012 2:23 PM by Meteorhead

    Getting started with CAL

    Meteorhead

      Hi all!

       

      I have been thinking for a long time, that I should start fiddling around with CAL, or injecting CAL into OpenCL, since the implementation of features into OpenCL is REALLY slow. GDS and GWS are two very badly missed features for me. The HW has been capable since HD 4xxx (!!!) but no vendor specific extension made it into OpenCL for roughly 3 years, although I think the community has expressed it enough that these would be kick@ss features.

       

      Since official CAL support is dropped, it makes it even harder for someone to do the homework instead of AMD (present corporate programmers should not take this blame, but the people that decide how many of you should be doing the work).

       

      Can someone give me some tipps, links, suggestions where I could start, where to find reasonable (and not seriosly outdated) documentation, are there any tutorials available, best practice guide, rules of thumb, whatever... I am no newbie to OpenCL (have been programming it from first beta version to be precise), but I have never messed with CAL. I have seen the CAL++ project (have not taken a look yet), but I don't know if CAL users find that useful or not. I could INVEST time, but not WASTE.

       

      Any help from the ninjas (or wannabe ninjas) is appreciated.

       

      Thx,

      Máté

        • Re: Getting started with CAL
          realhet

          Hi!

           

          Check out these (I guess you did already):

          http://developer.amd.com/sdks/AMDAPPSDK/assets/AMD_HD_6900_Series_Instruction_Set_Architecture.pdf

          This for understand how HD4xxx..HD6xxx hardware works.

          http://developer.amd.com/sdks/AMDAPPSDK/assets/AMD_Intermediate_Language_(IL)_Specification_v2.pdf

          This one to know all the possibilities of the AMD_IL language.

          And finally you can learn the CPU side module/memory/kernel management from the old CAL examples from an old Stream SDK version.

          I'm using CAL/AMD_Il since 2 years ago , but I don't know about any tutorials at all...

          The most accurate and up to date learning material for CAL is the AMD_IL output of the OpenCL compiler (How to use memory IO, thread indexing, UAV, LDS and other special stuff properly).

           

          For the new HD7xxx hardware imho the current amd_il language is  overcomplicated because no vectorization needed at all. And for  previous VLIW hardware the calcompiler will 'revectorize' the amd_il code whether you use quad registers (r4.xyzw) or just single 32bit  values (r4.x, r4.y, ... in separate repeated instructions).

           

          Tho' I really like to program in CAL/IL, I understand they want to deprecate it.

          But hey! Since 3 months the latest hardware generation came out, and there IS a fully functional CAL since the 1st day.

          1 of 1 people found this helpful
            • Re: Getting started with CAL
              MicahVillmow

              While this approach is completely unsupported, one thing you can do is as follows.

              1) Write code in OpenCL

              2) Compile to AMDIL and have it stored in the binary with -fbin-amdil

              3) Deconstruct the binary and update/replace the IL.

              4) Use the OpenCL binary in your OpenCL program.

               

              While there is a lot of performance to gain from using IL, you will not be able to get that with using the CAL API. The CAL API has been frozen for 3 years almost and it does not expose all of the functionality to get high performance that the OpenCL API can achieve.

              One example would be caching on UAV's, this isn't possible with CAL because certain functions are not exposed, but using the OpenCL API, this is possible.

              1 of 1 people found this helpful
            • Re: Getting started with CAL
              Meteorhead

              Thanks for the info. I will get to reading through the IL spec and try to understand the mechanism. It does seem a bit too low-level, but I know that's what I was asking for. If I have questions that are still very... uneducated about the topic, I'll post them here for anyone following in my footsteps, as the same questions might arise in others too.

               

              Thanks again,

              Máté