source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB137-simdsafelen-orig-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: 925 bytes
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!The safelen(2) clause safelen(2)@23:16 guarantees that the vector code is safe for vectors up to 2 (inclusive).
9!In the loop, m can be 2 or more for the correct execution. If the value of m is less than 2,
10!the behavior is undefined. No Data Race in b[i]@25:9 assignment.
11
12program DRB137_simdsafelen_orig_no
13 use omp_lib
14 implicit none
15
16 integer :: i, m, n
17 real :: b(4)
18
19 m = 2
20 n = 4
21
22 !$omp simd safelen(2)
23 do i = m+1, n
24 b(i) = b(i-m) - 1.0
25 end do
26
27 print*, b(3)
28end program
Note: See TracBrowser for help on using the repository browser.