source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB001-antidep1-orig-yes.f95@ cc8e265

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since cc8e265 was e3f356c, checked in by Wenhao Wu <wuwenhao@…>, 5 years ago

merge from branch omptrans for tacas2022

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

  • Property mode set to 100755
File size: 1.3 KB
Line 
1!!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!
2!!! Copyright (c) 2017-20, Lawrence Livermore National Security, LLC
3!!! and DataRaceBench project contributors. See the DataRaceBench/COPYRIGHT file for details.
4!!!
5!!! SPDX-License-Identifier: (BSD-3-Clause)
6!!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!
7
8!A loop with loop-carried anti-dependence.
9!Data race pair: a[i+1]@36:9 vs. a[i]@36:16
10
11!!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -!!
12!! NOTE by WenhaoWu (wuwenhao@udel.edu) !!
13!! This example is modified so that the bound can be adjusted !!
14!! by defining 'N' and if it is not defined then the bound value !!
15!! in the original example is used as the default value of 'N' !!
16!!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -!!
17
18#ifndef N
19#define N 10
20#endif
21
22program DRB001_antidep1_orig_yes
23use omp_lib
24 implicit none
25 integer :: i, len
26 integer :: a(N)
27
28 len = N
29
30 do i = 1, len
31 a(i) = i
32 end do
33
34 !$omp parallel do
35 do i = 1, len-1
36 a(i) = a(i+1) + 1
37 end do
38 !$omp end parallel do
39
40 100 format ('a(N/2)=',i3)
41 print 100, a(N/2)
42end program
Note: See TracBrowser for help on using the repository browser.