source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB164-simdmissinglock1-orig-gpu-yes.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.1 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!Concurrent access of var@30:13 without acquiring locks causes atomicity violation. Data race present.
9!Data Race Pairs, var@30:13 and var@30:22.
10
11module DRB163
12 integer :: var(16)
13 integer :: i, j
14end module
15
16program DRB163_simdmissinglock1_orig_gpu_no
17 use omp_lib
18 use DRB163
19 implicit none
20
21 do i = 1, 16
22 var(i) = 0
23 end do
24
25 !$omp target map(tofrom:var) device(0)
26 !$omp teams distribute parallel do
27 do i = 1, 20
28 !$omp simd
29 do j = 1, 16
30 var(j) = var(j)+1
31 end do
32 !$omp end simd
33 end do
34 !$omp end teams distribute parallel do
35 !$omp end target
36
37 print*,var(16)
38
39end program
Note: See TracBrowser for help on using the repository browser.