Consider the following simple speed test for arrayfun:
arrayfun
T = 4000; N = 500; x = randn(T, N); Func1 = @(a) (3*a^2 + 2*a - 1); tic Soln1 = ones(T,
That because!!!!
x = randn(T, N);
is not gpuarray type;
gpuarray
All you need to do is
x = randn(T, N,'gpuArray');