@@ -1573,21 +1573,21 @@ mod tests {
15731573 for j in 0 ..2 {
15741574 let at = i + j * LANES ;
15751575 let weight = load8 ( & b[ at..] ) ;
1576- for ( r , row ) in rows. iter ( ) . enumerate ( ) {
1577- acc [ r ] [ j] = load8 ( & row[ at..] ) . mul_add ( weight, acc [ r ] [ j] ) ;
1576+ for ( row , sums ) in rows. iter ( ) . zip ( acc . iter_mut ( ) ) {
1577+ sums [ j] = load8 ( & row[ at..] ) . mul_add ( weight, sums [ j] ) ;
15781578 }
15791579 }
15801580 i += 2 * LANES ;
15811581 }
15821582 let mut out = [ 0f32 ; 4 ] ;
1583- for ( r , row) in rows. iter ( ) . enumerate ( ) {
1584- let mut sum = horizontal ( acc [ r ] [ 0 ] + acc [ r ] [ 1 ] ) ;
1583+ for ( ( value , row) , sums ) in out . iter_mut ( ) . zip ( rows. iter ( ) ) . zip ( acc . iter ( ) ) {
1584+ let mut sum = horizontal ( sums [ 0 ] + sums [ 1 ] ) ;
15851585 let mut at = i;
15861586 while at < b. len ( ) {
15871587 sum += row[ at] * b[ at] ;
15881588 at += 1 ;
15891589 }
1590- out [ r ] = sum;
1590+ * value = sum;
15911591 }
15921592 out
15931593 }
@@ -1647,7 +1647,7 @@ mod tests {
16471647 }
16481648 }
16491649
1650- fn matmul_blocked8 ( y : & mut [ f32 ] , x : & [ f32 ] , w : & [ f32 ] , t : usize , k : usize , n : usize ) {
1650+ fn matmul_blocked8 ( y : & mut [ f32 ] , x : & [ f32 ] , w : & [ f32 ] , k : usize , n : usize ) {
16511651 y. par_chunks_mut ( n * TILE )
16521652 . zip ( x. par_chunks ( k * TILE ) )
16531653 . for_each ( |( out_tile, in_tile) | tile_blocked8 ( out_tile, in_tile, w, k, n) ) ;
@@ -1678,7 +1678,7 @@ mod tests {
16781678 }
16791679 }
16801680
1681- fn matmul_blocked ( y : & mut [ f32 ] , x : & [ f32 ] , w : & [ f32 ] , t : usize , k : usize , n : usize ) {
1681+ fn matmul_blocked ( y : & mut [ f32 ] , x : & [ f32 ] , w : & [ f32 ] , k : usize , n : usize ) {
16821682 y. par_chunks_mut ( n * TILE )
16831683 . zip ( x. par_chunks ( k * TILE ) )
16841684 . for_each ( |( out_tile, in_tile) | tile_blocked ( out_tile, in_tile, w, k, n) ) ;
@@ -1831,18 +1831,18 @@ mod tests {
18311831 }
18321832 let plain = flop * passes as f64 / start. elapsed ( ) . as_secs_f64 ( ) / 1e9 ;
18331833
1834- matmul_blocked ( & mut y, & x, & w, t , k, n) ;
1834+ matmul_blocked ( & mut y, & x, & w, k, n) ;
18351835 let start = std:: time:: Instant :: now ( ) ;
18361836 for _ in 0 ..passes {
1837- matmul_blocked ( & mut y, & x, & w, t , k, n) ;
1837+ matmul_blocked ( & mut y, & x, & w, k, n) ;
18381838 }
18391839 let four = flop * passes as f64 / start. elapsed ( ) . as_secs_f64 ( ) / 1e9 ;
18401840 let error4 = relative ( & reference, & y) ;
18411841
1842- matmul_blocked8 ( & mut y, & x, & w, t , k, n) ;
1842+ matmul_blocked8 ( & mut y, & x, & w, k, n) ;
18431843 let start = std:: time:: Instant :: now ( ) ;
18441844 for _ in 0 ..passes {
1845- matmul_blocked8 ( & mut y, & x, & w, t , k, n) ;
1845+ matmul_blocked8 ( & mut y, & x, & w, k, n) ;
18461846 }
18471847 let eight = flop * passes as f64 / start. elapsed ( ) . as_secs_f64 ( ) / 1e9 ;
18481848 let error8 = relative ( & reference, & y) ;
0 commit comments