I am tring to compute simple example on GPU:
function C=myf(A,B,N) for i=1:N C(:,:,i)=(A(:,:,i)*B)^10; end end
With CPU it works:
M = 100; K = 100; N = 1000; A=rand(M,K,N);B=rand(K,M);C=myf(A,B,N);
With GPU:
if true Aongpu=gpuArray(A); Bongpu=gpuArray(B); C=arrayfun(@myf,Aongpu,Bongpu,N);end
It doesn't:
Error using parallel.gpu.GPUArray/arrayfun Matrix dimensions must agree.
Why?? Thanks in advance
Best Answer