From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Pass by reference in MexFunction
Date: Sun, 14 Nov 2010 01:36:03 +0000 (UTC)
Organization: Boeing Co
Lines: 12
Message-ID: <ibnee3$mer$>
References: <ibmvr7$9no$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1289698563 23003 (14 Nov 2010 01:36:03 GMT)
NNTP-Posting-Date: Sun, 14 Nov 2010 01:36:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 756104
Xref: comp.soft-sys.matlab:686613

"Marc Moreau" <> wrote in message <ibmvr7$9no$>...
> Hello all,
> I'm doing some work with EEGLAB where I would like implement a Wavelet transform on CUDA.   One of the concerns we have with memory allocation.  The input and output to the function is large, so large in fact, that we would like to not have to create new output matrixes for each call.  We would like to preallocate the output array and then repeatedly use it on subsequent calls.  I have been looking around and have been unable to locate any documentation on how this is possible or why it isn't.
> Any suggestions?
> Marc Moreau

Arguments to mex routines are pass by reference and can (if you are careful) be modified in-place. Is that what you mean?

James Tursa