keeping persistent cuda context from dll

Hello All,

I am writing an application that has the UI in C# and is making multiple calls to a cuda dll.
The problem is that I think the cuda context is dying every time my dll exits and returns to the c# code.
Is there a way for me to keep the cuda context alive so that I do not have to deal with cuda setup time every time I call the dll?



just in case anyone was wondering.
I found some information on this and timed out some dll calls and it seems as if the context is only created the first dll call.
I assume that this is as long as the thread that calls the dll is still open and you dont cudathreadexit.

happy hunting.