source: CIVL/mods/dev.civl.abc/examples/alias/arrayaccess.cvl

main
Last change on this file was aad342c, checked in by Stephen Siegel <siegel@…>, 3 years ago

Performing huge refactor to incorporate ABC, GMC, and SARL into CIVL repo and use Java modules.

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

  • Property mode set to 100644
File size: 311 bytes
Line 
1
2$input int N=3;
3int a[N];//array a is shared by all threads but each thread writes to different elements of a
4
5void thread1(int tid){
6 a[tid]=tid;
7}
8
9void thread2(int tid, int* p){
10 *p=*p+tid;
11}
12
13int main(void){
14 $parfor(int i: 0 .. N-1)
15 thread1(i);
16 $parfor(int i: 0 .. N-1)
17 thread2(i, &a[i]);
18}
19
Note: See TracBrowser for help on using the repository browser.