MATLAB: How to cut a sparse gpuArray

gpuParallel Computing Toolboxsparse gpuarray

I am trying to save memory on my GPU by saving sparse data, but matlab gives this error whenever I try to cut a sparse gpuArray in the following way.
Error using gpuArray/subsref
Sparse gpuArrays are not supported for this function.
Ex.
A=gpuArray(sparse(randi([0,1],2000,2000)));
B=A(1:50,:);
Is there any way to cut sparse gpuArrays, or am I stuck transferring data between my CPU and GPU?
NOTE: This is a piece of example code. Although this piece of code will not have memory benefits from a sparse array, my application will.

Best Answer

Here's a workaround equivalent to B=A(1:50,:), but I do agree it seems unnecessarily awkward.
B = gpuArray.speye(50,2000) * A;
Related Question