I have a question what are the possibilities of keeping a pointer (address) or an object let’s say one 512**512 matrix in graphic card memory.

I would like to use a Matlab-CUDA combination to get one matrix with fixed values in graphic memory (already done that) and to leave it in graphic memory, end the cuda call, return to matlab and get another matrix with variable content to the graphic card, do a matrix multiplication on a GPU, return one value to Matlab, keep the first matrix in graphic card memory replace the second matrix with new Matrix from matlab etc.

So is it possible to keep one matrix in graphic card memory and keep her address and how (just don’t do cudaFree?) so I can use it in multiple calls of one function in Matlab?