Which MATLAB functions are multicore aware?

November 22nd, 2009 | Categories: matlab, programming | Tags:

In order to write fully parallel programs in MATLAB you have a few choices but they are either hard work, expensive or both.  For example you could

Wouldn’t it be nice if you could do no work at all and yet STILL get a speedup on a multicore machine?  Well, you can….sometimes.

Slowly but surely, The Mathworks are parallelising some of the built in MATLAB functions to make use of modern multicore processors.  So, for certain functions you will see a speed increase in your code when you move to a dual or quad core machine.  But which functions?

On a recent train journey I trawled through all of the release notes in MATLAB and did my best to come up with a definitive list and the result is below.

Alongside each function is the version of MATLAB where it first became parallelised. If there is any extra detail then I have included it in brackets (typically things like – ‘this function is only run in parallel for input arrays of more than 20,000 elements’). I am almost certainly missing some functions and details so if you know something that I don’t then please drop me a comment and I’ll add it to the list.

Of course when I came to write all of this up I did some googling and discovered that The Mathworks have already answered this question themselves!  Oh well….I’ll publish my list anyway.

Update 8th March 2010: Added new functions that became multicore aware in version 2010a. Also added multicore aware functions from the image processing toolbox.

abs (for double arrays > 200k elements),2007a
acos (for double arrays > 20k elements),2007a
acosh (for double arrays > 20k elements),2007a
applylut,2009b (Image processing toolbox)
asin (for double arrays > 20k elements),2007a
asinh(for double arrays > 20k elements),2007a
atan (for double arrays > 20k elements),2007a
atand (for double arrays > 20k elements),2007a
atanh (for double arrays > 20k elements),2007a
backslash operator (A\b for double arrays > 40k elements),2007a
bsxfun,2009b
bwmorph,2010a (Image processing toolbox)
bwpack,2009b (Image processing toolbox)
bwunpack,2009b (Image processing toolbox)
ceil (for double arrays > 200k elements),2007a
conv2,(two input form),2010a
cos (for double arrays > 20k elements),2007a
cosh (for double arrays > 20k elements),2007a
det (for double arrays > 40k elements),2007a
edge,2010a (Image processing toolbox)
erf,2009b
erfc,2009b
erfcx,2009b
erfinv,2009b
exp (for double arrays > 20k elements),2007a
expm (for double arrays > 40k elements),2007a
fft,2009a
fft2,2009a
fftn,2009a
filter,2009b
fix (for double arrays > 200k elements),2007a
floor (for double arrays > 200k elements),2007a
gamma,2009b
gammaln,2009b
hess (for double arrays > 40k elements),2007a
hypot (for double arrays > 200k elements),2007a
ifft,2009a
ifft2,2009a
ifftn,2009a
imabsdiff,2010a (Image processing toolbox)
imadd,2010a (Image processing toolbox)
imclose,2010a (Image processing toolbox)
imdilate,2009b (Image processing toolbox)
imdivide,2010a (Image processing toolbox)
imerode,2009b (Image processing toolbox)
immultiply,2010a (Image processing toolbox)
imopen,2010a (Image processing toolbox)
imreconstruct,2009b (Image processing toolbox)
int16 (for double arrays > 200k elements),2007a
int32 (for double arrays > 200k elements),2007a
int8 (for double arrays > 200k elements),2007a
inv (for double arrays > 40k elements),2007a
iradon,2010a (Image processing toolbox)
isinf (for double arrays > 200k elements),2007a
isnan (for double arrays > 200k elements),2007a
ldivide,2008a
linsolve (for double arrays > 40k elements),2007a
log,2008a
log2,2008a
logical (for double arrays > 200k elements),2007a
lscov (for double arrays > 40k elements),2007a
Matrix Multiply (X*Y - for double arrays > 40k elements),2007a
Matrix Power (X^N - for double arrays > 40k elements),2007a
max (for double arrays > 40k elements),2009a
medfilt2,2010a (Image processing toolbox)
min (for double arrays > 40k elements),2009a
mldivide (for sparse matrix input),2009b
mod (for double arrays > 200k elements),2007a
pow2 (for double arrays > 20k elements),2007a
prod (for double arrays > 40k elements),2009a
qr (for sparse matrix input),2009b
rcond (for double arrays > 40k elements),2007a
rdivide,2008a
rem,2008a
round (for double arrays > 200k elements),2007a
sin (for double arrays > 20k elements),2007a
sinh (for double arrays > 20k elements),2007a
sort (for long matrices),2009b
sqrt (for double arrays > 20k elements),2007a
sum (for double arrays > 40k elements),2009a
tan (for double arrays > 20k elements),2007a
tand (for double arrays > 200k elements),2007a
tanh (for double arrays > 20k elements),2007a
unwrap (for double arrays > 200k elements),2007a
various operators such as x.^y (for double arrays > 20k elements),2007a
Integer conversion and arithmetic,2010a
No comments yet.