Debian Codegraph @

libgomp/testsuite/libgomp.fortran/target-simd.f90

raw
1 ! { dg-do run }
2
3 program test
4 implicit none
5 real, allocatable :: a(:), b(:)
6 integer :: i
7
8 a = [(i, i = 1, 100)]
9 allocate(b, mold=a)
10 b = 0
11
12 !$omp target simd map(to:a) map(from:b)
13 do i = 1, size(a)
14 b(i) = 5.0 * a(i)
15 end do
16
17 if (any (b - 5.0 *a > 10.0*epsilon(a))) stop 1
18
19 !$omp target simd map(to:a) map(from:b)
20 do i = 1, size(a)
21 b(i) = 2.0 * a(i)
22 end do
23 !$omp end target simd
24
25 if (any (b - 2.0 *a > 10.0*epsilon(a))) stop 2
26 end program test