How GPU handles many kernels calling same function?

Discussion created by Raistmer on Apr 22, 2010
Latest reply on Apr 25, 2010 by Raistmer
will all those calls inlined?

If I have many different kernels with similar parts is it worth to separate this part into function? Will GPU use smth like call instruction or this function will be just inlined back into all kernels that call this function by compiler?

Can some code size saving be achieved by using separate functions inside kernels or it's just for programmer convenience?

And another question: where kernels are stored at runtime? Will kernel be stored into GPU globaal memory, into some special limited memory area ot it will be uploaded onto GPU at each kernel call?