MATLAB: Sparse for gpuArray problem

gpuarraysparse

Hello, i got problem with the code below:
pix=pix1; %pix1 is gpuArray with size 5194x2

P1=pix(:,2); %gpuArray with size 5194x1

P2=pix(:,1); %gpuArray with size 5194x1
spr=sparse(P1,P2,1,size(A,1),size(A,2));
%Error using gpuArray/sparse. Too many input arguments
but if i put "gather", it shows no error.
pix=pix1; %pix1 is gpuArray with size 5194x2
pix=gather(pix); % double with 5194x2
P1=pix(:,2); %double with size 5194x1

P2=pix(:,1); %double with size 5194x1
spr=sparse(P1,P2,1,size(A,1),size(A,2));
What went wrong? Any limitation for sparse in gpuArray? My GPU is 4GB

Best Answer

Yes, in R2015b the five-argument form of sparse is not supported for gpuArray. See help gpuArray/sparse.
Now that it's out you can upgrade to R2016a, which does support the five-argument form of gpuArray/sparse.