source: CIVL/examples/omp/DataRaceBench/micro-benchmarks/matrixvector1-orig-no.c@ e5cec5ae

1.23 2.0 main test-branch
Last change on this file since e5cec5ae was 36a61f3, checked in by Ziqing Luo <ziqing@…>, 9 years ago

Commit DataRaceBench into CIVL examples

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@4225 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 365 bytes
Line 
1// Outer-level parallelization.
2#define N 100
3
4double a[N][N],v[N],v_out[N];
5
6int mv()
7{
8 int i,j;
9#pragma omp parallel for private (i,j)
10 for (i = 0; i < N; i++)
11 {
12 float sum = 0.0;
13 for (j = 0; j < N; j++)
14 {
15 sum += a[i][j]*v[j];
16 }
17 v_out[i] = sum;
18 }
19 return 0;
20}
21
22int main()
23{
24 mv();
25 return 0;
26}
27
Note: See TracBrowser for help on using the repository browser.