3 function dotprod_ref (B
, C
, N
) result (sum
)
5 real :: B(N
), C(N
), sum
9 sum
= sum
+ B(i
) * C(i
)
13 function dotprod (B
, C
, n
) result(sum
)
14 real :: B(N
), C(N
), sum
17 !$omp target map(to: B, C) map(tofrom: sum)
18 !$omp teams num_teams(8) thread_limit(16) reduction(+:sum)
19 !$omp distribute parallel do reduction(+:sum) &
20 !$omp& dist_schedule(static, 1024) schedule(static, 64)
22 sum
= sum
+ B(i
) * C(i
)
28 subroutine init (B
, C
, N
)
33 C(i
) = 0.000001 * i
* i
37 subroutine check (a
, b
)
39 real, parameter :: EPS
= 0.0001
42 else if (a
== 0.0) then
47 if (err
> EPS
.or
. err
< -EPS
) call abort
53 real, pointer, dimension(:) :: B
, C
57 ref
= dotprod_ref (B
, C
, n
)