cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

lpw
Journeyman III

Linking a CALimage from multiple CALobjects

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.

0 Likes
2 Replies

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.
0 Likes

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

 

0 Likes