我正在尝试加速一些由imfilter性能限制的代码,所以我安装了Parallel Computing Toolbox并在gpu阵列上测试了imfilter
EDU>> imfilter(gpuArray([0]), [1])
Error using imfilter
Expected input number 1, A, to be one of these types:
numeric, logical
Instead its type was parallel.gpu.GPUArray.
Error in imfilter>parse_inputs (line 359)
validateattributes(a,{'numeric' 'logical'},{'nonsparse'},mfilename,'A',1);
Error in imfilter (line 131)
[a,h,boundary,flags] = parse_inputs(varargin{:});
我得到的运行方法
EDU>> methods('parallel.gpu.GPUArray')
Methods for class parallel.gpu.GPUArray:
GPUArray display isequaln rem
abs divergence isequalwithequalnans repmat
acos dot isfinite reshape
acosh double isinf ribbon
acot eig islogical rose
acoth end isnan round
acsc eps isocaps scatter3
acsch eq isocolors sec
all erf isonormals sech
and erfc isosurface semilogx
any erfcinv isreal semilogy
area erfcx issorted shiftdim
arrayfun erfinv ldivide shrinkfaces
asec errorbar le sign
asech existsOnGPU length sin
asin exp log single
asinh expm1 log10 sinh
atan ezcontour log1p size
atan2 ezcontourf log2 slice
atanh ezgraph3 logical smooth3
bar ezmesh loglog sort
bar3 ezmeshc lt sprintf
bar3h ezplot lu spy
barh ezplot3 mat2str sqrt
beta ezpolar max stairs
betaln ezsurf mesh stem
bitand ezsurfc meshc stem3
bitcmp feather meshgrid stream2
bitor fft meshz stream3
bitshift fft2 min streamline
bitxor fftn minus streamparticles
bsxfun fill mldivide streamribbon
cast fill3 mod streamslice
cat filter mrdivide streamtube
ceil filter2 mtimes sub2ind
chol find ndgrid subsasgn
circshift fix ndims subsindex
clabel floor ne subsref
classUnderlying fplot norm subvolume
comet fprintf not sum
comet3 full num2str surf
compass gamma numel surfc
complex gammaln or surfl
coneplot gather pareto svd
conj ge pcolor tan
contour gt permute tanh
contour3 hist pie times
contourc horzcat pie3 transpose
contourf hypot plot tril
contourslice ifft plot3 trimesh
conv ifft2 plotmatrix trisurf
conv2 ifftn plotyy triu
cos imag plus uint16
cosh image polar uint32
cot imagesc power uint64
coth ind2sub prod uint8
csc int16 qr uminus
csch int2str quiver uplus
ctranspose int32 quiver3 vertcat
cumprod int64 rdivide vissuite
cumsum int8 real volumebounds
curl interpstreamspeed reallog voronoi
det inv realpow waterfall
diag ipermute realsqrt xor
diff isempty reducepatch
disp isequal reducevolume
Static methods:
colon linspace rand zeros
eye logspace randi
false nan randn
inf ones true
请注意,imfilter似乎不存在。
然而imfilter在其reference page上被宣传为兼容gpuArray。我做错了什么?