Path: news.mathworks.com!not-for-mail
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$1@fred.mathworks.com>
References: <ibmvr7$9no$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1289698563 23003 172.30.248.35 (14 Nov 2010 01:36:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 14 Nov 2010 01:36:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 756104
Xref: news.mathworks.com comp.soft-sys.matlab:686613

"Marc Moreau" <jebnor@gmail.com> wrote in message <ibmvr7$9no$1@fred.mathworks.com>...
> 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