2 Replies Latest reply on Jun 18, 2008 4:36 PM by lpw

    Linking a CALimage from multiple CALobjects

    lpw

      I know that I can link two CALobjects into a single CALimage using calclLink().  This analogy with standard (CPU) build methods implies that I should be able to access a function defined in obj1 from a function defined in obj2 using a symbol table.  Is this the case here?  IL does not seem to support the notion of "symbols" at all.  I haven't tried the AMD HLSL compiler yet.

      Could someone please explain how linking multiple objects in CAL is meant to work and/or provide a simple example at the IL level (if possible)?

      Thanks.

        • Linking a CALimage from multiple CALobjects
          MicahVillmow
          lpw,
          The current implementation does not allow functions from one object to be called from another object. Functions all need to be in the same compilation unit for them to be called from another function. At the IL level, this implies that all functions need to be in the same kernel string and at the brook+ level, they need to be in the same compiled file. The reason we allow currently linking of multiple objects into a single image is to allow a single image to contain code for specific devices. This would allow you to write the same kernel optimized for two different stream devices, link them to the same image, and have the runtime select which one to use based on the underlying hardware.
            • Linking a CALimage from multiple CALobjects
              lpw

              Good to know, thanks.  The reason I'm asking is that I wrote some "utility kernels" (double precision math functions, mostly) that I would like to use from other kernels.  Copying and pasting won't work, clearly, but now I'm considering brewing a preprocessor that will allow me to pull in functions from other files as macros.

              Hmmm...

              Thanks for the info!

              Lukasz