minor mt updates
[riscv-tests.git] / benchmarks / mt-matmul / matmul.c
1 #include "dataset.h"
2 #include "util.h"
3
4 void __attribute__((noinline)) matmul(const int coreid, const int ncores, const int lda, const data_t A[], const data_t B[], data_t C[] )
5 {
6 int i, j, k;
7 int block = lda / ncores;
8 int start = block * coreid;
9
10 for ( j = start; j < (start+block); j++ )
11 {
12 for ( k = 0; k < lda; k++ )
13 {
14 for ( i = 0; i < lda; i++ )
15 {
16 C[i + j*lda] += A[j*lda + k] * B[k*lda + i];
17 }
18 }
19 }
20 }