0

I wrote this code: app and cova are matrix with dimension equal to variable dim in the code and gsingle.

dim=32;
gfor q=1:256
     app(:,:,q)=cova(:,:,q)\geye(dim,dim,'single');
gend

if I try to increase the dimension of dim the result is very slow. If i write the equivalent code with for loop and with cpu variable is faster. Why does it happen?

PearsonArtPhoto
  • 38,970
  • 17
  • 111
  • 142
Donaldo84
  • 21
  • 2
  • Jacket uses an upstream library for linear algebra. Unfortunately it optimizes for large matrices rather than many small matrices. So we implemented a fast version up to 32 (or 64 depending on precision). Unfortunately, anything after that uses the slow version. This is the reason for behavior you are seeing. -- Developer of the said function. – Pavan Yalamanchili Nov 16 '12 at 18:22
  • I recommend you to post this as an answer, otherwise the question will remain open. – Dennis Jaheruddin Nov 29 '12 at 09:51

1 Answers1

1

Jacket uses an upstream library for linear algebra. Unfortunately it optimizes for large matrices rather than many small matrices. So we implemented a fast version for matrices of width up to 32 (or 64 depending on precision). Unfortunately, anything after that uses the slow version. This is the reason for behavior you are seeing. I'm the Developer of the said function.

Pavan Yalamanchili
  • 12,021
  • 2
  • 35
  • 55