{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# lec10 - Matrix Multiplication Prepared by Thoai Nam...

This preview shows pages 1–8. Sign up to view the full content.

Matrix Multiplication Prepared by: Thoai Nam Lectured by: Tran Vu Pham

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
-2- Khoa Khoa H uni1ECD c & K uni1EF9 Thu uni1EAD t Máy Tính – Tr ưuni1EDD ng uni0110uni1EA1 i H uni1ECD c Bách Khoa TP. HCM Outline boxshadowdwn Sequential matrix multiplication boxshadowdwn Algorithms for processor arrays – Matrix multiplication on 2-D mesh SIMD model – Matrix multiplication on hypercube SIMD model boxshadowdwn Matrix multiplication on UMA multiprocessors boxshadowdwn Matrix multiplication on multicomputers
-3- Khoa Khoa H uni1ECD c & K uni1EF9 Thu uni1EAD t Máy Tính – Tr ưuni1EDD ng uni0110uni1EA1 i H uni1ECD c Bách Khoa TP. HCM Sequential Matrix Multiplication Global a[0..l-1,0..m-1], b[0..m-1][0..n-1], {Matrices to be multiplied} c[0..l-1,0..n-1], {Product matrix} t, {Accumulates dot product} i, j, k; Begin for i:=0 to l-1 do for j:=0 to n-1 do t:=0; for k:=0to m-1 do t:=t+a[i][k]*b[k][j]; endfor k; c[i][j]:=k; endfor j; endfor i; End.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
-4- Khoa Khoa H uni1ECD c & K uni1EF9 Thu uni1EAD t Máy Tính – Tr ưuni1EDD ng uni0110uni1EA1 i H uni1ECD c Bách Khoa TP. HCM Algorithms for Processor Arrays boxshadowdwn Matrix multiplication on 2-D mesh SIMD model boxshadowdwn Matrix multiplication on Hypercube SIMD model
-5- Khoa Khoa H uni1ECD c & K uni1EF9 Thu uni1EAD t Máy Tính – Tr ưuni1EDD ng uni0110uni1EA1 i H uni1ECD c Bách Khoa TP. HCM Matrix Multiplication on 2D-Mesh SIMD Model boxshadowdwn Gentleman(1978) has shown that multiplication of to n*n matrices on the 2-D mesh SIMD model requires 0(n) routing steps boxshadowdwn We will consider a multiplication algorithm on a 2- D mesh SIMD model with wraparound connections

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
-6- Khoa Khoa H uni1ECD c & K uni1EF9 Thu uni1EAD t Máy Tính – Tr ưuni1EDD ng uni0110uni1EA1 i H uni1ECD c Bách Khoa TP. HCM Matrix Multiplication on 2D-Mesh SIMD Model (cont’d) boxshadowdwn For simplicity, we suppose that – Size of the mesh is n*n – Size of each matrix (A and B) is n*n – Each processor P i,j in the mesh (located at row i,column j) contains a i,j and b i,j boxshadowdwn At the end of the algorithm, P i,j will hold the element c i,j of the product matrix
-7- Khoa Khoa H uni1ECD c & K uni1EF9 Thu uni1EAD t Máy Tính – Tr ưuni1EDD ng uni0110uni1EA1 i H uni1ECD c Bách Khoa TP. HCM Matrix Multiplication on 2D-Mesh SIMD Model (cont’d) boxshadowdwn Major phases (a) Initial distribution of matrices A and B (b) Staggering all A’s elements

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 23

lec10 - Matrix Multiplication Prepared by Thoai Nam...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online