source: CIVL/examples/omp/transform/omp_atomic.c@ 7d77e64

main test-branch
Last change on this file since 7d77e64 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: 391 bytes
Line 
1#include <civlc.cvh>
2
3#ifdef BAD
4#define EXPR x
5#else
6#define EXPR 2
7#endif
8
9int main () {
10 int x = 0;
11
12#pragma omp parallel shared(x)
13 { int v = 0;
14 int n = 1;
15
16 n = EXPR;
17
18 #pragma omp atomic read
19 v = x;
20
21 #pragma omp atomic write
22 x = n * 10;
23
24 #pragma omp atomic update
25 x = n + x;
26
27 #pragma omp atomic capture
28 v = x = x * 10;
29
30 }
31 return 0;
32}
Note: See TracBrowser for help on using the repository browser.