(
a: &Vec<[f32; VECTOR_SIZE]>,
b: &Vec<[f32; VECTOR_SIZE]>,
result: &mut Vec<[f32; VECTOR_SIZE]>,
)
| 1 | use crate::constants::VECTOR_SIZE; |
| 2 | |
| 3 | pub fn gemm( |
| 4 | a: &Vec<[f32; VECTOR_SIZE]>, |
| 5 | b: &Vec<[f32; VECTOR_SIZE]>, |
| 6 | result: &mut Vec<[f32; VECTOR_SIZE]>, |
| 7 | ) { |
| 8 | for i in 0..a.len() { |
| 9 | for j in 0..VECTOR_SIZE { |
| 10 | let mut sum = 0.0_f32; |
| 11 | for k in 0..VECTOR_SIZE { |
| 12 | sum += a[i][k] * b[k][j]; |
| 13 | } |
| 14 | result[i][j] = sum; |
| 15 | } |
| 16 | } |
| 17 | } |