1 ! { dg-do run { target vect_simd_clones } }
3 ! { dg-additional-options "-msse2" { target sse2_runtime } }
4 ! { dg-additional-options "-mavx" { target avx_runtime } }
7 !$omp declare target (N, Q)
8 integer, parameter :: N
= 10000, M
= 1024
11 real function Pfun (k
, i
)
12 !$omp declare simd(Pfun) uniform(i) linear(k) notinbranch
14 integer, value
, intent(in
) :: i
, k
15 Pfun
= (Q(k
,i
) * Q(i
,k
))
19 real function accum () result (tmp
)
25 !$omp parallel do private(tmp1) reduction(+:tmp)
28 !$omp simd reduction(+:tmp1)
30 tmp1
= tmp1
+ Pfun (k
, i
)
37 real function accum_ref () result (tmp
)
45 tmp1
= tmp1
+ Pfun (k
, i
)
56 Q(i
,j
) = 0.001 * i
* j
61 subroutine check (a
, b
)
63 real, parameter :: EPS
= 0.00001
66 else if (a
== 0.0) then
71 if (err
> EPS
.or
. err
< -EPS
) call abort
76 real :: accum
, accum_ref
, d
78 !$omp target update to(Q)
79 call check (accum (), accum_ref ())