source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB155-missingordered-orig-gpu-no.f95

main
Last change on this file 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 100755
File size: 1.0 KB
RevLine 
[e3f356c]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!By utilizing the ordered construct @23 the execution will be sequentially consistent.
9!No Data Race Pair.
10
11program DRB155_missingordered_orig_gpu_no
12 use omp_lib
13 implicit none
14
15 integer :: var(100)
16 integer :: i
17
18 do i = 1, 100
19 var(i) = 1
20 end do
21
22 !$omp target map(tofrom:var) device(0)
23 !$omp parallel do ordered
24 do i = 2, 100
25 !$omp ordered
26 var(i) = var(i-1)+1
27 !$omp end ordered
28 end do
29 !$omp end parallel do
30 !$omp end target
31
32 do i = 1, 100
33 if (var(i)/=i) then
34 print*,"Data Race Present"
35 end if
36 end do
37
38end program
Note: See TracBrowser for help on using the repository browser.