modified autogen.sh to remove reference to osl/
[converter.git] / tests / c_files / matmul.c
blob4e91c1e9a291d09d8d1b08b4545a5283552aff76
1 /* matmul.c 128*128 matrix multiply */
2 #include <stdio.h>
3 #define N 128
5 int main()
7 int i,j,k;
8 float a[N][N], b[N][N], c[N][N];
10 /* We read matrix a */
11 for(i=0; i<N; i++)
12 for(j=0; j<N; j++)
13 scanf(" %f",&a[i][j]);
15 /* We read matrix b */
16 for(i=0; i<N; i++)
17 for(j=0; j<N; j++)
18 scanf(" %f",&b[i][j]);
20 /* c = a * b */
21 #pragma scop
22 for(i=0; i<N; i++)
23 for(j=0; j<N; j++)
25 c[i][j] = 0.0;
26 for(k=0; k<N; k++)
27 c[i][j] = c[i][j] + a[i][k]*b[k][j];
29 #pragma endscop
31 /* We print matrix c */
32 for(i=0; i<N; i++)
34 for(j=0; j<N; j++)
35 printf("%6.2f ",c[i][j]);
36 printf("\n");
39 return 0;