I think that, you are already representing the matrices of the cell array A in the sparse form and in that case you are already having the best performance. You can refer to the documentation page of Sparse Matrices and the following MATLAB Answer: Is there a faster way to multiply a sparse and full matrix than standard multiplication in Matlab? for any additional information.
Although, I have tried experimenting the code by making use of gpuArray, and it seems that for m = 100,000 and n = 100 it was consuming less time of all, on my machine. At the same time for lower values of m it is slower. Once try executing the below code:
clc; clear all
%%
m = 100000; N = 100;
u = randn(m,N); v = randn(m,N);
ug = gpuArray(u); vg= gpuArray(v);
A = {}; As = {}; Asg = {};
for i = 1:N
As{i} = sprand(m,m,1/m);
A{i} = full(As{i});
Asg{i} = gpuArray(As{i});
end
%% Not using sparse representation
tic
res = 1;
for k = 1:N
res = res * (u(:, k).' * A{k} * v(:, k));
end
toc
%% Using sparse representation
tic
res = 1;
for k = 1:N
res = res * (u(:, k).' * As{k} * v(:, k));
end
toc
%% Using arrayfun
tic
res = arrayfun(@(k)fun(As,u,v,k),1:N);
res = prod(res);
toc
%% Using gpuArray
tic
res = 1;
for k = 1:N
res = res * (ug(:, k).' * Asg{k} * vg(:, k));
end
toc
function out = fun(A,u,v,k)
out = (u(:, k).' * A{k} * v(:, k));
end