作者XrGodz (紐愛銅管分部首席)
看板TransCSI
標題[問題] 東吳考古-化簡程式
時間Tue Jun 5 23:26:21 2007
Assuming the 2-dimensional matrix is stored in memory using row-major order.
To improve the performance of the matrix multiplication, what can you do to
the following algorithm to make it run faster ?
Assuming c=a*b
for(i = 0 ; i < n ; i ++ )
for(j = 0 ; j < n ; j ++)
for(k = 0 ; k < n ; k ++)
c[i][j] += a[i][k] * b[k][j]
小弟只知道拆成2個 2個的for迴圈 (還是有別的解法?)
但不知道要怎樣下手....
麻煩各為大大了m(__ __)m
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.223.194.17
1F:→ stevennick:完全看不懂題目呀,您還是打上來或者給連結吧 06/06 02:20
2F:推 ccpz:如果用 SIMD 讓他跑更快可以嗎 XD 06/06 07:05
※ 編輯: XrGodz 來自: 61.229.21.41 (06/06 10:03)
3F:推 Daiblo2:我覺得也是拆成2個 2個for迴圈這樣跑比較快 06/06 12:44