source: CIVL/examples/omp/transform/omp_parallel_arr.c@ 8190175

main test-branch
Last change on this file since 8190175 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

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

  • Property mode set to 100644
File size: 322 bytes
Line 
1#include <civlc.cvh>
2
3// even to avoid data race
4#ifdef BAD
5#define N 4*2+1
6#else
7#define N 4*2
8#endif
9
10int main () {
11 int len = N;
12 int arr[N];
13
14 for (int i=0; i<len; i++)
15 arr[i] = i;
16
17#pragma omp parallel for firstprivate(len) shared(arr)
18 for (int i=0; i<len; i+=2)
19 arr[(i+1)%len] = arr[i];
20 return 0;
21}
Note: See TracBrowser for help on using the repository browser.