1 /* { dg-do run { target vect_simd_clones } } */
2 /* { dg-additional-options "-msse2" { target sse2_runtime } } */
3 /* { dg-additional-options "-mavx" { target avx_runtime } } */
11 #pragma omp declare target
13 #pragma omp declare simd uniform(i) linear(k) notinbranch
14 float Pfun (const int i
, const int k
)
16 return Q
[i
][k
] * Q
[k
][i
];
18 #pragma omp end declare target
23 for (i
= 0; i
< N
; i
++)
24 for (j
= 0; j
< N
; j
++)
25 Q
[i
][j
] = 0.001 * i
* j
;
33 for (i
= 0; i
< N
; i
++)
37 for (k
= 0; k
< M
; k
++)
52 #pragma omp parallel for reduction(+:tmp)
53 for (i
= 0; i
< N
; i
++)
57 #pragma omp simd reduction(+:tmp1)
58 for (k
= 0; k
< M
; k
++)
67 void check (float a
, float b
)
69 float err
= (b
== 0.0) ? a
: (a
- b
) / b
;
70 if (((err
> 0) ? err
: -err
) > EPS
)
78 #pragma omp target update to(Q)
80 check (accum (), accum_ref ());