call CUfunction from kernel - is it possible?

Hello Developers!

I have successfully JIT kompiled a kernel as descriped in this question and this article.

Now i have a problem with calling that kernel. When i have planned my project I thought that I can easily call the compiled kernels from my active kernel. However this is not descriped in the article and I have read (i think it was in that article linked above) that it is furthermore not possible.

At the moment i am calling my kernel in a kernel like this:

cuLaunchKernel(myKernel, 1, 1, 1, 1, 1, 1, 0, NULL, args, 0);

Maybe it would make sense to compile that kernel as a device function. However i was not able to get that running…

Back to the problem: With calling cuLaunchKernel the compiler gives me the message

calling a __host__ function("cuLaunchKernel") from a __global__ function("myGlobalKernel") is not allowed

an that makes totally sense, because cuLaunchKernel is a host function.

The question is: Do you know a solution to call my compiled kernels from another kernel?
And when not, what is a good workaround?
[b]

To the workaround:[/b]

When calling in the global kernel is not possible i could call my compiled kernels before the global kernel and pass the values of the compiled kernel to the global kernel via parameter.
But this is only possible when there is a async cuLaunchKernel function. Otherwise i do not think that i will have any performance benefit of JIT compiling. Additionaly this solution is not that nice than calling the compiled kernel in the global one.

Thanks for your help and time!
Jens