作者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