Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

What is the difference when multiplying and dividing 3D gpuArrays compared to 2D?

조회 수: 1 (최근 30일)
Mantas Vaitonis
Mantas Vaitonis 2018년 7월 13일
마감: Mantas Vaitonis 2018년 7월 13일
Hello,
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):
x=A
y=A
b = inv(x'*x)*x'*y;
C=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);
bb=pagefun(@inv,b1);
b2=permute(x, [2 1 3]);
b3= pagefun(@mtimes,bb,b2);
b=pagefun(@mtimes,b3,y);
result is b(5x5x10),
c=bsxfun(@mldivide,x,y);
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?

답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by