1 Reply Latest reply on Aug 22, 2011 5:36 PM by corry

    Function Calls in IL

    corry
      Rules, calling convention, etc

      I figure this should be a really really basic question, with answer in the IL documentation, I seem to be wrong.

      Are function calls so costly even when you are sure every thread will take the branch, execute the same code in the function, and return at the same time that no one uses them?  Or does everyone just experiment to figure it out, either way, I'm calling it out here (ha, calling....it out)

      Specifically, Does the optimizer expect any registers to be specifically maintained, or are all considered volatile?

      Resource declarations - Since you never have a MAIN call, only an ENDMAIN call, you cannot put your declarations outside of main.  Are the declarations for every function in the kernel, or do I need to declare them in the function they will be used in?

      Breaking a kernel into multiple kernels:  I read a post about splitting up a kernel.  Can one kernel make a call to a function defined in another kernel, or that kernels main function, or none of the above?

      How about giving me a preview and letting me know if any of this will change as the APU becomes more fully integrated?

      I come from an x86/64 assmembly background, especially when it comes to vectorizing and optimizing, so this GPU stuff is right up my alley!  (I'm also more than proficient in C/C++, not in spelling.)  I've also worked a little with CUDA/PTX, so no, no one needs to call me out and tell me how different things are.  However, when I see call, func, etc.  No matter what, I begin wondering what are the caveats.  Worst case I'll make a system to inline my functions myself, and indeed will have to do a little of that, but I'd like to keep some of the parts of what I'm doing modular/minimal effort reusable. 

      Thanks

      Corry Lazarowitz

        • Function Calls in IL
          corry

          Well, what a surprise, I start looking through my samples, sure there were CAL Samples, sure some of this should have been answered, but also wanted to get the post out there to deal with the reply lag, and what do I find?  Gone, except the .suo and .user files.  So, I google it, and what do I find?

          Some genius at AMD decided without having a replacement handy, to deprecate, remove, destroy, not tell anyone this was coming, the whole CAL interface, all documentation, all samples, etc.  Thanks AMD.  I'm not going to write a book here, but it seems like my only option is to download an old version, and hope/pray the CAL interface libraries don't disappear without warning in the next several months (I'm guessing that's *EXACTLY* what's going to happen).  Poor software support is what kept me away from ATi for years, since the late 90's.  I finally decide, the hardware is much faster for my purposes, and it seems they have supported CAL for some time, so, though I was the sole dissenter in this R&D lab, I managed to get radeon cards pushed through over comprable nVidia cards.  This is my reward. 

          You have got to understand, not everyone out there is a java programmer who needs the language to deny access to object foot when a reference to object gun has been taken out.  I absolutly, 100% need inline IL if OpenCL is to be a viable toolchain.  This isn't changing any time soon.  I'd actually prefer inline IL in OpenCL to straight CAL, but I'd require straight CAL compared to straight OpenCL.  Can I make this any more clear?  The forums have plenty of others looking for IL support.  You guys need to quit with OpenCL on the CPU bugs like I saw the 2.5 changelog full of, and fix what you removed without warning.