User`s guide

9 GPU Computing
9-8
Run Built-In Functions on a GPU
In this section...
“MATLAB Functions with gpuArray Arguments” on page 9-8
“Example: Functions with gpuArray Input and Output” on page 9-9
“Sparse Arrays on a GPU” on page 9-10
“Considerations for Complex Numbers” on page 9-11
MATLAB Functions with gpuArray Arguments
Many MATLAB built-in functions support gpuArray input arguments. Whenever any of
these functions is called with at least one gpuArray as an input argument, the function
executes on the GPU and generates a gpuArray as the result. You can mix inputs using
both gpuArray and MATLAB arrays in the same function call; the MATLAB arrays
are transferred to the GPU for the function execution. Supporting functions include
the discrete Fourier transform (fft), matrix multiplication (mtimes), and left matrix
division (mldivide).
The following functions and their symbol operators are enhanced to accept gpuArray
input arguments so that they execute on the GPU:
abs
acos
acosd
acosh
acot
acotd
acoth
acsc
acscd
acsch
accumarray
all
and
angle
any
arrayfun
asec
asecd
asech
asin
asind
asinh
atan
atan2
classUnderlying
colon
compan
complex
cond
conj
conv
conv2
convn
corrcoef
cos
cosd
cosh
cot
cotd
coth
cov
cross
csc
cscd
csch
ctranspose
cummax
cummin
fftshift
filter
filter2
find
fix
flip
fliplr
flipud
floor
fprintf
full
gamma
gammainc
gammaincinv
gammaln
gather
ge
gradient
gt
hankel
histcounts
horzcat
hsv2rgb
hypot
isfinite
isfloat
ishermitian
isinf
isinteger
islogical
ismatrix
ismember
isnan
isnumeric
isreal
isrow
issorted
issparse
issymmetric
istril
istriu
isvector
kron
ldivide
le
legendre
length
log
norm
normest
not
nthroot
null
num2str
numel
ones
or
orth
pagefun
perms
permute
pinv
planerot
plot (and related)
plus
pol2cart
poly
polyarea
polyder
polyfit
polyint
polyval
sign
sin
sind
single
sinh
size
sort
sph2cart
sprintf
sqrt
squeeze
std
sub2ind
subsasgn
subsindex
subspace
subsref
sum
superiorfloat
svd
swapbytes
tan
tand
tanh