source: CIVL/examples/omp/DataRaceBench/micro-benchmarks/truedepfirstdimension-var-yes.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: 400 bytes
Line 
1/*
2 * Outer loop has loop carried true dependence
3 */
4#include <stdlib.h>
5int main(int argc, char* argv[])
6{
7 int i,j;
8 int len = 1000;
9 if (argc>1)
10 len = atoi(argv[1]);
11
12 int n=len, m=len;
13 double b[len][len];
14
15 for (i=0; i<n; i++)
16 for (j=0; j<m; j++)
17 b[i][j] = 0.5;
18
19#pragma omp parallel for
20 for (i=1;i<n;i++)
21 for (j=1;j<m;j++)
22 b[i][j]=b[i-1][j-1];
23
24 return 0;
25}
Note: See TracBrowser for help on using the repository browser.