Changes between Version 71 and Version 72 of Next-GenOpenMPTransformation
- Timestamp:
- 03/17/21 10:45:37 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Next-GenOpenMPTransformation
v71 v72 42 42 43 43 {{{ 44 void $check_data_race($mem *rs, $mem *ws, int n, int tid) { 45 $assert( 46 $forall (int j: 0 .. nthreads - 1) (j != tid) ==> 47 $mem_disjoint(ws[tid], $mem_union(rs[j], ws[j])) && 48 $mem_disjoint(...) 49 ); 50 } 51 }}} 52 {{{ 44 53 // Init parallel region env. 45 54 $range _omp_thread_range = 0 .. _omp_nthreads - 1; 46 55 $domain(1) _omp_dom = ($domain){_omp_thread_range}; 47 56 $omp_gteam _omp_gteam = $omp_gteam_create($here, _omp_nthreads); 57 $mem rs[_omp_nthreads], ws[_omp_nthreads]; 58 for(..) { 59 ws[i] = empty; 60 rs[i] = empty; 61 } 48 62 $for (int _omp_tid: _omp_dom) { 49 63 $depends_on(/*nothing*/)$atomic{ … … 62 76 } 63 77 // RS stack: rs0:={A, B}; WS stack: ws0:={A, B}; 64 $check_data_race( ); // 1st check78 $check_data_race(&rs, &ws, nthreads, tid); // 1st check 65 79 $track_clean(); 80 rs[tid] = $mem_empty(); 81 ws[tid] = $mem_empty(); 66 82 // RS stack: rs0:={}; WS stack: ws0:={}; 67 83 C; 68 $check_data_race( ); // 2nd check84 $check_data_race(&rs, &ws, nthreads, tid); // 2nd check 69 85 } // RS stack: <empty>; WS stack: <empty>; empty sets rs0, ws0; 70 86 } // end $atomic
