I have a developed a library function that gets passed a kernel in the form of a CUBIN file. Every time the function gets called, cuModuleLoad is called to load the kernel before it is launched. Are modules loaded using this function cached in any way? Or are the files reloaded into memory every time I call this function (this can be hundreds or thousands of times per program run)?
In case it is not cached, Is it possible to stop this by, say, persisting my module reference somewhere in memory?
(BTW, the function is compiled as a MATLAB mex file)