I am trying to do some calculations on 3D gpuArrays. Firstly I made my code for 2D arrays, the I did try tomove to 3D. I noticed that results are different, what I am doing wrong and what is the difference when performing multiplication and division between 2D and 3D arrays? As example there is 3D array A(100x5x1):
b = inv(x'*x)*x'*y;
result c is (5x5) array and b(5x5). And if I convert 3D A to gpuArray and perform the following calculations when A (100x5x10);
b1=pagefun(@mtimes,permute(x, [2 1 3]),x);
b2=permute(x, [2 1 3]);
result is b(5x5x10),
Here result is c (100x5x10).Why it is different from 2D array division? What would be the correct way performing same calculations on 3D gpuArrays?