cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

mjambor
Journeyman III

Is there any chance to call an HSAIL function in another module?

Snec I'm a "newcommer" I have to ask here, although this would be better suited in the HSA category, anyway:

Is there any way to call an HSAIL function that is in a different (BRIG) module than the calling function/kernel?

If I just try to declare and not define a function in a module, the HSAIL assembler complains that the

function has module linkage and therefore has to be defined within the module too.  And there does not seem

to be anything like global linkage.

I'm exploring options of providing various library function for kernels this way and so using the icall instruction

extensively seems like a overkill and a very complex method too.  The compiler would have to know about all

library functions to generate the calling code and the dispatcher would have to do possibly very many lookups

before launching any kernel.

Thanks,

Martin

0 Likes
1 Solution
mjambor
Journeyman III

OK, so I have discovered that the HSA 1.0F programmers manual has a new chapter on libraries and addig a keywork prog most progbably solves the issue:

decl prog function &libfoo(arg_u32 %res)(arg_u32 %sptr);

I thought the & part of the identifier implied module linkage (BTW, section 4.6.1 of the same maual says it does) and did not know about the prog keyword.

I believ this resolves my issue.

View solution in original post

2 Replies
jtrudeau
Staff

Welcome! You are whitelisted, and I have moved this into the HSA forum!

0 Likes
mjambor
Journeyman III

OK, so I have discovered that the HSA 1.0F programmers manual has a new chapter on libraries and addig a keywork prog most progbably solves the issue:

decl prog function &libfoo(arg_u32 %res)(arg_u32 %sptr);

I thought the & part of the identifier implied module linkage (BTW, section 4.6.1 of the same maual says it does) and did not know about the prog keyword.

I believ this resolves my issue.